[svn] GnuPG - r5493 - in trunk: . agent common g10 sm tools

svn author wk cvs at cvs.gnupg.org
Thu Dec 2 16:49:04 CET 2010


Author: wk
Date: 2010-12-02 16:49:02 +0100 (Thu, 02 Dec 2010)
New Revision: 5493

Modified:
   trunk/NEWS
   trunk/agent/cvt-openpgp.c
   trunk/common/ChangeLog
   trunk/common/audit.c
   trunk/common/miscellaneous.c
   trunk/common/util.h
   trunk/g10/ChangeLog
   trunk/g10/misc.c
   trunk/sm/encrypt.c
   trunk/sm/gpgsm.c
   trunk/tools/ChangeLog
   trunk/tools/no-libgcrypt.c
Log:
s/AES/AES128/ in diagnostics and --list-config


Modified: trunk/common/ChangeLog
===================================================================
--- trunk/common/ChangeLog	2010-12-02 14:10:44 UTC (rev 5492)
+++ trunk/common/ChangeLog	2010-12-02 15:49:02 UTC (rev 5493)
@@ -1,5 +1,8 @@
 2010-12-02  Werner Koch  <wk at g10code.com>
 
+	* miscellaneous.c (gnupg_cipher_algo_name): New.  Replace all
+	users of gcry_cipher_algo_name by this one.
+
 	* logging.c (fun_cookie_s) [W32CE]: Add field USE_WRITEFILE.
 	(fun_writer) [W32CE]: Make use of it.
 	(set_file_fd) [W32CE]: Implement special filename "GPG2:".

Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog	2010-12-02 14:10:44 UTC (rev 5492)
+++ trunk/g10/ChangeLog	2010-12-02 15:49:02 UTC (rev 5493)
@@ -1,3 +1,7 @@
+2010-12-02  Werner Koch  <wk at g10code.com>
+
+	* misc.c (openpgp_cipher_algo_name): Use gnupg_cipher_algo_name.
+
 2010-11-23  Werner Koch  <wk at g10code.com>
 
 	* Makefile.am (gpg2_LDFLAGS, gpgv2_LDFLAGS): Add extra_bin_ldflags.

Modified: trunk/tools/ChangeLog
===================================================================
--- trunk/tools/ChangeLog	2010-12-02 14:10:44 UTC (rev 5492)
+++ trunk/tools/ChangeLog	2010-12-02 15:49:02 UTC (rev 5493)
@@ -1,3 +1,7 @@
+2010-12-02  Werner Koch  <wk at g10code.com>
+
+	* no-libgcrypt.c (gcry_cipher_algo_name): New.
+
 2010-11-23  Werner Koch  <wk at g10code.com>
 
 	* Makefile.am (gpgconf_LDFLAGS): Add extra_bin_ldflags.
@@ -1218,7 +1222,7 @@
 2004-01-10  Werner Koch  <wk at gnupg.org>
 
 	* Makefile.am: Use GPG_ERROR_CFLAGS
-	
+
 2004-01-05  Werner Koch  <wk at gnupg.org>
 
 	* Manifest: New.

Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2010-12-02 14:10:44 UTC (rev 5492)
+++ trunk/NEWS	2010-12-02 15:49:02 UTC (rev 5493)
@@ -7,7 +7,12 @@
  * Fixed a bug where SCdaemon sends a signal to Gpg-agent running in
    non-daemon mode.
 
+ * Print "AES128" instead of "AES".  This change introduces a little
+   incompatibility for tools using "gpg --list-config".  We hope that
+   these tools are written robust enough to accept this new algorithm
+   name as well.
 
+
 Noteworthy changes in version 2.1.0beta1 (2010-10-26)
 -----------------------------------------------------
 

Modified: trunk/agent/cvt-openpgp.c
===================================================================
--- trunk/agent/cvt-openpgp.c	2010-12-02 14:10:44 UTC (rev 5492)
+++ trunk/agent/cvt-openpgp.c	2010-12-02 15:49:02 UTC (rev 5493)
@@ -283,7 +283,7 @@
          the OpenPGP algorithm numbers map one-to-one to the Libgcrypt
          numbers.  */
       log_info (_("protection algorithm %d (%s) is not supported\n"),
-                protect_algo, gcry_cipher_algo_name (protect_algo));
+                protect_algo, gnupg_cipher_algo_name (protect_algo));
       return gpg_error (GPG_ERR_CIPHER_ALGO);
     }
 

Modified: trunk/common/audit.c
===================================================================
--- trunk/common/audit.c	2010-12-02 14:10:44 UTC (rev 5492)
+++ trunk/common/audit.c	2010-12-02 15:49:02 UTC (rev 5493)
@@ -769,7 +769,7 @@
     {
       algo = gcry_cipher_map_name (item->string);
       if (algo)
-        writeout_rem (ctx, _("algorithm: %s"), gcry_cipher_algo_name (algo));
+        writeout_rem (ctx, _("algorithm: %s"), gnupg_cipher_algo_name (algo));
       else if (item->string && !strcmp (item->string, "1.2.840.113549.3.2"))
         writeout_rem (ctx, _("unsupported algorithm: %s"), "RC2");
       else if (item->string)
@@ -909,14 +909,14 @@
   algo = item? item->intvalue : 0;
   writeout_li (ctx, algo?"Yes":"No", "%s", _("Encryption algorithm supported"));
   if (algo)
-    writeout_rem (ctx, _("algorithm: %s"), gcry_cipher_algo_name (algo));
+    writeout_rem (ctx, _("algorithm: %s"), gnupg_cipher_algo_name (algo));
 
   item = find_log_item (ctx, AUDIT_BAD_DATA_CIPHER_ALGO, 0);
   if (item && item->string)
     {
       algo = gcry_cipher_map_name (item->string);
       if (algo)
-        writeout_rem (ctx, _("algorithm: %s"), gcry_cipher_algo_name (algo));
+        writeout_rem (ctx, _("algorithm: %s"), gnupg_cipher_algo_name (algo));
       else if (item->string && !strcmp (item->string, "1.2.840.113549.3.2"))
         writeout_rem (ctx, _("unsupported algorithm: %s"), "RC2");
       else if (item->string)

Modified: trunk/common/miscellaneous.c
===================================================================
--- trunk/common/miscellaneous.c	2010-12-02 14:10:44 UTC (rev 5492)
+++ trunk/common/miscellaneous.c	2010-12-02 15:49:02 UTC (rev 5493)
@@ -95,7 +95,24 @@
   gcry_set_outofcore_handler (my_gcry_outofcore_handler, NULL);
 }
 
+/* A wrapper around gcry_cipher_algo_name to return the string
+   "AES-128" instead of "AES".  Given that we have an alias in
+   libgcrypt for it, it does not harm to too much to return this other
+   string.  Some users complained that we print "AES" but "AES192"
+   and "AES256".  We can't fix that in libgcrypt but it is pretty
+   safe to do it in an application. */
+const char *
+gnupg_cipher_algo_name (int algo) 
+{
+  const char *s;
 
+  s = gcry_cipher_algo_name (algo);
+  if (!strcmp (s, "AES"))
+    s = "AES128";
+  return s;
+}
+
+
 /* Decide whether the filename is stdout or a real filename and return
  * an appropriate string.  */
 const char *

Modified: trunk/common/util.h
===================================================================
--- trunk/common/util.h	2010-12-02 14:10:44 UTC (rev 5492)
+++ trunk/common/util.h	2010-12-02 15:49:02 UTC (rev 5493)
@@ -255,6 +255,9 @@
 /* This is now an alias to estream_asprintf.  */
 char *xtryasprintf (const char *fmt, ...) JNLIB_GCC_A_PRINTF(1,2);
 
+/* Replacement for gcry_cipher_algo_name.  */
+const char *gnupg_cipher_algo_name (int algo);
+
 const char *print_fname_stdout (const char *s);
 const char *print_fname_stdin (const char *s);
 void print_utf8_buffer2 (estream_t fp, const void *p, size_t n, int delim);

Modified: trunk/g10/misc.c
===================================================================
--- trunk/g10/misc.c	2010-12-02 14:10:44 UTC (rev 5492)
+++ trunk/g10/misc.c	2010-12-02 15:49:02 UTC (rev 5493)
@@ -409,7 +409,7 @@
 const char *
 openpgp_cipher_algo_name (int algo) 
 {
-  return gcry_cipher_algo_name (map_cipher_openpgp_to_gcry (algo));
+  return gnupg_cipher_algo_name (map_cipher_openpgp_to_gcry (algo));
 }
 
 int

Modified: trunk/sm/encrypt.c
===================================================================
--- trunk/sm/encrypt.c	2010-12-02 14:10:44 UTC (rev 5492)
+++ trunk/sm/encrypt.c	2010-12-02 15:49:02 UTC (rev 5493)
@@ -86,7 +86,7 @@
     case GCRY_CIPHER_DES:
     case GCRY_CIPHER_RFC2268_40:
       log_error ("cipher algorithm `%s' not allowed: too weak\n",
-                 gcry_cipher_algo_name (dek->algo));
+                 gnupg_cipher_algo_name (dek->algo));
       return gpg_error (GPG_ERR_UNSUPPORTED_ALGORITHM);
     default:
       break;

Modified: trunk/sm/gpgsm.c
===================================================================
--- trunk/sm/gpgsm.c	2010-12-02 14:10:44 UTC (rev 5492)
+++ trunk/sm/gpgsm.c	2010-12-02 15:49:02 UTC (rev 5493)
@@ -553,7 +553,7 @@
     case 33: p = _("\nSupported algorithms:\n"); break;
     case 34:
       if (!ciphers)
-        ciphers = build_list ("Cipher: ", gcry_cipher_algo_name,
+        ciphers = build_list ("Cipher: ", gnupg_cipher_algo_name,
                               our_cipher_test_algo );
       p = ciphers;
       break;

Modified: trunk/tools/no-libgcrypt.c
===================================================================
--- trunk/tools/no-libgcrypt.c	2010-12-02 14:10:44 UTC (rev 5492)
+++ trunk/tools/no-libgcrypt.c	2010-12-02 15:49:02 UTC (rev 5493)
@@ -152,3 +152,10 @@
   
   log_fatal ("unexpected call to gcry_create_nonce\n");
 }
+
+
+const char *
+gcry_cipher_algo_name (int algo)
+{
+  return "?";
+}





More information about the Gnupg-commits mailing list