From 6be3bee320f8d6327df9d9487857b90a28bbc364 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Thu, 4 Apr 2002 03:45:50 +0000 Subject: [PATCH] Fix auto-key-retrieve to actually work as a keyserver-option (noted by Roger Sondermann). Do not reorder the primary attribute packet - the first user ID must be a genuine one. --- g10/ChangeLog | 8 ++++++++ g10/keylist.c | 11 ++++++----- g10/keyserver.c | 4 ++-- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index c4ce2c5e5..d2c63dc53 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,11 @@ +2002-04-03 David Shaw + + * keyserver.c (parse_keyserver_options): fix auto-key-retrieve to + actually work as a keyserver-option (noted by Roger Sondermann). + + * keylist.c (reorder_keyblock): do not reorder the primary + attribute packet - the first user ID must be a genuine one. + 2002-03-31 David Shaw * keylist.c (list_keyblock_colon): Fix ownertrust display with diff --git a/g10/keylist.c b/g10/keylist.c index 20fa7d8b8..3b220d7f7 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -781,9 +781,9 @@ list_keyblock_colon( KBNODE keyblock, int secret ) } /* - * Reorder the keyblock so that the primary user ID comes first. - * Fixme: Replace this by a generic sort function. - */ + * Reorder the keyblock so that the primary user ID (and not attribute + * packet) comes first. Fixme: Replace this by a generic sort + * function. */ static void reorder_keyblock (KBNODE keyblock) { @@ -791,8 +791,9 @@ reorder_keyblock (KBNODE keyblock) KBNODE last, node; for (node=keyblock; node; primary0=node, node = node->next) { - if( node->pkt->pkttype == PKT_USER_ID - && node->pkt->pkt.user_id->is_primary ) { + if( node->pkt->pkttype == PKT_USER_ID && + !node->pkt->pkt.user_id->attrib_data && + node->pkt->pkt.user_id->is_primary ) { primary = primary2 = node; for (node=node->next; node; primary2=node, node = node->next ) { if( node->pkt->pkttype == PKT_USER_ID diff --git a/g10/keyserver.c b/g10/keyserver.c index ed724c6ab..c4feb9adb 100644 --- a/g10/keyserver.c +++ b/g10/keyserver.c @@ -91,9 +91,9 @@ parse_keyserver_options(char *options) else if(strcasecmp(tok,"no-refresh-add-fake-v3-keyids")==0) opt.keyserver_options.refresh_add_fake_v3_keyids=0; else if(strcasecmp(tok,"auto-key-retrieve")==0) - opt.keyserver_options.refresh_add_fake_v3_keyids=1; + opt.keyserver_options.auto_key_retrieve=1; else if(strcasecmp(tok,"no-auto-key-retrieve")==0) - opt.keyserver_options.refresh_add_fake_v3_keyids=0; + opt.keyserver_options.auto_key_retrieve=0; else if(strlen(tok)>0) add_to_strlist(&opt.keyserver_options.other,tok);