1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-23 10:29:58 +01:00

* keylist.c (print_capabilities): Secret-parts-missing keys should show

that fact in the capabilities.
This commit is contained in:
David Shaw 2002-10-03 19:17:02 +00:00
parent 3f2d94179f
commit 09fe2195bc
2 changed files with 9 additions and 6 deletions

View File

@ -1,5 +1,8 @@
2002-10-03 David Shaw <dshaw@jabberwocky.com>
* 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).

View File

@ -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;
}
}