jaymzh / pius

PGP Individual User Signer
Other
97 stars 25 forks source link

Crash when trying to sign expired key #105

Closed jonglezb closed 5 years ago

jonglezb commented 6 years ago

With pius 2.2.3 on Debian stretch, I got a crash when trying to sign an expired key:

pub   rsa2048/0123456789ABCDEF 2011-11-02 [SCA] [expired: 2017-03-07]
      Key fingerprint = 0000 0000 0000 0000 0000  0000 0123 4567 89AB CDEF
uid                 [ expired] John Doe <jdoe@example.com>
uid                 [ expired] John Doe <john.doe@example.com>
uid                 [ expired] John Doe <john@example.com>

Have you verified this user/key, and if so, what level do you want to sign at?
  0-3, Show again, Next, Help, or Quit? [0|1|2|3|s|n|h|q] (default: n) 3

Signing all UIDs on key 0123456789ABCDEF
  There are 3 UIDs on this key to sign
  Skipping expired uid 1
  Skipping expired uid 2
  Skipping expired uid 3
  Signed UNencrypted keys: 
Traceback (most recent call last):
  File "/usr/bin/pius", line 342, in <module>
    main()
  File "/usr/bin/pius", line 326, in main
    if signer.sign_all_uids(key, retval):
  File "/usr/lib/python2.7/dist-packages/libpius/signer.py", line 821, in sign_all_uids
    self.print_filenames(uids)
  File "/usr/lib/python2.7/dist-packages/libpius/signer.py", line 717, in print_filenames
    if uid['status'] != 'r' and uid['result']:
KeyError: 'result'
jaymzh commented 6 years ago

Can you provide an actual keyid so I can repro?

jonglezb commented 6 years ago

Yes sure: rsa2048/0222311809815A26

jaymzh commented 5 years ago

I cannot reproduce this I'm pretty sure this has long-since been fixed, I'll do a releaase today:

Signing all UIDs on key 0222311809815A26
  There are 3 UIDs on this key to sign
  Skipping expired uid 1
  Skipping expired uid 2
  Skipping expired uid 3
jaymzh commented 5 years ago

Fixed in 2.2.7.