mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* keygen.c (do_add_key_flags): Don't set the certify flag for subkeys.
(ask_algo): Provide key flags for DSA, Elgamal_e, and Elgamal subkeys. (generate_keypair): Provide key flags for the default DSA/Elgamal keys. * sig-check.c (signature_check, signature_check2, check_key_signature, check_key_signature2): Allow passing NULLs for unused parameters in the x2 form of each function to avoid the need for dummy variables. getkey.c, mainproc.c: Change all callers. * trustdb.h, trustdb.c (read_trust_options): New. Returns items from the trustdb version record. * keylist.c (public_key_list): Use it here for the new "tru" record. * gpgv.c (read_trust_options): Stub.
This commit is contained in:
parent
fa0cc6602b
commit
fbdee01db9
9 changed files with 129 additions and 29 deletions
20
g10/keygen.c
20
g10/keygen.c
|
@ -137,7 +137,12 @@ do_add_key_flags (PKT_signature *sig, unsigned int use)
|
|||
|
||||
buf[0] = 0;
|
||||
if (use & PUBKEY_USAGE_SIG)
|
||||
buf[0] |= 0x01 | 0x02;
|
||||
{
|
||||
if(sig->sig_class==0x18)
|
||||
buf[0] |= 0x02; /* Don't set the certify flag for subkeys */
|
||||
else
|
||||
buf[0] |= 0x01 | 0x02;
|
||||
}
|
||||
if (use & PUBKEY_USAGE_ENC)
|
||||
buf[0] |= 0x04 | 0x08;
|
||||
build_sig_subpkt (sig, SIGSUBPKT_KEY_FLAGS, buf, 1);
|
||||
|
@ -1074,15 +1079,18 @@ ask_algo (int addmode, unsigned int *r_usage)
|
|||
_("Create anyway? ")))
|
||||
{
|
||||
algo = PUBKEY_ALGO_ELGAMAL;
|
||||
*r_usage = PUBKEY_USAGE_ENC | PUBKEY_USAGE_SIG;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if( algo == 3 && addmode ) {
|
||||
algo = PUBKEY_ALGO_ELGAMAL_E;
|
||||
*r_usage = PUBKEY_USAGE_ENC;
|
||||
break;
|
||||
}
|
||||
else if( algo == 2 ) {
|
||||
algo = PUBKEY_ALGO_DSA;
|
||||
*r_usage = PUBKEY_USAGE_SIG;
|
||||
break;
|
||||
}
|
||||
else
|
||||
|
@ -2082,6 +2090,11 @@ generate_keypair( const char *fname )
|
|||
strcpy( r->u.value, "1024" );
|
||||
r->next = para;
|
||||
para = r;
|
||||
r = m_alloc_clear( sizeof *r + 20 );
|
||||
r->key = pKEYUSAGE;
|
||||
strcpy( r->u.value, "sign" );
|
||||
r->next = para;
|
||||
para = r;
|
||||
|
||||
algo = PUBKEY_ALGO_ELGAMAL_E;
|
||||
r = m_alloc_clear( sizeof *r + 20 );
|
||||
|
@ -2089,6 +2102,11 @@ generate_keypair( const char *fname )
|
|||
sprintf( r->u.value, "%d", algo );
|
||||
r->next = para;
|
||||
para = r;
|
||||
r = m_alloc_clear( sizeof *r + 20 );
|
||||
r->key = pSUBKEYUSAGE;
|
||||
strcpy( r->u.value, "encrypt" );
|
||||
r->next = para;
|
||||
para = r;
|
||||
}
|
||||
else {
|
||||
r = m_alloc_clear( sizeof *r + 20 );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue