[svn] GnuPG - r4928 - branches/STABLE-BRANCH-1-4/g10
svn author wk
cvs at cvs.gnupg.org
Mon Feb 9 12:14:43 CET 2009
Author: wk
Date: 2009-02-09 12:14:42 +0100 (Mon, 09 Feb 2009)
New Revision: 4928
Modified:
branches/STABLE-BRANCH-1-4/g10/ChangeLog
branches/STABLE-BRANCH-1-4/g10/keylist.c
Log:
Fix bug 998.
Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-1-4/g10/ChangeLog 2009-02-09 11:09:57 UTC (rev 4927)
+++ branches/STABLE-BRANCH-1-4/g10/ChangeLog 2009-02-09 11:14:42 UTC (rev 4928)
@@ -1,3 +1,8 @@
+2009-02-09 Werner Koch <wk at g10code.com>
+
+ * keylist.c (print_capabilities): Take care of cert-only keys.
+ Fixes bug#998.
+
2009-02-03 David Shaw <dshaw at jabberwocky.com>
* keyserver.c (keyserver_typemap): gpgkeys_hkp handles hkps as
Modified: branches/STABLE-BRANCH-1-4/g10/keylist.c
===================================================================
--- branches/STABLE-BRANCH-1-4/g10/keylist.c 2009-02-09 11:09:57 UTC (rev 4927)
+++ branches/STABLE-BRANCH-1-4/g10/keylist.c 2009-02-09 11:14:42 UTC (rev 4928)
@@ -547,7 +547,8 @@
if(pk || (sk && sk->protect.s2k.mode!=1001))
{
unsigned int use = pk? pk->pubkey_usage : sk->pubkey_usage;
-
+ int c_printed = 0;
+
if ( use & PUBKEY_USAGE_ENC )
putchar ('e');
@@ -555,9 +556,19 @@
{
putchar ('s');
if( pk? pk->is_primary : sk->is_primary )
- putchar ('c');
+ {
+ putchar ('c');
+ /* The PUBKEY_USAGE_CERT flag was introduced later and
+ we used to always print 'c' for a primary key. To
+ avoid any regression here we better track whether we
+ printed 'c' already. */
+ c_printed = 1;
+ }
}
+ if ( (use & PUBKEY_USAGE_CERT) && !c_printed )
+ putchar ('c');
+
if ( (use & PUBKEY_USAGE_AUTH) )
putchar ('a');
}
@@ -583,6 +594,8 @@
if(pk->is_primary)
cert = 1;
}
+ if ( pk->pubkey_usage & PUBKEY_USAGE_CERT )
+ cert = 1;
if ( (pk->pubkey_usage & PUBKEY_USAGE_AUTH) )
auth = 1;
}
@@ -600,6 +613,8 @@
if(sk->is_primary)
cert = 1;
}
+ if ( (sk->pubkey_usage & PUBKEY_USAGE_CERT) )
+ cert = 1;
if ( (sk->pubkey_usage & PUBKEY_USAGE_AUTH) )
auth = 1;
}
More information about the Gnupg-commits
mailing list