From 46ce06d9d9d08351c7e1302005e607f4cc82ea46 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Tue, 19 Mar 2002 04:35:45 +0000 Subject: [PATCH] Properly handle a "no keys found" case from the internal HKP code (external HKP is ok). Also, make a COUNT -1 (i.e. streamed) keyserver response a little more efficient. Add --no-allow-non-selfsigned-uid --- g10/ChangeLog | 9 +++++++++ g10/g10.c | 3 +++ g10/keyserver.c | 32 ++++++++++++++++---------------- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 7e101ac67..04c149083 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,12 @@ +2002-03-18 David Shaw + + * keyserver.c (keyserver_search_prompt): Properly handle a "no + keys found" case from the internal HKP code (external HKP is ok). + Also, make a COUNT -1 (i.e. streamed) keyserver response a little + more efficient. + + * g10.c (main): Add --no-allow-non-selfsigned-uid + 2002-03-17 David Shaw * g10.c (main): --openpgp implies --allow-non-selfsigned-uid. diff --git a/g10/g10.c b/g10/g10.c index c3aafb49e..c2c35da8a 100644 --- a/g10/g10.c +++ b/g10/g10.c @@ -239,6 +239,7 @@ enum cmd_and_opt_values { aNull = 0, oDisableCipherAlgo, oDisablePubkeyAlgo, oAllowNonSelfsignedUID, + oNoAllowNonSelfsignedUID, oAllowFreeformUID, oAllowSecretKeyImport, oEnableSpecialFilenames, @@ -500,6 +501,7 @@ static ARGPARSE_OPTS opts[] = { { oDisableCipherAlgo, "disable-cipher-algo", 2, "@" }, { oDisablePubkeyAlgo, "disable-pubkey-algo", 2, "@" }, { oAllowNonSelfsignedUID, "allow-non-selfsigned-uid", 0, "@" }, + { oNoAllowNonSelfsignedUID, "no-allow-non-selfsigned-uid", 0, "@" }, { oAllowFreeformUID, "allow-freeform-uid", 0, "@" }, { oNoLiteral, "no-literal", 0, "@" }, { oSetFilesize, "set-filesize", 20, "@" }, @@ -1223,6 +1225,7 @@ main( int argc, char **argv ) case oNoSigCache: opt.no_sig_cache = 1; break; case oNoSigCreateCheck: opt.no_sig_create_check = 1; break; case oAllowNonSelfsignedUID: opt.allow_non_selfsigned_uid = 1; break; + case oNoAllowNonSelfsignedUID: opt.allow_non_selfsigned_uid=0; break; case oAllowFreeformUID: opt.allow_freeform_uid = 1; break; case oNoLiteral: opt.no_literal = 1; break; case oSetFilesize: opt.set_filesize = pargs.r.ret_ulong; break; diff --git a/g10/keyserver.c b/g10/keyserver.c index 48a6a9b73..717c8643e 100644 --- a/g10/keyserver.c +++ b/g10/keyserver.c @@ -890,7 +890,7 @@ keyserver_search_prompt(IOBUF buffer,int count,const char *searchstr) if(count<0) { validcount=0; - count=1; + count=10; } desc=m_alloc(count*sizeof(KEYDB_SEARCH_DESC)); @@ -901,18 +901,9 @@ keyserver_search_prompt(IOBUF buffer,int count,const char *searchstr) { int rl; - if(i==count) + if(validcount && i%10==0) { - count++; - desc=m_realloc(desc,count*sizeof(KEYDB_SEARCH_DESC)); - validcount=0; - } - - i++; - - if(validcount && (i-1)%10==0) - { - printf("Keys %d-%d of %d",i,(i+90) { - if(print_keyinfo(i,line,&desc[i-1])==-1) + if(print_keyinfo(i+1,line,&desc[i])==0) + { + i++; + + if(i==count) + { + count+=10; + desc=m_realloc(desc,count*sizeof(KEYDB_SEARCH_DESC)); + validcount=0; + } + } + else continue; } - else - i--; - if(rl==0 && i==1) + if(rl==0 && i==0) { count=0; break;