1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

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.
This commit is contained in:
Werner Koch 2011-04-25 23:56:47 +02:00
parent 4caa768f1d
commit 5da12674ea
20 changed files with 62 additions and 24 deletions

View file

@ -1,3 +1,8 @@
2011-04-25 Werner Koch <wk@g10code.com>
* userids.c (classify_user_id): Add arg OPENPGP_HACK to fix
regression from 2009-12-08.
2011-04-01 Werner Koch <wk@g10code.com>
* sysutils.c (get_uint_nonce): New.

View file

@ -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;

View file

@ -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*/