mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-23 10:29:58 +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:
parent
9b506bab88
commit
9de7807546
@ -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>
|
2002-06-14 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* free-packet.c (copy_signature): Properly copy a signature that
|
* free-packet.c (copy_signature): Properly copy a signature that
|
||||||
|
@ -505,9 +505,6 @@ keygen_add_revkey(PKT_signature *sig, void *opaque)
|
|||||||
|
|
||||||
build_sig_subpkt(sig,SIGSUBPKT_REV_KEY,buf,2+MAX_FINGERPRINT_LEN);
|
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 */
|
/* All sigs with revocation keys set are nonrevocable */
|
||||||
sig->flags.revocable=0;
|
sig->flags.revocable=0;
|
||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
|
@ -368,16 +368,16 @@ check_permissions(const char *path,int extension,int checkonly)
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isdir=S_ISDIR(statbuf.st_mode);
|
||||||
|
|
||||||
/* We may have to revisit this if we start piping keyrings to gpg
|
/* We may have to revisit this if we start piping keyrings to gpg
|
||||||
over a named pipe or keyserver character device :) */
|
over a named pipe or keyserver character device :) */
|
||||||
if(!S_ISREG(statbuf.st_mode))
|
if(!isdir && !S_ISREG(statbuf.st_mode))
|
||||||
{
|
{
|
||||||
ret=0;
|
ret=0;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
isdir=S_ISDIR(statbuf.st_mode);
|
|
||||||
|
|
||||||
/* Per-user files must be owned by the user. Extensions must be
|
/* Per-user files must be owned by the user. Extensions must be
|
||||||
owned by the user or root. */
|
owned by the user or root. */
|
||||||
if((!extension && statbuf.st_uid != getuid()) ||
|
if((!extension && statbuf.st_uid != getuid()) ||
|
||||||
|
@ -691,7 +691,7 @@ default_recipient(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
expand_id(const char *id,STRLIST *into)
|
expand_id(const char *id,STRLIST *into,unsigned int flags)
|
||||||
{
|
{
|
||||||
struct groupitem *groups;
|
struct groupitem *groups;
|
||||||
int count=0;
|
int count=0;
|
||||||
@ -707,7 +707,7 @@ expand_id(const char *id,STRLIST *into)
|
|||||||
for(each=groups->values;each;each=each->next)
|
for(each=groups->values;each;each=each->next)
|
||||||
{
|
{
|
||||||
sl=add_to_strlist(into,each->d);
|
sl=add_to_strlist(into,each->d);
|
||||||
sl->flags=each->flags;
|
sl->flags=flags;
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -726,7 +726,7 @@ expand_group(STRLIST input)
|
|||||||
STRLIST sl,output=NULL,rover;
|
STRLIST sl,output=NULL,rover;
|
||||||
|
|
||||||
for(rover=input;rover;rover=rover->next)
|
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 */
|
/* Didn't find any groups, so use the existing string */
|
||||||
sl=add_to_strlist(&output,rover->d);
|
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);
|
m_free(answer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if(expand_id(answer,&backlog))
|
if(expand_id(answer,&backlog,0))
|
||||||
continue;
|
continue;
|
||||||
if( pk )
|
if( pk )
|
||||||
free_public_key( pk );
|
free_public_key( pk );
|
||||||
|
@ -50,7 +50,8 @@ is_algo_in_prefs ( KBNODE keyblock, preftype_t type, int algo )
|
|||||||
PKT_user_id *uid = k->pkt->pkt.user_id;
|
PKT_user_id *uid = k->pkt->pkt.user_id;
|
||||||
prefitem_t *prefs = uid->prefs;
|
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++ )
|
for (; prefs->type; prefs++ )
|
||||||
if (prefs->type == type && prefs->value == algo)
|
if (prefs->type == type && prefs->value == algo)
|
||||||
return 1;
|
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.
|
* it in DEK, which should have been allocated in secure memory.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user