1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

* keygen.c (keygen_add_revkey): Remove unused code.

* misc.c (check_permissions): Check directory permissions properly - they
are not special files.

* pkclist.c (expand_id, expand_group, build_pk_list): When expanding
groups before building a pk list, inherit flags from the original
pre-expanded string.

* pubkey-enc.c (is_algo_in_prefs): Don't use prefs from expired uids.
This commit is contained in:
David Shaw 2002-06-15 04:14:58 +00:00
parent 9b506bab88
commit 9de7807546
5 changed files with 24 additions and 12 deletions

View File

@ -1,3 +1,17 @@
2002-06-15 David Shaw <dshaw@jabberwocky.com>
* keygen.c (keygen_add_revkey): Remove unused code.
* misc.c (check_permissions): Check directory permissions
properly - they are not special files.
* pkclist.c (expand_id, expand_group, build_pk_list): When
expanding groups before building a pk list, inherit flags from the
original pre-expanded string.
* pubkey-enc.c (is_algo_in_prefs): Don't use prefs from expired
uids.
2002-06-14 David Shaw <dshaw@jabberwocky.com>
* free-packet.c (copy_signature): Properly copy a signature that

View File

@ -505,9 +505,6 @@ keygen_add_revkey(PKT_signature *sig, void *opaque)
build_sig_subpkt(sig,SIGSUBPKT_REV_KEY,buf,2+MAX_FINGERPRINT_LEN);
sig->revkey=m_realloc(sig->revkey,
sizeof(struct revocation_key *)*(sig->numrevkeys+1));
/* All sigs with revocation keys set are nonrevocable */
sig->flags.revocable=0;
buf[0] = 0;

View File

@ -368,16 +368,16 @@ check_permissions(const char *path,int extension,int checkonly)
goto end;
}
isdir=S_ISDIR(statbuf.st_mode);
/* We may have to revisit this if we start piping keyrings to gpg
over a named pipe or keyserver character device :) */
if(!S_ISREG(statbuf.st_mode))
if(!isdir && !S_ISREG(statbuf.st_mode))
{
ret=0;
goto end;
}
isdir=S_ISDIR(statbuf.st_mode);
/* Per-user files must be owned by the user. Extensions must be
owned by the user or root. */
if((!extension && statbuf.st_uid != getuid()) ||

View File

@ -691,7 +691,7 @@ default_recipient(void)
}
static int
expand_id(const char *id,STRLIST *into)
expand_id(const char *id,STRLIST *into,unsigned int flags)
{
struct groupitem *groups;
int count=0;
@ -707,7 +707,7 @@ expand_id(const char *id,STRLIST *into)
for(each=groups->values;each;each=each->next)
{
sl=add_to_strlist(into,each->d);
sl->flags=each->flags;
sl->flags=flags;
count++;
}
@ -726,7 +726,7 @@ expand_group(STRLIST input)
STRLIST sl,output=NULL,rover;
for(rover=input;rover;rover=rover->next)
if(expand_id(rover->d,&output)==0)
if(expand_id(rover->d,&output,rover->flags)==0)
{
/* Didn't find any groups, so use the existing string */
sl=add_to_strlist(&output,rover->d);
@ -821,7 +821,7 @@ build_pk_list( STRLIST rcpts, PK_LIST *ret_pk_list, unsigned use )
m_free(answer);
break;
}
if(expand_id(answer,&backlog))
if(expand_id(answer,&backlog,0))
continue;
if( pk )
free_public_key( pk );

View File

@ -50,7 +50,8 @@ is_algo_in_prefs ( KBNODE keyblock, preftype_t type, int algo )
PKT_user_id *uid = k->pkt->pkt.user_id;
prefitem_t *prefs = uid->prefs;
if (uid->created && !uid->is_revoked && prefs ) {
if (uid->created && prefs &&
!uid->is_revoked && !uid->is_expired ) {
for (; prefs->type; prefs++ )
if (prefs->type == type && prefs->value == algo)
return 1;
@ -62,7 +63,7 @@ is_algo_in_prefs ( KBNODE keyblock, preftype_t type, int algo )
/****************
* Get the session key from a pubkey enc paket and return
* Get the session key from a pubkey enc packet and return
* it in DEK, which should have been allocated in secure memory.
*/
int