aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keylist.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-10-07 22:19:11 +0000
committerDavid Shaw <[email protected]>2002-10-07 22:19:11 +0000
commite4f5b9b4c2446c0c766bda018ef7e6d1d669985f (patch)
tree5dda6b651ab1db17c5d55b3f3c1253ebc84fa797 /g10/keylist.c
parent* configure.ac: OpenLDAP 2.0.27 changed the dependencies again. Add a (diff)
downloadgnupg-e4f5b9b4c2446c0c766bda018ef7e6d1d669985f.tar.gz
gnupg-e4f5b9b4c2446c0c766bda018ef7e6d1d669985f.zip
* import.c (import_keys_internal): Missed one s/inp/inp2/.
* 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) * mainproc.c (symkey_decrypt_sesskey): Fix compiler warning.
Diffstat (limited to 'g10/keylist.c')
-rw-r--r--g10/keylist.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/g10/keylist.c b/g10/keylist.c
index 90a8d9d86..a1a0e4c13 100644
--- a/g10/keylist.c
+++ b/g10/keylist.c
@@ -300,16 +300,21 @@ print_key_data( PKT_public_key *pk, u32 *keyid )
static void
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');
+
+ 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 */
KBNODE k;
int enc=0, sign=0, cert=0;