[gnome-keysign: 35/75] gpgmks: Make UIDExport get the key by fingerprint rather than UID



commit dae4352d1897eb8267a7583a96e5cef56a37b9be
Author: Tobias Mueller <muelli cryptobitch de>
Date:   Sun Jul 23 12:42:05 2017 +0200

    gpgmks: Make UIDExport get the key by fingerprint rather than UID
    
    If the UID contains invalid utf-8 bytes we cannot reliably find the keys
    back. The monkeysign interface seems to be a bit broken there.
    
    ======================================================================
    ERROR: test_gpgmks.TestLatin1.test_sign_and_encrypt
    ----------------------------------------------------------------------
    Traceback (most recent call last):
    File "/tmp/gks/lib/python2.7/site-packages/nose/case.py", line 197, in
    runTest
        self.test(*self.arg)
    File "/tmp/gnome-keysign/tests/test_gpgmks.py", line 258, in
    test_sign_and_encrypt
        error_cb=None, homedir=self.receiver_homedir))
    File "/tmp/gnome-keysign/keysign/gpgmks.py", line 413, in
    sign_keydata_and_encrypt
        error_cb=error_cb, homedir=homedir):
    File "/tmp/gnome-keysign/keysign/gpgmks.py", line 324, in sign_keydata
        signed_key = UIDExport(uid_str, tmpkeyring.export_data(uid_str))
    File "/tmp/gnome-keysign/keysign/gpgmks.py", line 55, in UIDExport
        for fpr, key in tmp.get_keys(uid).items():
    AttributeError: 'NoneType' object has no attribute 'items'
    -------------------- >> begin captured logging << --------------------
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--status-fd' '2' '--quiet' '--batch' '--fixed-list-mode' '--no-tty'
    '--with-colons' '--use-agent' '--homedir' '/tmp/tmp4xTJK2' '--list-
    secret-keys'
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--status-fd' '2' '--quiet' '--batch' '--fixed-list-mode' '--no-tty'
    '--with-colons' '--use-agent' '--homedir' '/tmp/tmp4xTJK2' '--list-keys'
    '8D74E09668E09ACC958C9F40B6073C38922AC960'
    keysign.gpgmks: DEBUG: Key pub  [unknown] 1024R/922AC960 1494264830
        Fingerprint = 8D74 E096 68E0 9ACC 958C  9F40 B607 3C38 922A C960
    uid 1      [unknown] fo�e�ba <foo@bma.d>
    sub   1024R/DF6E78D0 1494264830
    is invalid: False (i:False, d:False, e:False, r:False)
    keysign.gpgkey: DEBUG: From mks:
    <OpenPGPkey(8D74E09668E09ACC958C9F40B6073C38922AC960 UIDs:1)>
    keysign.gpgkey: DEBUG: UidStr (19): 'fo?e?ba <foo@bma.d>'
    keysign.gpgkey: DEBUG: Parsing tokens: ['fo?e?ba ', 'foo@bma.d>']
    keysign.gpgkey: DEBUG: Parsed 'fo?e?ba <foo@bma.d>' to name (7):
    u'fo?e?ba'
    keysign.gpgmks: DEBUG: Identified usable keys: [Key(expiry=None,
    fingerprint='8D74E09668E09ACC958C9F40B6073C38922AC960',
    uidslist=[UID(expiry=None, uid=u'fo?e?ba <foo@bma.d>', name=u'fo?e?ba',
    comment=u'', email=u'foo@bma.d')])]
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--status-fd' '2' '--quiet' '--batch' '--fixed-list-mode' '--no-tty'
    '--with-colons' '--use-agent' '--homedir' '/tmp/pygpg-sBY1Qa' '--import'
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--status-fd' '2' '--quiet' '--batch' '--fixed-list-mode' '--no-tty'
    '--with-colons' '--use-agent' '--homedir' '/tmp/pygpg-WNfFpH' '--import'
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--status-fd' '2' '--quiet' '--batch' '--fixed-list-mode' '--no-tty'
    '--with-colons' '--use-agent' '--homedir' '/tmp/pygpg-WNfFpH' '--list-
    keys'
    keysign.gpgkey: DEBUG: From mks:
    <OpenPGPkey(8D74E09668E09ACC958C9F40B6073C38922AC960 UIDs:1)>
    keysign.gpgkey: DEBUG: UidStr (19): 'fo?e?ba <foo@bma.d>'
    keysign.gpgkey: DEBUG: Parsing tokens: ['fo?e?ba ', 'foo@bma.d>']
    keysign.gpgkey: DEBUG: Parsed 'fo?e?ba <foo@bma.d>' to name (7):
    u'fo?e?ba'
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--status-fd' '2' '--quiet' '--batch' '--fixed-list-mode' '--no-tty'
    '--with-colons' '--use-agent' '--homedir' '/tmp/tmp0YOXFq' '--list-
    secret-keys'
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--status-fd' '2' '--quiet' '--batch' '--fixed-list-mode' '--no-tty'
    '--with-colons' '--use-agent' '--homedir' '/tmp/tmp0YOXFq' '--list-keys'
    'CFD49FE68C0924D830BE4BFDA5C89B8B383EE754'
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--armor' '--status-fd' '2' '--quiet' '--batch' '--fixed-list-mode'
    '--no-tty' '--with-colons' '--use-agent' '--homedir' '/tmp/tmp0YOXFq' '
    --export' 'CFD49FE68C0924D830BE4BFDA5C89B8B383EE754'
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--no-default-keyring' '--trustdb-name' '/tmp/gpgpy-tdb-BeJB03'
    '--status-fd' '2' '--quiet' '--batch' '--primary-keyring' '/tmp/gpgpy-
    G1SzUs' '--fixed-list-mode' '--no-tty' '--with-colons' '--use-agent' '--
    homedir' '/tmp/tmp0YOXFq' '--import'
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--status-fd' '2' '--quiet' '--batch' '--fixed-list-mode' '--no-tty'
    '--with-colons' '--use-agent' '--homedir' '/tmp/tmp0YOXFq' '--list-
    secret-keys'
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--status-fd' '2' '--quiet' '--batch' '--fixed-list-mode' '--no-tty'
    '--with-colons' '--use-agent' '--homedir' '/tmp/tmp0YOXFq' '--list-keys'
    'CFD49FE68C0924D830BE4BFDA5C89B8B383EE754'
    keysign.gpgmks: DEBUG: Key pub  [unknown] 2048R/383EE754 1479476974
        Fingerprint = CFD4 9FE6 8C09 24D8 30BE  4BFD A5C8 9B8B 383E E754
    uid 1      [unknown] Test Key <test@key>
    sub   2048R/1D0FCF22 1479476974
    is invalid: False (i:False, d:False, e:False, r:False)
    keysign.gpgkey: DEBUG: From mks:
    <OpenPGPkey(CFD49FE68C0924D830BE4BFDA5C89B8B383EE754 UIDs:1)>
    keysign.gpgkey: DEBUG: UidStr (19): 'Test Key <test@key>'
    keysign.gpgkey: DEBUG: Parsing tokens: ['Test Key ', 'test@key>']
    keysign.gpgkey: DEBUG: Parsed 'Test Key <test@key>' to name (8): u'Test
    Key'
    keysign.gpgmks: DEBUG: Identified usable keys: [Key(expiry=None,
    fingerprint='CFD49FE68C0924D830BE4BFDA5C89B8B383EE754',
    uidslist=[UID(expiry=None, uid=u'Test Key <test@key>', name=u'Test Key',
    comment=u'', email=u'test@key')])]
    keysign.gpgmks:sign_keydata_encrypt: INFO: Signing with these keys:
    [Key(expiry=None,
    fingerprint='CFD49FE68C0924D830BE4BFDA5C89B8B383EE754',
    uidslist=[UID(expiry=None, uid=u'Test Key <test@key>', name=u'Test Key',
    comment=u'', email=u'test@key')])]
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--status-fd' '2' '--quiet' '--batch' '--fixed-list-mode' '--no-tty'
    '--with-colons' '--use-agent' '--homedir' '/tmp/pygpg-i0T7h1' '--import'
    keysign.gpgmks: DEBUG: Returned True after importing '-----BEGIN PGP
    PRIVATE KEY BLOCK-----\nVersion: GnuPG
    
v1\n\nlQHYBFkQq/4BBACgTJrZpB0KioOfLrFmRg3DFtrbtN4Ww/mDBgotuWp2xTLTWpiY\nzuIaEFWj941ZM4Z1PrlTSadEd+xw6RXjW01uPQErNpViZF9jz3NmAsWrqu+2uemu\nvzq5BXW4qu4MhsxN1qn+CJx7odfQQZKOwEOwOXN2O/RokYKD5FizH71LdQARAQAB\nAAP9EkK/xijPpR6D4XueemXjFfUR0AMB5MqE70PeH3jWk7qhsFmK9idlMu5m7yOZ\nfs6jk9ImJwKGM0LNFMy8sVZ6krTnBG9VL2eIN+1CkEgB66ywiTEG5uT/Rkhkb00C\nscqedBS5CzVxbG8lZkn54Pj5vkPF6+eJ73frTS1NY79JDFkCAMaAk5RID526/ed8\nbL3wqaDTk64aht79CdVWWiz2+fdxS6Pj9T/y5/ijkhjuRQcakG/TDLRACBahF6/M\nH+Zvyj0CAM67Lqbmvtd90JMA0nNDJBXqYuRN00/XHRKo98uswYFHl/h+WoOqoqtC\nM3btr/SCVGnbZuZTFmkBmbi51gpS8ZkCAJHXIivzI02+sAu3hwOBmQTHUOQZjB8b\nIknYpkPXnWUY4MF1GRuTOCftBfIeIoFJJYEkaEQE4Wv8JOiGbXi+SZCkHLQTZm/2\nZeliYSA8Zm9vQGJtYS5kPoi4BBMBAgAiBQJZEKv+AhsvBgsJCAcDAgYVCAIJCgsE\nFgIDAQIeAQIXgAAKCRC2Bzw4kirJYDPhBACbjasupevAxy8eLJ1nsQBfvkv6e4pl\nK6VUjq3tjl2E0SZ9woZBsYdH2hnW8s7z5fS3Dk1Pw+tSm+mPt9vy24T49Mv8NZtC\nAPiIE27eHugbla5TKzFSigN/hkjivXG7bxSAIfit7DN6KPQWVE9pfgpIwosc9U20\nMfPRq8+5VGL5QJ0B2ARZEKv+AQQAnfzUGtWRz6JaBiLof/3eNXspSep2
 8UPq4Yrb
 
\nENCRdz54swX1BapJCEZZFdFzu3dBWvFeGJLCGziZd09yFLbXHFM8K4wx2yIQDXKC\n0OjowLoQT8YEZQvqKEmX8RyqhV5qyhwDf3ghyqbm71qXj1LaAM9RIts2UAOS8bUW\n3uviwNsAEQEAAQAD/0zFurCbjfKvOz32IrNnw16LzgGcTVZqoa4eUtv17mpa0j50\nq5+oIztBLDM9CBdWGU0/M3GPh4HA3FqtIYvNWfQnN6QtyzaM0fyHcpbrha7j9jK/\n3JqoEzP9oaPVwOWAjXPs81PsiqyHzFL0ZA8wvKw9xhDH9Lo/YhNWaGV+tG4ZAgDD\nPGbxIIa10ZGaH9mvd7urFbVB/WwzUUecnU9pw5/F+yP8dE5Yjn7Av3MJIEa8Qtwn\ngKeoRvxaKhD9JrbRtBY3AgDPKKHYE4WBVzUKDA0ctQ/RGS0SbNzyf4YdtHfrgLG0\nKTp4Jh1PRUhsMkBF/rfsFIr9PpApvBzAFWB2Hx4yt1h9Af4pbG8nlGP/H2V8rY1U\n8MYMGI7l1FMrWd6Xz0gmhbCuNzFBKqCPLNIWqE7LMU3BbC7cfbozXujQKX/2eawe\nj3E0nbOJAT0EGAECAAkFAlkQq/4CGy4AqAkQtgc8OJIqyWCdIAQZAQIABgUCWRCr\n/gAKCRCW6kaJ32540A7AA/9VzXQmMzf26FWTaLHSf1uqBwIY29/PRGrfJvj5yu63\nSw0+agLEkorkD9IKsxVcnWpCI17Xw3hNzSus5euqcdujcy5An0+eEEjxXw13GMn0\nzyVJbmBUngTdkHZuY3jTTj92GSv8jo+GZW+uWp7ZDPqpTZoWeH5d1qPq9Hd3LleT\np801BACH/NIHLPFAUELnrwTeIZhG8Pa5teqWtYulZtJsWxIyRszLmjvciaTraImE\nv00K8SAqtMX8+sA7IGBw9TUSmNFCNvhSQZdYGcyfJsN5/X0o5a/R/OTzfrVK/YU
 9\n0fEDu
 4pTpOe6pmiTUr0dgtKX02MpwfNcKsp2scC5F93LwYQkWQ==\n=upUO\n
    -----END PGP PRIVATE KEY BLOCK-----\n'
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--status-fd' '2' '--export-options' 'export-minimal' '--quiet' '--
    batch' '--fixed-list-mode' '--no-tty' '--with-colons' '--use-agent' '--
    homedir' '/tmp/pygpg-i0T7h1' '--list-keys'
    keysign.gpgmks: DEBUG: Keys after importing:
    [('8D74E09668E09ACC958C9F40B6073C38922AC960',
    <OpenPGPkey(8D74E09668E09ACC958C9F40B6073C38922AC960 UIDs:1)>)]
    ([('8D74E09668E09ACC958C9F40B6073C38922AC960',
    <OpenPGPkey(8D74E09668E09ACC958C9F40B6073C38922AC960 UIDs:1)>)])
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--armor' '--status-fd' '2' '--export-options' 'export-minimal' '--
    quiet' '--batch' '--fixed-list-mode' '--no-tty' '--with-colons' '--use-
    agent' '--homedir' '/tmp/pygpg-i0T7h1' '--export'
    '8D74E09668E09ACC958C9F40B6073C38922AC960'
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--status-fd' '2' '--quiet' '--batch' '--fixed-list-mode' '--no-tty'
    '--with-colons' '--use-agent' '--homedir' '/tmp/pygpg-ZHhHeZ' '--import'
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--status-fd' '2' '--quiet' '--batch' '--fixed-list-mode' '--no-tty'
    '--with-colons' '--use-agent' '--homedir' '/tmp/pygpg-ZHhHeZ' '--list-
    keys'
    keysign.gpgkey: DEBUG: From mks:
    <OpenPGPkey(8D74E09668E09ACC958C9F40B6073C38922AC960 UIDs:1)>
    keysign.gpgkey: DEBUG: UidStr (19): 'fo?e?ba <foo@bma.d>'
    keysign.gpgkey: DEBUG: Parsing tokens: ['fo?e?ba ', 'foo@bma.d>']
    keysign.gpgkey: DEBUG: Parsed 'fo?e?ba <foo@bma.d>' to name (7):
    u'fo?e?ba'
    keysign.gpgmks:sign_keydata_encrypt: DEBUG: Trying to import key
    -----BEGIN PGP PUBLIC KEY BLOCK-----
    
    mI0EWRCr/gEEAKBMmtmkHQqKg58usWZGDcMW2tu03hbD+YMGCi25anbFMtNamJjO
    4hoQVaP3jVkzhnU+uVNJp0R37HDpFeNbTW49ASs2lWJkX2PPc2YCxauq77a56a6/
    OrkFdbiq7gyGzE3Wqf4InHuh19BBko7AQ7A5c3Y79GiRgoPkWLMfvUt1ABEBAAG0
    E2Zv9mXpYmEgPGZvb0BibWEuZD6IuAQTAQIAIgUCWRCr/gIbLwYLCQgHAwIGFQgC
    CQoLBBYCAwECHgECF4AACgkQtgc8OJIqyWAz4QQAm42rLqXrwMcvHiydZ7EAX75L
    +nuKZSulVI6t7Y5dhNEmfcKGQbGHR9oZ1vLO8+X0tw5NT8PrUpvpj7fb8tuE+PTL
    /DWbQgD4iBNu3h7oG5WuUysxUooDf4ZI4r1xu28UgCH4rewzeij0FlRPaX4KSMKL
    HPVNtDHz0avPuVRi+UC4jQRZEKv+AQQAnfzUGtWRz6JaBiLof/3eNXspSep28UPq
    4YrbENCRdz54swX1BapJCEZZFdFzu3dBWvFeGJLCGziZd09yFLbXHFM8K4wx2yIQ
    DXKC0OjowLoQT8YEZQvqKEmX8RyqhV5qyhwDf3ghyqbm71qXj1LaAM9RIts2UAOS
    8bUW3uviwNsAEQEAAYkBPQQYAQIACQUCWRCr/gIbLgCoCRC2Bzw4kirJYJ0gBBkB
    AgAGBQJZEKv+AAoJEJbqRonfbnjQDsAD/1XNdCYzN/boVZNosdJ/W6oHAhjb389E
    at8m+PnK7rdLDT5qAsSSiuQP0gqzFVydakIjXtfDeE3NK6zl66px26NzLkCfT54Q
    SPFfDXcYyfTPJUluYFSeBN2Qdm5jeNNOP3YZK/yOj4Zlb65antkM+qlNmhZ4fl3W
    o+r0d3cuV5OnzTUEAIf80gcs8UBQQuevBN4hmEbw9rm16pa1i6Vm0mxbEjJGzMua
    O9yJpOtoiYS/TQrxICq0xfz6wDsgYHD1NRKY0UI2+FJBl1gZzJ8mw3n9fSjlr9H8
    5PN+tUr9hT3R8QO7ilOk57qmaJNSvR2C0pfTYynB81wqynaxwLkX3cvBhCRZ
    =LwSz
    -----END PGP PUBLIC KEY BLOCK-----
    
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--no-default-keyring' '--trustdb-name' '/tmp/gpgpy-tdb-BeJB03'
    '--status-fd' '2' '--quiet' '--batch' '--primary-keyring' '/tmp/gpgpy-
    G1SzUs' '--fixed-list-mode' '--no-tty' '--with-colons' '--use-agent' '--
    homedir' '/tmp/tmp0YOXFq' '--import'
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--no-default-keyring' '--trustdb-name' '/tmp/gpgpy-tdb-BeJB03'
    '--status-fd' '2' '--quiet' '--batch' '--primary-keyring' '/tmp/gpgpy-
    G1SzUs' '--fixed-list-mode' '--no-tty' '--with-colons' '--use-agent' '--
    homedir' '/tmp/tmp0YOXFq' '--list-keys'
    '8D74E09668E09ACC958C9F40B6073C38922AC960'
    keysign.gpgmks:sign_keydata_encrypt: INFO: Found keys
    {'8D74E09668E09ACC958C9F40B6073C38922AC960':
    <OpenPGPkey(8D74E09668E09ACC958C9F40B6073C38922AC960 UIDs:1)>} for fp
    8D74E09668E09ACC958C9F40B6073C38922AC960
    keysign.gpgmks:sign_keydata_encrypt: INFO: Setting up to sign with
    CFD49FE68C0924D830BE4BFDA5C89B8B383EE754
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--no-default-keyring' '--trustdb-name' '/tmp/gpgpy-tdb-BeJB03'
    '--status-fd' '2' '--quiet' '--batch' '--primary-keyring' '/tmp/gpgpy-
    G1SzUs' '--fixed-list-mode' '--no-tty' '--with-colons' '--use-agent'
    '--local-user' 'CFD49FE68C0924D830BE4BFDA5C89B8B383EE754' '--always-
    trust' '--homedir' '/tmp/tmp0YOXFq' '--sign-key'
    '8D74E09668E09ACC958C9F40B6073C38922AC960'
    keysign.gpgmks:sign_keydata_encrypt: INFO: Result of signing fo�e�ba
    <foo@bma.d> on key 8D74E09668E09ACC958C9F40B6073C38922AC960: True
    keysign.gpgmks:sign_keydata_encrypt: INFO: Processing uid
    <OpenPGPuid(fo�e�ba <foo@bma.d>) [-:1494264830:]> fo�e�ba <foo@bma.d>
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--no-default-keyring' '--trustdb-name' '/tmp/gpgpy-tdb-BeJB03'
    '--status-fd' '2' '--armor' '--quiet' '--batch' '--primary-keyring'
    '/tmp/gpgpy-G1SzUs' '--fixed-list-mode' '--no-tty' '--with-colons'
    '--use-agent' '--local-user' 'CFD49FE68C0924D830BE4BFDA5C89B8B383EE754'
    '--always-trust' '--homedir' '/tmp/tmp0YOXFq' '--export' 'fo�e�ba
    <foo@bma.d>'
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--always-trust' '--status-fd' '2' '--quiet' '--batch' '--fixed-list-
    mode' '--no-tty' '--with-colons' '--use-agent' '--homedir' '/tmp/pygpg-
    2KwrHG' '--import'
    keysign.gpgmks.UIDExport: DEBUG: Looking for 'fo\xf6e\xe9ba <foo@bma.d>'
    keysign.gpgmks: DEBUG: Building cmd: 'gpg' '--command-fd' '0' '--with-
    fingerprint' '--list-options' 'show-sig-subpackets,show-uid-validity
    ,show-unusable-uids,show-unusable-subkeys,show-keyring,show-sig-expire'
    '--always-trust' '--status-fd' '2' '--quiet' '--batch' '--fixed-list-
    mode' '--no-tty' '--with-colons' '--use-agent' '--homedir' '/tmp/pygpg-
    2KwrHG' '--list-keys' 'fo�e�ba <foo@bma.d>'
    --------------------- >> end captured logging << ---------------------

 keysign/gpgmks.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/keysign/gpgmks.py b/keysign/gpgmks.py
index 55dd384..22c59be 100644
--- a/keysign/gpgmks.py
+++ b/keysign/gpgmks.py
@@ -51,8 +51,9 @@ def UIDExport(uid, keydata):
     # a stray "gpg: checking the trustdb" which confuses the gnupg library
     tmp.context.set_option('always-trust')
     tmp.import_data(keydata)
-    log.debug("Looking for %r", uid)
-    for fpr, key in tmp.get_keys(uid).items():
+    fpr = fingerprint_from_keydata(keydata)
+    log.debug("Looking for %r", fpr)
+    for fpr, key in tmp.get_keys(fpr).items():
         for u in key.uidslist:
             key_uid = u.uid
             if key_uid != uid:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]