Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Kleopatra
Commits
93221c7f
Commit
93221c7f
authored
Dec 15, 2021
by
Ingo Klöcker
Browse files
Set the key origin when importing keys retrieved via WKD
GnuPG-bug-id: 5334
parent
80ecfe9a
Pipeline
#110526
passed with stage
in 3 minutes and 23 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
93221c7f
...
...
@@ -111,6 +111,7 @@ if (QGpgme_VERSION VERSION_GREATER_EQUAL "1.16.1")
set
(
QGPGME_CRYPTOCONFIGENTRY_HAS_DEFAULT_VALUE 1
)
set
(
QGPGME_SUPPORTS_WKDLOOKUP 1
)
set
(
QGPGME_SUPPORTS_IMPORT_WITH_FILTER 1
)
set
(
QGPGME_SUPPORTS_IMPORT_WITH_KEY_ORIGIN 1
)
endif
()
# Kdepimlibs packages
...
...
config-kleopatra.h.cmake
View file @
93221c7f
...
...
@@ -44,3 +44,6 @@
/* Defined if QGpgME supports specifying an import filter when importing keys */
#cmakedefine QGPGME_SUPPORTS_IMPORT_WITH_FILTER 1
/* Defined if QGpgME supports setting key origin when importing keys */
#cmakedefine QGPGME_SUPPORTS_IMPORT_WITH_KEY_ORIGIN 1
src/commands/importcertificatescommand.cpp
View file @
93221c7f
...
...
@@ -702,6 +702,9 @@ void ImportCertificatesCommand::Private::startImport(GpgME::Protocol protocol, c
#ifdef QGPGME_SUPPORTS_IMPORT_WITH_FILTER
job
->
setImportFilter
(
options
.
importFilter
);
#endif
#ifdef QGPGME_SUPPORTS_IMPORT_WITH_KEY_ORIGIN
job
->
setKeyOrigin
(
options
.
keyOrigin
,
options
.
keyOriginUrl
);
#endif
const
GpgME
::
Error
err
=
job
->
start
(
data
);
if
(
err
.
code
())
{
...
...
src/commands/importcertificatescommand_p.h
View file @
93221c7f
...
...
@@ -80,6 +80,8 @@ struct ImportedGroup
struct
ImportOptions
{
QString
importFilter
;
GpgME
::
Key
::
Origin
keyOrigin
=
GpgME
::
Key
::
OriginUnknown
;
QString
keyOriginUrl
;
};
class
Kleo
::
ImportCertificatesCommand
::
Private
:
public
Command
::
Private
...
...
src/commands/lookupcertificatescommand.cpp
View file @
93221c7f
...
...
@@ -464,7 +464,8 @@ void LookupCertificatesCommand::Private::slotImportRequested(const std::vector<K
if
(
!
wkdKeys
.
empty
())
{
// set an import filter, so that only user IDs matching the email address used for the WKD lookup are imported
const
QString
importFilter
=
QLatin1String
{
"keep-uid=mbox = "
}
+
searchTextToEmailAddress
(
keyListing
.
pattern
);
startImport
(
OpenPGP
,
keyListing
.
wkdKeyData
,
keyListing
.
wkdSource
,
{
importFilter
});
startImport
(
OpenPGP
,
keyListing
.
wkdKeyData
,
keyListing
.
wkdSource
,
{
importFilter
,
Key
::
OriginWKD
,
keyListing
.
wkdSource
});
}
if
(
!
pgp
.
empty
())
{
startImport
(
OpenPGP
,
pgp
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment