mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
* ksutil.h, ksutil.c (classify_ks_search): Add KS_SEARCH_KEYID_SHORT
and KS_SEARCH_KEYID_LONG to search for a key ID. * gpgkeys_ldap.c (search_key): Use it here to flip from pgpUserID searches to pgpKeyID or pgpCertID.
This commit is contained in:
parent
1bf02666fb
commit
3011a39284
4 changed files with 108 additions and 15 deletions
|
@ -346,8 +346,6 @@ classify_ks_search(const char **search)
|
|||
{
|
||||
switch(**search)
|
||||
{
|
||||
default:
|
||||
return KS_SEARCH_SUBSTR;
|
||||
case '*':
|
||||
(*search)++;
|
||||
return KS_SEARCH_SUBSTR;
|
||||
|
@ -355,10 +353,30 @@ classify_ks_search(const char **search)
|
|||
(*search)++;
|
||||
return KS_SEARCH_EXACT;
|
||||
case '<':
|
||||
(*search)++;
|
||||
return KS_SEARCH_MAIL;
|
||||
case '@':
|
||||
(*search)++;
|
||||
return KS_SEARCH_MAILSUB;
|
||||
case '0':
|
||||
if((*search)[1]=='x')
|
||||
{
|
||||
if(strlen(*search)==10
|
||||
&& strspn(*search,"abcdefABCDEF1234567890x")==10)
|
||||
{
|
||||
(*search)+=2;
|
||||
return KS_SEARCH_KEYID_SHORT;
|
||||
}
|
||||
else if(strlen(*search)==18
|
||||
&& strspn(*search,"abcdefABCDEF1234567890x")==18)
|
||||
{
|
||||
(*search)+=2;
|
||||
return KS_SEARCH_KEYID_LONG;
|
||||
}
|
||||
}
|
||||
/* fall through */
|
||||
default:
|
||||
return KS_SEARCH_SUBSTR;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue