mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-05 12:31:50 +01:00
* keylist.c (print_capabilities): Secret-parts-missing keys should show
that fact in the capabilities, and only primary signing keys can certify other keys. * packet.h, parse_packet.c (parse_key): Add is_primary flag for public keys (it already exists for secret keys).
This commit is contained in:
parent
58972f24c4
commit
fcefffcb00
@ -1,3 +1,12 @@
|
|||||||
|
2002-10-03 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* keylist.c (print_capabilities): Secret-parts-missing keys should
|
||||||
|
show that fact in the capabilities, and only primary signing keys
|
||||||
|
can certify other keys.
|
||||||
|
|
||||||
|
* packet.h, parse_packet.c (parse_key): Add is_primary flag for
|
||||||
|
public keys (it already exists for secret keys).
|
||||||
|
|
||||||
2002-10-02 David Shaw <dshaw@jabberwocky.com>
|
2002-10-02 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* import.c (import_secret_one): Check for an illegal (>110)
|
* import.c (import_secret_one): Check for an illegal (>110)
|
||||||
|
@ -305,8 +305,9 @@ print_capabilities (PKT_public_key *pk, PKT_secret_key *sk, KBNODE keyblock)
|
|||||||
if ( use & PUBKEY_USAGE_ENC ) {
|
if ( use & PUBKEY_USAGE_ENC ) {
|
||||||
putchar ('e');
|
putchar ('e');
|
||||||
}
|
}
|
||||||
if ( use & PUBKEY_USAGE_SIG ) {
|
if ( (use & PUBKEY_USAGE_SIG) && !(sk?(sk->protect.s2k.mode==1001):0) ) {
|
||||||
putchar ('s');
|
putchar ('s');
|
||||||
|
if( pk? pk->is_primary : sk->is_primary )
|
||||||
putchar ('c');
|
putchar ('c');
|
||||||
}
|
}
|
||||||
if ( keyblock ) { /* figure our the usable capabilities */
|
if ( keyblock ) { /* figure our the usable capabilities */
|
||||||
@ -321,17 +322,26 @@ print_capabilities (PKT_public_key *pk, PKT_secret_key *sk, KBNODE keyblock)
|
|||||||
if ( pk->pubkey_usage & PUBKEY_USAGE_ENC )
|
if ( pk->pubkey_usage & PUBKEY_USAGE_ENC )
|
||||||
enc = 1;
|
enc = 1;
|
||||||
if ( pk->pubkey_usage & PUBKEY_USAGE_SIG )
|
if ( pk->pubkey_usage & PUBKEY_USAGE_SIG )
|
||||||
sign = cert = 1;
|
{
|
||||||
|
sign = 1;
|
||||||
|
if(pk->is_primary)
|
||||||
|
cert = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( k->pkt->pkttype == PKT_SECRET_KEY
|
else if ( k->pkt->pkttype == PKT_SECRET_KEY
|
||||||
|| k->pkt->pkttype == PKT_SECRET_SUBKEY ) {
|
|| k->pkt->pkttype == PKT_SECRET_SUBKEY ) {
|
||||||
sk = k->pkt->pkt.secret_key;
|
sk = k->pkt->pkt.secret_key;
|
||||||
if ( sk->is_valid && !sk->is_revoked && !sk->has_expired ) {
|
if ( sk->is_valid && !sk->is_revoked && !sk->has_expired
|
||||||
|
&& sk->protect.s2k.mode!=1001 ) {
|
||||||
if ( sk->pubkey_usage & PUBKEY_USAGE_ENC )
|
if ( sk->pubkey_usage & PUBKEY_USAGE_ENC )
|
||||||
enc = 1;
|
enc = 1;
|
||||||
if ( sk->pubkey_usage & PUBKEY_USAGE_SIG )
|
if ( sk->pubkey_usage & PUBKEY_USAGE_SIG )
|
||||||
sign = cert = 1;
|
{
|
||||||
|
sign = 1;
|
||||||
|
if(sk->is_primary)
|
||||||
|
cert = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,6 +202,7 @@ typedef struct {
|
|||||||
ulong local_id; /* internal use, valid if > 0 */
|
ulong local_id; /* internal use, valid if > 0 */
|
||||||
u32 main_keyid[2]; /* keyid of the primary key */
|
u32 main_keyid[2]; /* keyid of the primary key */
|
||||||
u32 keyid[2]; /* calculated by keyid_from_pk() */
|
u32 keyid[2]; /* calculated by keyid_from_pk() */
|
||||||
|
byte is_primary;
|
||||||
prefitem_t *prefs; /* list of preferences (may be NULL) */
|
prefitem_t *prefs; /* list of preferences (may be NULL) */
|
||||||
int mdc_feature; /* mdc feature set */
|
int mdc_feature; /* mdc feature set */
|
||||||
byte *namehash; /* if != NULL: found by this name */
|
byte *namehash; /* if != NULL: found by this name */
|
||||||
|
@ -1523,6 +1523,7 @@ parse_key( IOBUF inp, int pkttype, unsigned long pktlen,
|
|||||||
pk->max_expiredate = max_expiredate;
|
pk->max_expiredate = max_expiredate;
|
||||||
pk->hdrbytes = hdrlen;
|
pk->hdrbytes = hdrlen;
|
||||||
pk->version = version;
|
pk->version = version;
|
||||||
|
pk->is_primary = pkttype == PKT_PUBLIC_KEY;
|
||||||
pk->pubkey_algo = algorithm;
|
pk->pubkey_algo = algorithm;
|
||||||
pk->req_usage = 0;
|
pk->req_usage = 0;
|
||||||
pk->pubkey_usage = 0; /* not yet used */
|
pk->pubkey_usage = 0; /* not yet used */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user