summaryrefslogtreecommitdiff
path: root/keymanager
diff options
context:
space:
mode:
Diffstat (limited to 'keymanager')
-rw-r--r--keymanager/src/leap/keymanager/openpgp.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/keymanager/src/leap/keymanager/openpgp.py b/keymanager/src/leap/keymanager/openpgp.py
index 0c11d17..cb46371 100644
--- a/keymanager/src/leap/keymanager/openpgp.py
+++ b/keymanager/src/leap/keymanager/openpgp.py
@@ -297,6 +297,11 @@ class OpenPGPScheme(EncryptionScheme):
:rtype: OpenPGPKey
@raise KeyNotFound: If the key was not found on local storage.
"""
+ # Remove the identity suffix after the '+' until the '@'
+ # e.g.: test_user+something@provider.com becomes test_user@probider.com
+ # since the key belongs to the identity without the '+' suffix.
+ address = re.sub(r'\+.*\@', '@', address)
+
doc = self._get_key_doc(address, private)
if doc is None:
raise errors.KeyNotFound(address)