* getkey.c (parse_auto_key_locate): Fix dupe-removal code.

* keyedit.c (menu_backsign): Allow backsigning even if the secret
subkey doesn't have a binding signature.

* armor.c (radix64_read): Don't report EOF when reading only a pad (=)
character.  The EOF actually starts after the pad.

* gpg.c (main): Make --export, --send-keys, --recv-keys,
--refresh-keys, and --fetch-keys follow their arguments from left to
right.  Suggested by Peter Palfrader.
This commit is contained in:
David Shaw 2006-04-09 03:34:09 +00:00
parent 4fdc6387c3
commit 51e88a5fdb
5 changed files with 41 additions and 20 deletions

View File

@ -1,3 +1,17 @@
2006-04-08 David Shaw <dshaw@jabberwocky.com>
* getkey.c (parse_auto_key_locate): Fix dupe-removal code.
* keyedit.c (menu_backsign): Allow backsigning even if the secret
subkey doesn't have a binding signature.
* armor.c (radix64_read): Don't report EOF when reading only a pad
(=) character. The EOF actually starts after the pad.
* gpg.c (main): Make --export, --send-keys, --recv-keys,
--refresh-keys, and --fetch-keys follow their arguments from left
to right. Suggested by Peter Palfrader.
2006-04-08 Werner Koch <wk@g10code.com>
* mainproc.c (list_node): Print ring trust value only if not empty
@ -7,7 +21,7 @@
* getkey.c (user_id_not_found_utf8): New.
(get_primary_uid, get_user_id): Use it. Fixes Debian bug #205028
inthe right way.
in the right way.
2006-04-03 Werner Koch <wk@g10code.com>

View File

@ -676,7 +676,7 @@ radix64_read( armor_filter_context_t *afx, IOBUF a, size_t *retn,
int checkcrc=0;
int rc = 0;
size_t n = 0;
int idx, i;
int idx, i, onlypad=0;
u32 crc;
crc = afx->crc;
@ -720,6 +720,8 @@ radix64_read( armor_filter_context_t *afx, IOBUF a, size_t *retn,
goto again;
}
}
else if(n==0)
onlypad=1;
if( idx == 1 )
buf[n++] = val;
@ -848,7 +850,7 @@ radix64_read( armor_filter_context_t *afx, IOBUF a, size_t *retn,
}
}
if( !n )
if( !n && !onlypad )
rc = -1;
*retn = n;

View File

@ -2947,7 +2947,7 @@ parse_auto_key_locate(char *options)
while((tok=optsep(&options)))
{
struct akl *akl,*last;
struct akl *akl,*check,*last=NULL;
int dupe=0;
if(tok[0]=='\0')
@ -2976,13 +2976,13 @@ parse_auto_key_locate(char *options)
}
/* We must maintain the order the user gave us */
for(last=opt.auto_key_locate;last && last->next;last=last->next)
for(check=opt.auto_key_locate;check;last=check,check=check->next)
{
/* Check for duplicates */
if(last && last->type==akl->type
if(check->type==akl->type
&& (akl->type!=AKL_SPEC
|| (akl->type==AKL_SPEC
&& strcmp(last->spec->uri,akl->spec->uri)==0)))
&& strcmp(check->spec->uri,akl->spec->uri)==0)))
{
dupe=1;
free_akl(akl);

View File

@ -3399,12 +3399,17 @@ main (int argc, char **argv )
import_keys( argc? argv:NULL, argc, NULL, opt.import_options );
break;
/* TODO: There are a number of command that use this same
"make strlist, call function, report error, free strlist"
pattern. Join them together here and avoid all that
duplicated code. */
case aExport:
case aSendKeys:
case aRecvKeys:
sl = NULL;
for( ; argc; argc--, argv++ )
add_to_strlist2( &sl, *argv, utf8_strings );
append_to_strlist2( &sl, *argv, utf8_strings );
if( cmd == aSendKeys )
rc=keyserver_export( sl );
else if( cmd == aRecvKeys )
@ -3436,7 +3441,7 @@ main (int argc, char **argv )
case aRefreshKeys:
sl = NULL;
for( ; argc; argc--, argv++ )
add_to_strlist2( &sl, *argv, utf8_strings );
append_to_strlist2( &sl, *argv, utf8_strings );
rc=keyserver_refresh(sl);
if(rc)
log_error(_("keyserver refresh failed: %s\n"),g10_errstr(rc));
@ -3446,7 +3451,7 @@ main (int argc, char **argv )
case aFetchKeys:
sl = NULL;
for( ; argc; argc--, argv++ )
add_to_strlist2( &sl, *argv, utf8_strings );
append_to_strlist2( &sl, *argv, utf8_strings );
rc=keyserver_fetch(sl);
if(rc)
log_error("key fetch failed: %s\n",g10_errstr(rc));

View File

@ -3711,9 +3711,6 @@ menu_backsign(KBNODE pub_keyblock,KBNODE sec_keyblock)
break;
}
if(!sig_sk)
continue;
/* Now we can get to work. We have a main key and secret part,
a signing subkey with signature and secret part with
signature. */
@ -3744,13 +3741,16 @@ menu_backsign(KBNODE pub_keyblock,KBNODE sec_keyblock)
xfree(sig_pk->pkt);
sig_pk->pkt=newpkt;
/* Put the new sig into place on the seckey */
newpkt=xmalloc_clear(sizeof(*newpkt));
newpkt->pkttype=PKT_SIGNATURE;
newpkt->pkt.signature=copy_signature(NULL,newsig);
free_packet(sig_sk->pkt);
xfree(sig_sk->pkt);
sig_sk->pkt=newpkt;
if(sig_sk)
{
/* Put the new sig into place on the seckey */
newpkt=xmalloc_clear(sizeof(*newpkt));
newpkt->pkttype=PKT_SIGNATURE;
newpkt->pkt.signature=copy_signature(NULL,newsig);
free_packet(sig_sk->pkt);
xfree(sig_sk->pkt);
sig_sk->pkt=newpkt;
}
modified=1;
}