Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gajim
gajim-plugins
Commits
f6411db9
Commit
f6411db9
authored
Apr 16, 2022
by
Philipp Hörist
Browse files
[openpgp] Handle keys not suited for xmpp
parent
52bf024e
Changes
1
Hide whitespace changes
Inline
Side-by-side
openpgp/backend/gpgme.py
View file @
f6411db9
...
...
@@ -32,6 +32,13 @@ class KeyringItem:
self
.
_key
=
key
self
.
_uid
=
self
.
_get_uid
()
@
property
def
is_xmpp_key
(
self
)
->
bool
:
try
:
return
self
.
jid
is
not
None
except
Exception
:
return
False
def
_get_uid
(
self
):
for
uid
in
self
.
_key
.
uids
:
if
uid
.
uid
.
startswith
(
'xmpp:'
):
...
...
@@ -55,7 +62,6 @@ class KeyringItem:
return
hash
(
self
.
fingerprint
)
class
GPGME
:
def
__init__
(
self
,
jid
,
gnuhome
):
self
.
_jid
=
jid
...
...
@@ -109,7 +115,13 @@ class GPGME:
keys
=
[]
with
gpg
.
Context
(
**
self
.
_context_args
)
as
context
:
for
key
in
context
.
keylist
():
keys
.
append
(
KeyringItem
(
key
))
keyring_item
=
KeyringItem
(
key
)
if
not
keyring_item
.
is_xmpp_key
:
log
.
warning
(
'Key not suited for xmpp: %s'
,
key
.
fpr
)
continue
keys
.
append
(
keyring_item
)
return
keys
def
export_key
(
self
,
fingerprint
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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