[git] GCRYPT - branch, master, updated. libgcrypt-1.7.3-49-g98b4969

by Werner Koch cvs at cvs.gnupg.org
Tue Jan 3 16:39:05 CET 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU crypto library".

The branch, master has been updated
       via  98b49695b1ffe3c406ae39a45051b8594f903b9d (commit)
       via  3582641469f1c74078f0d758c4d5458cc0ee5649 (commit)
      from  0996d5f1c34a3d3012facd098a139d8abbde085f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 98b49695b1ffe3c406ae39a45051b8594f903b9d
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Jan 3 16:30:54 2017 +0100

    Extend GCRYCTL_PRINT_CONFIG to print compiler version.
    
    * src/global.c (print_config): Print version of libgpg-error and used
    compiler.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/NEWS b/NEWS
index ef882b7..179b18d 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,11 @@ Noteworthy changes in version 1.8.0 (unreleased)  [C21/A1/R_]
 
    - GCRYCTL_REINIT_SYSCALL_CLAMP allows to init nPth after Libgcrypt.
 
+ * Extended interfaces:
+
+   - GCRYCTL_PRINT_CONFIG does now also print build information for
+     libgpg-error and the used compiler version.
+
  * Internal changes:
 
    - Libgpg-error 1.25 is now required.  This avoids stalling of nPth
diff --git a/src/global.c b/src/global.c
index cfb7618..25815dd 100644
--- a/src/global.c
+++ b/src/global.c
@@ -279,7 +279,25 @@ print_config ( int (*fnc)(FILE *fp, const char *format, ...), FILE *fp)
   int i;
   const char *s;
 
-  fnc (fp, "version:%s:\n", VERSION);
+  fnc (fp, "version:%s:%x:%s:%x:\n",
+       VERSION, GCRYPT_VERSION_NUMBER,
+       GPGRT_VERSION, GPGRT_VERSION_NUMBER);
+  fnc (fp, "cc:%d:%s:\n",
+#if GPGRT_VERSION_NUMBER >= 0x011b00 /* 1.27 */
+       GPGRT_GCC_VERSION
+#else
+       _GPG_ERR_GCC_VERSION /* Due to a bug in gpg-error.h.  */
+#endif
+       ,
+#ifdef __clang__
+       "clang:" __VERSION__
+#elif __GNUC__
+       "gcc:" __VERSION__
+#else
+       ":"
+#endif
+       );
+
   fnc (fp, "ciphers:%s:\n", LIBGCRYPT_CIPHERS);
   fnc (fp, "pubkeys:%s:\n", LIBGCRYPT_PUBKEY_CIPHERS);
   fnc (fp, "digests:%s:\n", LIBGCRYPT_DIGESTS);

commit 3582641469f1c74078f0d758c4d5458cc0ee5649
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Jan 3 15:34:33 2017 +0100

    tests: Add option --disable-hwf to the version utility.
    
    * src/hwfeatures.c (_gcry_disable_hw_feature): Rewrite to allow
    passing a colon delimited feature set.
    (parse_hwf_deny_file): Remove unused var I.
    * tests/version.c (main): Add options --verbose and --disable-hwf.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/doc/gcrypt.texi b/doc/gcrypt.texi
index cb539da..47ac19e 100644
--- a/doc/gcrypt.texi
+++ b/doc/gcrypt.texi
@@ -906,10 +906,14 @@ success or an error code on failure.
 Libgcrypt detects certain features of the CPU at startup time.  For
 performance tests it is sometimes required not to use such a feature.
 This option may be used to disable a certain feature; i.e. Libgcrypt
-behaves as if this feature has not been detected.  Note that the
-detection code might be run if the feature has been disabled.  This
-command must be used at initialization time; i.e. before calling
- at code{gcry_check_version}.
+behaves as if this feature has not been detected.  This call can be
+used several times to disable a set of features, or features may be
+given as a colon or comma delimited string.  The special feature
+"all" can be used to disable all available features.
+
+Note that the detection code might be run if the feature has been
+disabled.  This command must be used at initialization time;
+i.e. before calling @code{gcry_check_version}.
 
 @item GCRYCTL_REINIT_SYSCALL_CLAMP; Arguments: none
 
diff --git a/src/hwfeatures.c b/src/hwfeatures.c
index 99aba34..82f8bf2 100644
--- a/src/hwfeatures.c
+++ b/src/hwfeatures.c
@@ -82,20 +82,34 @@ gpg_err_code_t
 _gcry_disable_hw_feature (const char *name)
 {
   int i;
+  size_t n1, n2;
 
-  if (!strcmp(name, "all"))
+  while (name && *name)
     {
-      disabled_hw_features = ~0;
-      return 0;
+      n1 = strcspn (name, ":,");
+      if (!n1)
+        ;
+      else if (n1 == 3 && !strncmp (name, "all", 3))
+        disabled_hw_features = ~0;
+      else
+        {
+          for (i=0; i < DIM (hwflist); i++)
+            {
+              n2 = strlen (hwflist[i].desc);
+              if (n1 == n2 && !strncmp (hwflist[i].desc, name, n2))
+                {
+                  disabled_hw_features |= hwflist[i].flag;
+                  break;
+                }
+            }
+          if (!(i < DIM (hwflist)))
+            return GPG_ERR_INV_NAME;
+        }
+      name += n1;
+      if (*name)
+        name++; /* Skip delimiter ':' or ','.  */
     }
-
-  for (i=0; i < DIM (hwflist); i++)
-    if (!strcmp (hwflist[i].desc, name))
-      {
-        disabled_hw_features |= hwflist[i].flag;
-        return 0;
-      }
-  return GPG_ERR_INV_NAME;
+  return 0;
 }
 
 
@@ -131,7 +145,7 @@ parse_hwf_deny_file (void)
   FILE *fp;
   char buffer[256];
   char *p, *pend;
-  int i, lnr = 0;
+  int lnr = 0;
 
   fp = fopen (fname, "r");
   if (!fp)
diff --git a/tests/version.c b/tests/version.c
index f22c305..baf984e 100644
--- a/tests/version.c
+++ b/tests/version.c
@@ -42,8 +42,47 @@
 int
 main (int argc, char **argv)
 {
-  (void)argc;
-  (void)argv;
+  int last_argc = -1;
+
+  if (argc)
+    { argc--; argv++; }
+
+  while (argc && last_argc != argc )
+    {
+      last_argc = argc;
+      if (!strcmp (*argv, "--"))
+        {
+          argc--; argv++;
+          break;
+        }
+      else if (!strcmp (*argv, "--verbose"))
+        {
+          verbose++;
+          argc--; argv++;
+        }
+      else if (!strcmp (*argv, "--debug"))
+        {
+          /* Dummy option */
+          argc--; argv++;
+        }
+      else if (!strcmp (*argv, "--disable-hwf"))
+        {
+          argc--;
+          argv++;
+          if (argc)
+            {
+              if (gcry_control (GCRYCTL_DISABLE_HWF, *argv, NULL))
+                fprintf (stderr,
+                        PGM
+                        ": unknown hardware feature '%s' - option ignored\n",
+                        *argv);
+              argc--;
+              argv++;
+            }
+        }
+    }
+
+  xgcry_control (GCRYCTL_SET_VERBOSITY, (int)verbose);
 
   xgcry_control (GCRYCTL_DISABLE_SECMEM, 0);
   if (strcmp (GCRYPT_VERSION, gcry_check_version (NULL)))

-----------------------------------------------------------------------

Summary of changes:
 NEWS             |  5 +++++
 doc/gcrypt.texi  | 12 ++++++++----
 src/global.c     | 20 +++++++++++++++++++-
 src/hwfeatures.c | 38 ++++++++++++++++++++++++++------------
 tests/version.c  | 43 +++++++++++++++++++++++++++++++++++++++++--
 5 files changed, 99 insertions(+), 19 deletions(-)


hooks/post-receive
-- 
The GNU crypto library
http://git.gnupg.org


_______________________________________________
Gnupg-commits mailing list
Gnupg-commits at gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-commits




More information about the Gcrypt-devel mailing list