diff --git a/g10/ChangeLog b/g10/ChangeLog index e5cba7678..1d566d221 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,5 +1,8 @@ 2002-10-03 David Shaw + * keylist.c (print_capabilities): Secret-parts-missing keys should + show that fact in the capabilities. + * packet.h, parse_packet (parse_key): Add is_primary flag for public keys (it already exists for secret keys). diff --git a/g10/keylist.c b/g10/keylist.c index febb9a7bc..90a8d9d86 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -301,14 +301,13 @@ static void print_capabilities (PKT_public_key *pk, PKT_secret_key *sk, KBNODE keyblock) { unsigned int use = pk? pk->pubkey_usage : sk->pubkey_usage; - int primary = pk? pk->is_primary : sk->is_primary; if ( use & PUBKEY_USAGE_ENC ) { putchar ('e'); } - if ( use & PUBKEY_USAGE_SIG ) { + if ( (use & PUBKEY_USAGE_SIG) && !(sk?(sk->protect.s2k.mode==1001):0) ) { putchar ('s'); - if(primary) + if( pk? pk->is_primary : sk->is_primary ) putchar ('c'); } if ( keyblock ) { /* figure our the usable capabilities */ @@ -325,7 +324,7 @@ print_capabilities (PKT_public_key *pk, PKT_secret_key *sk, KBNODE keyblock) if ( pk->pubkey_usage & PUBKEY_USAGE_SIG ) { sign = 1; - if(primary) + if(pk->is_primary) cert = 1; } } @@ -333,13 +332,14 @@ print_capabilities (PKT_public_key *pk, PKT_secret_key *sk, KBNODE keyblock) else if ( k->pkt->pkttype == PKT_SECRET_KEY || k->pkt->pkttype == PKT_SECRET_SUBKEY ) { 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 ) enc = 1; if ( sk->pubkey_usage & PUBKEY_USAGE_SIG ) { sign = 1; - if(primary) + if(sk->is_primary) cert = 1; } }