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

Benoit Boissinot bboissin at gmail.com
Fri Jun 21 03:52:37 CDT 2013


On Thu, Jun 20, 2013 at 9:34 AM, <elson.wei at gmail.com> wrote:

> # 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] + ["", ""])
>

Can't you move that to the other block?

(and please fold both patch together they are not independent)

Cheers,

Benoit

>              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
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20130621/f460aad6/attachment.html>


More information about the Mercurial-devel mailing list