diff options
author | David Shaw <[email protected]> | 2006-04-11 03:00:50 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2006-04-11 03:00:50 +0000 |
commit | 3011a392843f4a34587309187793cda8eb388475 (patch) | |
tree | 13cab45ee9595ddab78fa22fa86386e0da1e675f /keyserver/ksutil.c | |
parent | * gpg.sgml: Some typo fixes. This is Debian 361324. (diff) | |
download | gnupg-3011a392843f4a34587309187793cda8eb388475.tar.gz gnupg-3011a392843f4a34587309187793cda8eb388475.zip |
* 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.
Diffstat (limited to 'keyserver/ksutil.c')
-rw-r--r-- | keyserver/ksutil.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/keyserver/ksutil.c b/keyserver/ksutil.c index 53fa294c2..9bd697fff 100644 --- a/keyserver/ksutil.c +++ b/keyserver/ksutil.c @@ -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; } } |