diff options
author | Werner Koch <[email protected]> | 2011-04-25 21:56:47 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2011-04-25 21:59:25 +0000 |
commit | 5da12674eaae11969b22e6f80e4957217ad406d6 (patch) | |
tree | 1ae8b482a2c2cdef4cb24055d6d15c99224b5b1d /common | |
parent | Add OPTION:cache-ttl-opt-preset to gpg-agent. (diff) | |
download | gnupg-5da12674eaae11969b22e6f80e4957217ad406d6.tar.gz gnupg-5da12674eaae11969b22e6f80e4957217ad406d6.zip |
Fix regression in gpg's mail address parsing.
Since 2009-12-08 gpg was not able to find email addresses indicated
by a leading '<'. This happened when I merged the user id
classification code of gpgsm and gpg.
Diffstat (limited to 'common')
-rw-r--r-- | common/ChangeLog | 5 | ||||
-rw-r--r-- | common/userids.c | 9 | ||||
-rw-r--r-- | common/userids.h | 3 |
3 files changed, 14 insertions, 3 deletions
diff --git a/common/ChangeLog b/common/ChangeLog index ba7794e08..a68246e4c 100644 --- a/common/ChangeLog +++ b/common/ChangeLog @@ -1,3 +1,8 @@ +2011-04-25 Werner Koch <[email protected]> + + * userids.c (classify_user_id): Add arg OPENPGP_HACK to fix + regression from 2009-12-08. + 2011-04-01 Werner Koch <[email protected]> * sysutils.c (get_uint_nonce): New. diff --git a/common/userids.c b/common/userids.c index 9cc29f3b4..8c89c3284 100644 --- a/common/userids.c +++ b/common/userids.c @@ -61,7 +61,7 @@ */ gpg_error_t -classify_user_id (const char *name, KEYDB_SEARCH_DESC *desc) +classify_user_id (const char *name, KEYDB_SEARCH_DESC *desc, int openpgp_hack) { const char *s; int hexprefix = 0; @@ -95,7 +95,12 @@ classify_user_id (const char *name, KEYDB_SEARCH_DESC *desc) case '<': /* An email address. */ mode = KEYDB_SEARCH_MODE_MAIL; - s++; + /* FIXME: The keyring code in g10 assumes that the mail name is + prefixed with an '<'. However the keybox code used for sm/ + assumes it has been removed. For now we use this simple hack + to overcome the problem. */ + if (!openpgp_hack) + s++; desc->u.name = s; break; diff --git a/common/userids.h b/common/userids.h index 246b10768..9b3a2c313 100644 --- a/common/userids.h +++ b/common/userids.h @@ -22,7 +22,8 @@ #include "../kbx/keybox-search-desc.h" -gpg_error_t classify_user_id (const char *name, KEYDB_SEARCH_DESC *desc); +gpg_error_t classify_user_id (const char *name, KEYDB_SEARCH_DESC *desc, + int openpgp_hack); #endif /*GNUPG_COMMON_USERIDS_H*/ |