[svn] GnuPG - r4927 - in trunk: g10 sm

svn author wk cvs at cvs.gnupg.org
Mon Feb 9 12:09:58 CET 2009


Author: wk
Date: 2009-02-09 12:09:57 +0100 (Mon, 09 Feb 2009)
New Revision: 4927

Modified:
   trunk/g10/ChangeLog
   trunk/g10/keyedit.c
   trunk/g10/keylist.c
   trunk/sm/gpgsm.c
Log:
Fix bug#998.


Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog	2009-02-09 10:25:41 UTC (rev 4926)
+++ trunk/g10/ChangeLog	2009-02-09 11:09:57 UTC (rev 4927)
@@ -1,3 +1,9 @@
+2009-02-09  Werner Koch  <wk at g10code.com>
+
+	* keylist.c (print_capabilities): Take care of cert-only keys.
+	Fixes bug#998.
+	* keyedit.c (show_key_with_all_names_colon): Print the capabilities.
+
 2009-01-26  Werner Koch  <wk at g10code.com>
 
 	* card-util.c (card_status): Detect a Geldkarte. 

Modified: trunk/g10/keyedit.c
===================================================================
--- trunk/g10/keyedit.c	2009-02-09 10:25:41 UTC (rev 4926)
+++ trunk/g10/keyedit.c	2009-02-09 11:09:57 UTC (rev 4927)
@@ -2522,6 +2522,17 @@
 	      && !(opt.fast_list_mode || opt.no_expensive_trust_checks ))
 	    putchar(get_ownertrust_info (pk));
           putchar(':');
+          putchar (':');
+          putchar (':');
+          /* Print capabilities.  */
+          if ( (pk->pubkey_usage & PUBKEY_USAGE_ENC) )
+            putchar ('e');
+          if ( (pk->pubkey_usage & PUBKEY_USAGE_SIG) )
+            putchar ('s');
+          if ( (pk->pubkey_usage & PUBKEY_USAGE_CERT) )
+            putchar ('c');
+          if ( (pk->pubkey_usage & PUBKEY_USAGE_AUTH) )
+            putchar ('a');
           putchar('\n');
           
           print_fingerprint (pk, NULL, 0);

Modified: trunk/g10/keylist.c
===================================================================
--- trunk/g10/keylist.c	2009-02-09 10:25:41 UTC (rev 4926)
+++ trunk/g10/keylist.c	2009-02-09 11:09:57 UTC (rev 4927)
@@ -594,6 +594,7 @@
   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');
@@ -602,9 +603,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');
     }
@@ -630,6 +641,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;
                 }
@@ -647,6 +660,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;
                 }

Modified: trunk/sm/gpgsm.c
===================================================================
--- trunk/sm/gpgsm.c	2009-02-09 10:25:41 UTC (rev 4926)
+++ trunk/sm/gpgsm.c	2009-02-09 11:09:57 UTC (rev 4927)
@@ -893,7 +893,7 @@
 
   /* Note: If you change this default cipher algorithm , please
      remember to update the Gpgconflist entry as well.  */
-  opt.def_cipher_algoid = "AES";  /*des-EDE3-CBC*/
+  opt.def_cipher_algoid = "3DES";  /*des-EDE3-CBC*/
 
   opt.homedir = default_homedir ();
 
@@ -1607,7 +1607,7 @@
 #ifndef HAVE_W32_SYSTEM
         printf ("prefer-system-dirmngr:%lu:\n", GC_OPT_FLAG_NONE);
 #endif
-        printf ("cipher-algo:%lu:\"AES:\n", GC_OPT_FLAG_DEFAULT);
+        printf ("cipher-algo:%lu:\"3DES:\n", GC_OPT_FLAG_DEFAULT);
         printf ("p12-charset:%lu:\n", GC_OPT_FLAG_DEFAULT);
         printf ("default-key:%lu:\n", GC_OPT_FLAG_DEFAULT);
         printf ("encrypt-to:%lu:\n", GC_OPT_FLAG_DEFAULT);




More information about the Gnupg-commits mailing list