Bug#773970: [monkeysphere] monkeysign: GnuPG 2.1 compatibility
On 2015-08-08 06:51:24, Tobias Mueller wrote: > Hey hey! > > My patch broke monkeysign it seems :-/ > > I haven't counted properly and I've only realised now that > the number of fields is wrong in many places... I remember having > successfully > run the tests when I submitted the patch, but now I realise that > they fail. Weird. > > Anyway, the attached patch is better. Sorry for the noise. hmm... my bad for not running the tests before pushing!!! I should have noticed... Maybe we should improve the test run to explicitely test against gpg 2.1 and legacy? a. -- If you have come here to help me, you are wasting our time. But if you have come because your liberation is bound up with mine, then let us work together.- Aboriginal activists group, Queensland, 1970s -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#773970: [monkeysphere] monkeysign: GnuPG 2.1 compatibility
Hey hey! My patch broke monkeysign it seems :-/ I haven't counted properly and I've only realised now that the number of fields is wrong in many places... I remember having successfully run the tests when I submitted the patch, but now I realise that they fail. Weird. Anyway, the attached patch is better. Sorry for the noise. Cheers, Tobi >From c7924f3d389efea1bbd67d13485aabcef995fff0 Mon Sep 17 00:00:00 2001 From: Tobias Mueller Date: Sat, 8 Aug 2015 11:58:19 +0200 Subject: [PATCH] gpg: Fixed up the key parsing for secret keys I was counting wrongly. It's not 14 values we want to extract, but 13. Sorry for the noise. I don't know what went wrong the last time I attempted to patch, but this time the tests actually pass. --- monkeysign/gpg.py | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/monkeysign/gpg.py b/monkeysign/gpg.py index 9166755..56d21a1 100644 --- a/monkeysign/gpg.py +++ b/monkeysign/gpg.py @@ -683,35 +683,35 @@ class OpenPGPkey(): #print >>sys.stderr, "\n" rectype = record[0] if rectype == 'tru': -(rectype, trust, selflen, algo, keyid, creation, expiry, serial) = record[:9] +(rectype, trust, selflen, algo, keyid, creation, expiry, serial) = record[:8] elif rectype == 'fpr': if not self.fpr: self.fpr = record[9] elif rectype == 'pub': -(null, self.trust, self.length, self.algo, keyid, self.creation, self.expiry, serial, trust, uid, sigclass, purpose, smime) = record[:12] +(null, self.trust, self.length, self.algo, keyid, self.creation, self.expiry, serial, trust, uid, sigclass, purpose, smime) = record[:13] for p in self.purpose: self.purpose[p] = p[0].lower() in purpose.lower() if self.trust == '': self.trust = '-' elif rectype == 'uid': -(rectype, trust, null, null, null, creation, expiry, uidhash, null, uid) = record[:11] +(rectype, trust, null, null, null, creation, expiry, uidhash, null, uid) = record[:10] uid = OpenPGPuid(uid, trust, creation, expiry, uidhash) self.uids[uidhash] = uid uidslist.append(uid) elif rectype == 'sub': subkey = OpenPGPkey() -(rectype, trust, subkey.length, subkey.algo, subkey._keyid, subkey.creation, subkey.expiry, serial, trust, uid, sigclass, purpose, smime) = record[:14] +(rectype, trust, subkey.length, subkey.algo, subkey._keyid, subkey.creation, subkey.expiry, serial, trust, uid, sigclass, purpose, smime) = record[:13] for p in subkey.purpose: subkey.purpose[p] = p[0].lower() in purpose.lower() self.subkeys[subkey._keyid] = subkey elif rectype == 'sec': -(null, self.trust, self.length, self.algo, keyid, self.creation, self.expiry, serial, trust, uid, sigclass, purpose, smime) = record[:14] +(null, self.trust, self.length, self.algo, keyid, self.creation, self.expiry, serial, trust, uid, sigclass, purpose, smime) = record[:13] self.secret = True if self.trust == '': self.trust = '-' elif rectype == 'ssb': subkey = OpenPGPkey() -(rectype, trust, subkey.length, subkey.algo, subkey._keyid, subkey.creation, subkey.expiry, serial, trust, uid, sigclass, purpose, smime) = record[:14] +(rectype, trust, subkey.length, subkey.algo, subkey._keyid, subkey.creation, subkey.expiry, serial, trust, uid, sigclass, purpose, smime) = record[:13] if subkey._keyid in self.subkeys: # XXX: nothing else to add here? self.subkeys[subkey._keyid].secret = True -- 2.1.4
Bug#773970: [monkeysphere] monkeysign: GnuPG 2.1 compatibility
Control: tags -1 +pending On 2015-07-14 10:17:16, Tobias Mueller wrote: > Hi! > > I've finally found the time to rework the (simple) patch which enables > GnuPG 2.1 compatibility. > > Please find the patch attached and note that I haven't tested it. great, thanks, I have pushed this to the 2.x branch, as I do not think it is critical enough to warrant a stable update (ie. to jessie). a. -- Si l'image donne l'illusion de savoir C'est que l'adage pretend que pour croire, L'important ne serait que de voir - Lofofora -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#773970: [monkeysphere] monkeysign: GnuPG 2.1 compatibility
Hi! I've finally found the time to rework the (simple) patch which enables GnuPG 2.1 compatibility. Please find the patch attached and note that I haven't tested it. Cheers, Tobi From 979abe1f2949046ac5190ed86e2837dbbfda2633 Mon Sep 17 00:00:00 2001 From: Tobias Mueller Date: Tue, 14 Jul 2015 15:35:34 +0200 Subject: [PATCH] Added GnuPG 2.1 compatibility reg. its colon output The newer version of GnuPG seems to have added some more fields. Monkeysign complains like this: Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/keysign/MainWindow.py", line 59, in on_startup notebook.append_page(KeySignSection(self), Gtk.Label('Keys')) File "/usr/lib/python2.7/site-packages/keysign/Sections.py", line 197, in __init__ self.keysPage = KeysPage() File "/usr/lib/python2.7/site-packages/keysign/KeysPage.py", line 75, in __init__ for key in self.keyring.get_keys(None, True, False).values(): File "/usr/lib/python2.7/site-packages/monkeysign/gpg.py", line 385, in get_keys key = OpenPGPkey(keydata) File "/usr/lib/python2.7/site-packages/monkeysign/gpg.py", line 656, in __init__ self.parse_gpg_list(data) File "/usr/lib/python2.7/site-packages/monkeysign/gpg.py", line 698, in parse_gpg_list (null, self.trust, self.length, self.algo, keyid, self.creation, self.expiry, serial, trust, uid, sigclass, purpose, smime, wtf, wtf, wtf) = record ValueError: too many values to unpack This probably addresses https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=773970 --- monkeysign/gpg.py | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/monkeysign/gpg.py b/monkeysign/gpg.py index c7589a8..9166755 100644 --- a/monkeysign/gpg.py +++ b/monkeysign/gpg.py @@ -683,35 +683,35 @@ class OpenPGPkey(): #print >>sys.stderr, "\n" rectype = record[0] if rectype == 'tru': -(rectype, trust, selflen, algo, keyid, creation, expiry, serial) = record +(rectype, trust, selflen, algo, keyid, creation, expiry, serial) = record[:9] elif rectype == 'fpr': if not self.fpr: self.fpr = record[9] elif rectype == 'pub': -(null, self.trust, self.length, self.algo, keyid, self.creation, self.expiry, serial, trust, uid, sigclass, purpose, smime) = record +(null, self.trust, self.length, self.algo, keyid, self.creation, self.expiry, serial, trust, uid, sigclass, purpose, smime) = record[:12] for p in self.purpose: self.purpose[p] = p[0].lower() in purpose.lower() if self.trust == '': self.trust = '-' elif rectype == 'uid': -(rectype, trust, null , null, null, creation, expiry, uidhash, null, uid, null) = record +(rectype, trust, null, null, null, creation, expiry, uidhash, null, uid) = record[:11] uid = OpenPGPuid(uid, trust, creation, expiry, uidhash) self.uids[uidhash] = uid uidslist.append(uid) elif rectype == 'sub': subkey = OpenPGPkey() -(rectype, trust, subkey.length, subkey.algo, subkey._keyid, subkey.creation, subkey.expiry, serial, trust, uid, sigclass, purpose, smime) = record +(rectype, trust, subkey.length, subkey.algo, subkey._keyid, subkey.creation, subkey.expiry, serial, trust, uid, sigclass, purpose, smime) = record[:14] for p in subkey.purpose: subkey.purpose[p] = p[0].lower() in purpose.lower() self.subkeys[subkey._keyid] = subkey elif rectype == 'sec': -(null, self.trust, self.length, self.algo, keyid, self.creation, self.expiry, serial, trust, uid, sigclass, purpose, smime, wtf, wtf, wtf) = record +(null, self.trust, self.length, self.algo, keyid, self.creation, self.expiry, serial, trust, uid, sigclass, purpose, smime) = record[:14] self.secret = True if self.trust == '': self.trust = '-' elif rectype == 'ssb': subkey = OpenPGPkey() -(rectype, trust, subkey.length, subkey.algo, subkey._keyid, subkey.creation, subkey.expiry, serial, trust, uid, sigclass, purpose, smime, wtf, wtf, wtf) = record +(rectype, trust, subkey.length, subkey.algo, subkey._keyid, subkey.creation, subkey.expiry, serial, trust, uid, sigclass, purpose, smime) = record[:14] if subkey._keyid in self.subkeys: # XXX: nothing else to add here? self.subkeys[subkey._keyid].secret = True -- 2.1.4