Yubico / ykneo-openpgp

OpenPGP applet for the YubiKey NEO
https://developers.yubico.com/ykneo-openpgp/
GNU General Public License v2.0
215 stars 67 forks source link

If gpg key has multiple emails key generation is incorrect #8

Closed TonyHoyle closed 11 years ago

TonyHoyle commented 11 years ago

The key parser doesn't work with gpg keys with multiple emails, as the regexp matches the last uid not the first one.

The fix is a simple regexp change:

-    result = re.search(r'(Key fingerprint = )(.+)(\nuid)', fingerprintData, re.DOTALL)
+    result = re.search(r'(Key fingerprint = )(.+?)(\nuid)', fingerprintData, re.DOTALL)