[gnome-keysign: 36/75] gpgmks: Export a key based on its fingerprint rather than UID
- From: Gitlab System User <gitlab src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-keysign: 36/75] gpgmks: Export a key based on its fingerprint rather than UID
- Date: Fri, 29 Sep 2017 11:25:22 +0000 (UTC)
commit d1ba1d34d32103be761761612dc943628cc9b6b9
Author: Tobias Mueller <muelli cryptobitch de>
Date: Sun Jul 23 13:11:55 2017 +0200
gpgmks: Export a key based on its fingerprint rather than UID
Because we cannot reliably identify a key with its UID in monkeysign.
keysign/gpgmks.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/keysign/gpgmks.py b/keysign/gpgmks.py
index 22c59be..e0fe0eb 100644
--- a/keysign/gpgmks.py
+++ b/keysign/gpgmks.py
@@ -59,7 +59,7 @@ def UIDExport(uid, keydata):
if key_uid != uid:
log.info('Deleting UID %s from key %s', key_uid, fpr)
tmp.del_uid(fingerprint=fpr, pattern=key_uid)
- only_uid = tmp.export_data(uid)
+ only_uid = tmp.export_data(fpr)
return only_uid
@@ -277,6 +277,7 @@ def sign_keydata(keydata, error_cb=None, homedir=None):
log.info('Signing with these keys: %s', secret_keys)
stripped_key = MinimalExport(keydata)
+ assert stripped_key
fingerprint = fingerprint_from_keydata(stripped_key)
log.debug('Trying to import key\n%s', stripped_key)
@@ -322,7 +323,10 @@ def sign_keydata(keydata, error_cb=None, homedir=None):
# 3.2. export and encrypt the signature
# 3.3. mail the key to the user
- signed_key = UIDExport(uid_str, tmpkeyring.export_data(uid_str))
+ exported_key = tmpkeyring.export_data(fingerprint)
+ assert exported_key
+ signed_key = UIDExport(uid_str, exported_key)
+ assert signed_key
log.info("Exported %d bytes of signed key", len(signed_key))
yield (uid, signed_key)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]