[PATCH 1 of 2] gpg: treat "ERRSIG" as a valid keyid but no fingerprint

elson.wei at gmail.com elson.wei at gmail.com
Thu Jun 20 09:32:48 CDT 2013


# HG changeset patch
# User Wei, Elson <elson.wei at gmail.com>
# Date 1371690961 -28800
#      Thu Jun 20 09:16:01 2013 +0800
# Node ID 5d7e94383feede6e5b62d4009a3877e479f72591
# Parent  401b3ad26e66f6b69937e1aa808da07065c408a6
gpg: treat "ERRSIG" as a valid keyid but no fingerprint

diff --git a/hgext/gpg.py b/hgext/gpg.py
--- a/hgext/gpg.py
+++ b/hgext/gpg.py
@@ -48,7 +48,6 @@
                     pass
         keys = []
         key, fingerprint = None, None
-        err = ""
         for l in ret.splitlines():
             # see DETAILS in the gnupg documentation
             # filter the logger output
@@ -56,8 +55,7 @@
                 continue
             l = l[9:]
             if l.startswith("ERRSIG"):
-                err = _("error while verifying signature")
-                break
+                keys.append(l.split(" ", 2)[:2] + ["", ""])
             elif l.startswith("VALIDSIG"):
                 # fingerprint of the primary key
                 fingerprint = l.split()[10]
@@ -69,11 +67,9 @@
                     keys.append(key + [fingerprint])
                 key = l.split(" ", 2)
                 fingerprint = None
-        if err:
-            return err, []
         if key is not None:
             keys.append(key + [fingerprint])
-        return err, keys
+        return keys
 
 def newgpg(ui, **opts):
     """create a new gpg instance"""
@@ -119,10 +115,7 @@
 
     data = node2txt(repo, node, version)
     sig = binascii.a2b_base64(sig)
-    err, keys = mygpg.verify(data, sig)
-    if err:
-        ui.warn("%s:%d %s\n" % (fn, ln , err))
-        return None
+    keys = mygpg.verify(data, sig)
 
     validkeys = []
     # warn for expired key and/or sigs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: my_hg_19316.patch
Type: text/x-patch
Size: 1703 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20130620/daabe64d/attachment.bin>


More information about the Mercurial-devel mailing list