1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-02-12 18:23:04 +01:00

* keylist.c (print_capabilities): Properly indicate per-key capabilities

of sign&encrypt primary keys that have secret-parts-missing (i.e. no
capabilities at all).
This commit is contained in:
David Shaw 2002-10-07 18:20:28 +00:00
parent d1738ac243
commit 3832320327
2 changed files with 18 additions and 7 deletions

View File

@ -1,3 +1,9 @@
2002-10-07 David Shaw <dshaw@jabberwocky.com>
* keylist.c (print_capabilities): Properly indicate per-key
capabilities of sign&encrypt primary keys that have
secret-parts-missing (i.e. no capabilities at all).
2002-10-04 David Shaw <dshaw@jabberwocky.com> 2002-10-04 David Shaw <dshaw@jabberwocky.com>
* getkey.c (get_pubkey_direct): Don't cache keys retrieved via * getkey.c (get_pubkey_direct): Don't cache keys retrieved via

View File

@ -300,16 +300,21 @@ print_key_data( PKT_public_key *pk, u32 *keyid )
static void static void
print_capabilities (PKT_public_key *pk, PKT_secret_key *sk, KBNODE keyblock) print_capabilities (PKT_public_key *pk, PKT_secret_key *sk, KBNODE keyblock)
{ {
unsigned int use = pk? pk->pubkey_usage : sk->pubkey_usage; if(pk || (sk && sk->protect.s2k.mode!=1001))
{
unsigned int use = pk? pk->pubkey_usage : sk->pubkey_usage;
if ( use & PUBKEY_USAGE_ENC ) { if ( use & PUBKEY_USAGE_ENC )
putchar ('e'); putchar ('e');
if ( use & PUBKEY_USAGE_SIG )
{
putchar ('s');
if( pk? pk->is_primary : sk->is_primary )
putchar ('c');
}
} }
if ( (use & PUBKEY_USAGE_SIG) && !(sk?(sk->protect.s2k.mode==1001):0) ) {
putchar ('s');
if( pk? pk->is_primary : sk->is_primary )
putchar ('c');
}
if ( keyblock ) { /* figure our the usable capabilities */ if ( keyblock ) { /* figure our the usable capabilities */
KBNODE k; KBNODE k;
int enc=0, sign=0, cert=0; int enc=0, sign=0, cert=0;