From 393ba4f8a71b1ebba4e5aebdbb7b004f6a9bff66 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Fri, 22 Feb 2002 03:11:15 +0000 Subject: Detect a "no keys found" case even if the keyserver helper program does not explicitly say how many keys were found. Bug fix - don't report non-revoked keys as revoked in HKP key searches. --- g10/ChangeLog | 9 +++++++++ g10/hkp.c | 1 + g10/keyserver.c | 32 ++++++++++++++++++++++---------- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 281751960..bd98bbeba 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,12 @@ +2002-03-12 David Shaw + + * keyserver.c (keyserver_search_prompt): Detect a "no keys found" + case even if the helper program does not explicitly say how many + keys were found. + + * hkp.c (parse_hkp_index): Bug fix - don't report non-revoked keys + as revoked in HKP key searches. + 2002-02-19 David Shaw * hkp.c (parse_hkp_index): Catch corruption in HKP index lines diff --git a/g10/hkp.c b/g10/hkp.c index e1dd5d26d..5c44d2681 100644 --- a/g10/hkp.c +++ b/g10/hkp.c @@ -281,6 +281,7 @@ parse_hkp_index(IOBUF buffer,char *line) if(strncmp(line," ",5)!=0) { + revoked=0; m_free(key); m_free(uid); uid=NULL; diff --git a/g10/keyserver.c b/g10/keyserver.c index 47347e573..423c0eb45 100644 --- a/g10/keyserver.c +++ b/g10/keyserver.c @@ -811,8 +811,9 @@ keyserver_search(STRLIST tokens) return 0; } -/* Count is just for cosmetics. If it is too small, it will grow - safely. If negative it disables the "Key x-y of z" messages. */ +/* Count and searchstr are just for cosmetics. If the count is too + small, it will grow safely. If negative it disables the "Key x-y + of z" messages. */ void keyserver_search_prompt(IOBUF buffer,int count,const char *searchstr) { @@ -823,13 +824,7 @@ keyserver_search_prompt(IOBUF buffer,int count,const char *searchstr) char *answer; if(count==0) - { - if(searchstr) - log_info(_("key \"%s\" not found on keyserver\n"),searchstr); - else - log_info(_("key not found on keyserver\n")); - return; - } + goto notfound; if(count<0) { @@ -857,7 +852,8 @@ keyserver_search_prompt(IOBUF buffer,int count,const char *searchstr) if(validcount && (i-1)%10==0) { printf("Keys %d-%d of %d",i,(i+9