mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-02 12:01:32 +01:00
gpg: Fix mailbox based search via AKL keyserver method.
* g10/keyserver.c (keyserver_import_name): Rename to ... (keyserver_import_mbox): this. And use mail search mode. * g10/getkey.c (get_pubkey_byname): Change the two callers. -- In contrast to a search via keyserver_import_ntds the older keyserver_import_name used a full match of the provided name despite that it is only called with an addr-spec (mbox). Due to the mode the pattern send to dirmngr was prefixed with a '=' and thus dirmngr used an exact search;. This did only work for provided user ids like "foo@example.org" but not for "<foo@example.org>" or "Foo <foo@xample.org>". The old code dates back to 2010. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
99db4b0c7f
commit
4fcfac6feb
@ -1227,7 +1227,7 @@ get_pubkey_byname (ctrl_t ctrl, enum get_pubkey_modes mode,
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = keyserver_import_name (ctrl, name, &fpr, &fpr_len,
|
||||
rc = keyserver_import_mbox (ctrl, name, &fpr, &fpr_len,
|
||||
opt.keyserver);
|
||||
}
|
||||
glo_ctrl.in_auto_key_retrieve--;
|
||||
@ -1258,7 +1258,7 @@ get_pubkey_byname (ctrl_t ctrl, enum get_pubkey_modes mode,
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = keyserver_import_name (ctrl, name,
|
||||
rc = keyserver_import_mbox (ctrl, name,
|
||||
&fpr, &fpr_len, keyserver);
|
||||
}
|
||||
glo_ctrl.in_auto_key_retrieve--;
|
||||
|
@ -473,7 +473,7 @@ keyserver_import_wkd (ctrl_t ctrl, const char *name, unsigned int flags,
|
||||
}
|
||||
|
||||
int
|
||||
keyserver_import_name (const char *name,struct keyserver_spec *spec)
|
||||
keyserver_import_mbox (const char *name,struct keyserver_spec *spec)
|
||||
{
|
||||
(void)name;
|
||||
(void)spec;
|
||||
|
@ -56,8 +56,8 @@ gpg_error_t keyserver_import_wkd (ctrl_t ctrl, const char *name,
|
||||
unsigned char **fpr, size_t *fpr_len);
|
||||
int keyserver_import_ntds (ctrl_t ctrl, const char *name,
|
||||
unsigned char **fpr,size_t *fpr_len);
|
||||
int keyserver_import_name (ctrl_t ctrl,
|
||||
const char *name,unsigned char **fpr,size_t *fpr_len,
|
||||
int keyserver_import_mbox (ctrl_t ctrl, const char *mbox,
|
||||
unsigned char **fpr,size_t *fpr_len,
|
||||
struct keyserver_spec *keyserver);
|
||||
int keyserver_import_ldap (ctrl_t ctrl, const char *name,
|
||||
unsigned char **fpr,size_t *fpr_len);
|
||||
|
@ -1122,18 +1122,16 @@ keyserver_any_configured (ctrl_t ctrl)
|
||||
}
|
||||
|
||||
|
||||
/* Import all keys that exactly match NAME */
|
||||
/* Import all keys that exactly match MBOX */
|
||||
int
|
||||
keyserver_import_name (ctrl_t ctrl, const char *name,
|
||||
keyserver_import_mbox (ctrl_t ctrl, const char *mbox,
|
||||
unsigned char **fpr, size_t *fprlen,
|
||||
struct keyserver_spec *keyserver)
|
||||
{
|
||||
KEYDB_SEARCH_DESC desc;
|
||||
KEYDB_SEARCH_DESC desc = { 0 };
|
||||
|
||||
memset (&desc, 0, sizeof desc);
|
||||
|
||||
desc.mode = KEYDB_SEARCH_MODE_EXACT;
|
||||
desc.u.name = name;
|
||||
desc.mode = KEYDB_SEARCH_MODE_MAIL;
|
||||
desc.u.name = mbox;
|
||||
|
||||
return keyserver_get (ctrl, &desc, 1, keyserver, 0, fpr, fprlen);
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ keyserver_import_wkd (ctrl_t ctrl, const char *name, unsigned int flags,
|
||||
}
|
||||
|
||||
int
|
||||
keyserver_import_name (const char *name,struct keyserver_spec *spec)
|
||||
keyserver_import_mbox (const char *name,struct keyserver_spec *spec)
|
||||
{
|
||||
(void)name;
|
||||
(void)spec;
|
||||
|
Loading…
x
Reference in New Issue
Block a user