summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <dshaw@jabberwocky.com>2002-09-19 19:13:03 +0200
committerDavid Shaw <dshaw@jabberwocky.com>2002-09-19 19:13:03 +0200
commitc4c0b1dc5be1bdb9b01a29f15e4bc8d4ea465a8a (patch)
tree5a45d2c4981436a0e1321dd7cb6b2c532bacef34
parent* gpgkeys_hkp.c (get_key, handle_old_hkp_index, search_key): Properly (diff)
downloadgnupg2-c4c0b1dc5be1bdb9b01a29f15e4bc8d4ea465a8a.tar.xz
gnupg2-c4c0b1dc5be1bdb9b01a29f15e4bc8d4ea465a8a.zip
From stable branch
* keyserver.c (keyserver_spawn): Properly handle line truncation. Don't leak memory (~10-20 bytes) on searches. (keyserver_search_prompt): Cleanup. * keylist.c (list_keyblock_colon): Show 1F direct key signatures in --with-colons listing.
-rw-r--r--g10/ChangeLog9
-rw-r--r--g10/keylist.c2
-rw-r--r--g10/keyserver.c25
3 files changed, 23 insertions, 13 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index cd988f27f..9ada90a51 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,12 @@
+2002-09-19 David Shaw <dshaw@jabberwocky.com>
+
+ * keyserver.c (keyserver_spawn): Properly handle line truncation.
+ Don't leak memory (~10-20 bytes) on searches.
+ (keyserver_search_prompt): Cleanup.
+
+ * keylist.c (list_keyblock_colon): Show 1F direct key signatures
+ in --with-colons listing.
+
2002-09-16 David Shaw <dshaw@jabberwocky.com>
* keyedit.c (menu_addrevoker): The direct key signature for
diff --git a/g10/keylist.c b/g10/keylist.c
index 307735184..829b81249 100644
--- a/g10/keylist.c
+++ b/g10/keylist.c
@@ -837,6 +837,8 @@ list_keyblock_colon( KBNODE keyblock, int secret, int fpr )
sigstr = "sig";
else if( sig->sig_class == 0x18 )
sigstr = "sig";
+ else if( sig->sig_class == 0x1F )
+ sigstr = "sig";
else {
printf ("sig::::::::::%02x%c:\n",
sig->sig_class, sig->flags.exportable?'x':'l');
diff --git a/g10/keyserver.c b/g10/keyserver.c
index 96f8777ab..f054acf5c 100644
--- a/g10/keyserver.c
+++ b/g10/keyserver.c
@@ -334,7 +334,7 @@ keyserver_spawn(int action,STRLIST list,
{
int ret=0,i,gotversion=0,outofband=0;
STRLIST temp;
- unsigned int maxlen=256,buflen;
+ unsigned int maxlen,buflen;
char *command=NULL,*searchstr=NULL;
byte *line=NULL;
struct kopts *kopts;
@@ -544,6 +544,7 @@ keyserver_spawn(int action,STRLIST list,
char *ptr;
int plen;
+ maxlen=1024;
if(iobuf_read_line(spawn->fromchild,&line,&buflen,&maxlen)==0)
{
ret=G10ERR_READ_FILE;
@@ -582,8 +583,6 @@ keyserver_spawn(int action,STRLIST list,
outofband=1; /* Currently the only OPTION */
}
- m_free(line);
-
if(!gotversion)
{
log_error(_("keyserver did not send VERSION\n"));
@@ -599,12 +598,12 @@ keyserver_spawn(int action,STRLIST list,
stats_handle=import_new_stats_handle();
- /* Slurp up all the key data. In the future, it might be nice
- to look for KEY foo OUTOFBAND and FAILED indicators. It's
- harmless to ignore them, but ignoring them does make gpg
- complain about "no valid OpenPGP data found". One way to
- do this could be to continue parsing this line-by-line and
- make a temp iobuf for each key. */
+ /* Slurp up all the key data. In the future, it might be
+ nice to look for KEY foo OUTOFBAND and FAILED indicators.
+ It's harmless to ignore them, but ignoring them does make
+ gpg complain about "no valid OpenPGP data found". One
+ way to do this could be to continue parsing this
+ line-by-line and make a temp iobuf for each key. */
import_keys_stream(spawn->fromchild,0,stats_handle,
opt.keyserver_options.import_options);
@@ -621,12 +620,10 @@ keyserver_spawn(int action,STRLIST list,
case SEARCH:
{
- line=NULL;
- buflen = 0;
- maxlen = 80;
/* Look for the COUNT line */
do
{
+ maxlen=1024;
if(iobuf_read_line(spawn->fromchild,&line,&buflen,&maxlen)==0)
{
ret=G10ERR_READ_FILE;
@@ -646,6 +643,8 @@ keyserver_spawn(int action,STRLIST list,
}
fail:
+ m_free(line);
+
*prog=exec_finish(spawn);
return ret;
@@ -969,7 +968,7 @@ void
keyserver_search_prompt(IOBUF buffer,int count,const char *searchstr)
{
int i=0,validcount=1;
- unsigned int maxlen=256,buflen=0;
+ unsigned int maxlen,buflen;
KEYDB_SEARCH_DESC *desc;
byte *line=NULL;
char *answer;