[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mutt-dev
Subject:    [PATCH 0 of 2] Ticket #3564: Allow empty user-id for pub record
From:       "Kevin J. McCarthy" <kevin () 8t8 ! us>
Date:       2013-04-11 1:22:04
Message-ID: patchbomb.1365643324 () zaogao ! lan
[Download RAW message or body]

[Apologies if this is a dup.  It appears the mailing list ate my
previous patchbomb set.]

This patch series fixes Ticket #3564.  Currently a key whose primary uid
has an empty User-ID can not be used for encryption in mutt.

The first patch changes parse_pub_line() to allow an empty User-ID field
for a pub record type.  This will allow the key to have an address
record generated, although it will have a null addr field.  The key
searching and key selection menus both iterate over address records, so
without at least one, the user is unable to search for or select such
a key.

The second patch wraps usages of addr in NONULL() where needed.  Most
of the mutt routines already have null checks in them.  A few debug
messages and a couple places in the pgp_select_key menu needed to be
wrapped for safety. (They did not actually generate a segfault for me, but
better to be safe across platforms).

As a side note, in pgp_getkeybystr, the comparison:
  if (!*p || mutt_strcasecmp (p, pgp_keyid (k)) == 0 ||
      (!mutt_strncasecmp (p, "0x", 2) && !mutt_strcasecmp (p + 2, pgp_keyid (k))) ||
      (option (OPTPGPLONGIDS) && !mutt_strncasecmp (p, "0x", 2) &&
      !mutt_strcasecmp (p + 2, k->keyid + 8)) ||
      mutt_stristr (a->addr, p))
takes place inside the address matching loop.  Only the last one is
actually matching against the address.  The others could be pulled in
front of the loop.  I was tempted, but decided to be conservative with
my changes for now :-).

Gpgme does not seem to be affected by this bug.

 gnupgparse.c |  15 +++++++++++----
 gnupgparse.c |   2 +-
 pgpkey.c     |   6 +++---
 3 files changed, 15 insertions(+), 8 deletions(-)
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic