[git] GCRYPT - branch, master, updated. libgcrypt-1.5.0-154-g6540b84

by Werner Koch cvs at cvs.gnupg.org
Wed Jun 26 11:39:41 CEST 2013


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  6540b84a6e9113813e7e49e3ad2024d4a0073300 (commit)
      from  3544fa8aa63bef9a35abf236e9376191b5ec206b (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 6540b84a6e9113813e7e49e3ad2024d4a0073300
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Jun 26 11:09:42 2013 +0200

    Make gpg-error replacement defines more robust.
    
    * configure.ac (AH_BOTTOM): Move GPG_ERR_ replacement defines to ...
    * src/gcrypt-int.h: new file.
    * src/visibility.h, src/cipher.h: Replace gcrypt.h by gcrypt-int.h.
    * tests/: Ditto for all test files.
    --
    
    Defining newer gpg-error codes in config.h was not a good idea,
    because config.h is usually included before gpg-error.h and thus
    gpg-error.h would be double defines to lead to faulty code there like
    
      typedef enum
        {
          [...]
          191 = 191,
          [...]
        };

diff --git a/configure.ac b/configure.ac
index d9b1639..13541bb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,6 +65,8 @@ LIBGCRYPT_LT_REVISION=0
 # If the API is changed in an incompatible way: increment the next counter.
 LIBGCRYPT_CONFIG_API_VERSION=1
 
+# If you change the required gpg-error version, please remove
+# unnecessary error code defines in src/gcrypt-int.h.
 NEED_GPG_ERROR_VERSION=1.11
 
 PACKAGE=$PACKAGE_NAME
@@ -105,15 +107,6 @@ AH_BOTTOM([
    properly prefixed.  */
 #define CAMELLIA_EXT_SYM_PREFIX _gcry_
 
-/* These error codes are used but not defined in the required
-   libgpg-error 1.11.  Define them here. */
-#define GPG_ERR_NO_CRYPT_CTX	   191
-#define GPG_ERR_WRONG_CRYPT_CTX    192
-#define GPG_ERR_BAD_CRYPT_CTX	   193
-#define GPG_ERR_CRYPT_CTX_CONFLICT 194
-#define GPG_ERR_BROKEN_PUBKEY      195
-#define GPG_ERR_BROKEN_SECKEY      196
-
 #endif /*_GCRYPT_CONFIG_H_INCLUDED*/
 ])
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 22263d9..8eb46e6 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -54,7 +54,8 @@ else
 endif
 
 libgcrypt_la_CFLAGS = $(GPG_ERROR_CFLAGS)
-libgcrypt_la_SOURCES = g10lib.h visibility.c visibility.h types.h \
+libgcrypt_la_SOURCES = \
+        gcrypt-int.h g10lib.h visibility.c visibility.h types.h \
 	cipher.h cipher-proto.h gcrypt-module.h \
 	misc.c global.c sexp.c hwfeatures.c hwf-common.h \
 	stdmem.c stdmem.h secmem.c secmem.h \
diff --git a/src/cipher.h b/src/cipher.h
index 80c8839..2620613 100644
--- a/src/cipher.h
+++ b/src/cipher.h
@@ -20,7 +20,7 @@
 #ifndef G10_CIPHER_H
 #define G10_CIPHER_H
 
-#include <gcrypt.h>
+#include "gcrypt-int.h"
 
 #define DBG_CIPHER _gcry_get_debug_flag( 1 )
 
diff --git a/src/gcrypt-int.h b/src/gcrypt-int.h
new file mode 100644
index 0000000..33969fe
--- /dev/null
+++ b/src/gcrypt-int.h
@@ -0,0 +1,40 @@
+/* gcrypt-int.h - Internal version of gcrypt.h
+ * Copyright (C) 2013 g10 Code GmbH
+ *
+ * This file is part of Libgcrypt.
+ *
+ * Libgcrypt is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * Libgcrypt is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GCRY_GCRYPT_INT_H
+#define GCRY_GCRYPT_INT_H
+
+#ifdef _GCRYPT_H
+#error  gcrypt.h already included
+#endif
+
+#include "gcrypt.h"
+
+/* These error codes are used but not defined in the required
+   libgpg-error 1.11.  Define them here. */
+#ifndef GPG_ERR_NO_CRYPT_CTX
+# define GPG_ERR_NO_CRYPT_CTX	    191
+# define GPG_ERR_WRONG_CRYPT_CTX    192
+# define GPG_ERR_BAD_CRYPT_CTX	    193
+# define GPG_ERR_CRYPT_CTX_CONFLICT 194
+# define GPG_ERR_BROKEN_PUBKEY      195
+# define GPG_ERR_BROKEN_SECKEY      196
+#endif
+
+#endif /*GCRY_GCRYPT_INT_H*/
diff --git a/src/visibility.h b/src/visibility.h
index 6887f37..4837ed6 100644
--- a/src/visibility.h
+++ b/src/visibility.h
@@ -201,10 +201,10 @@
   /* We need to redeclare the deprecated functions without the
      deprecated attribute.  */
 # define GCRYPT_NO_DEPRECATED
-# include "gcrypt.h"
+# include "gcrypt-int.h"
   /* None in this version.  */
 #else
-# include "gcrypt.h"
+# include "gcrypt-int.h"
 #endif
 #include "gcrypt-module.h"
 
diff --git a/tests/aeswrap.c b/tests/aeswrap.c
index bb52fc9..16b576d 100644
--- a/tests/aeswrap.c
+++ b/tests/aeswrap.c
@@ -26,7 +26,7 @@
 #include <string.h>
 #include <stdarg.h>
 
-#include "../src/gcrypt.h"
+#include "../src/gcrypt-int.h"
 
 static int verbose;
 static int error_count;
diff --git a/tests/basic.c b/tests/basic.c
index c92750c..d1b4002 100644
--- a/tests/basic.c
+++ b/tests/basic.c
@@ -27,7 +27,7 @@
 #include <stdarg.h>
 #include <assert.h>
 
-#include "../src/gcrypt.h"
+#include "../src/gcrypt-int.h"
 
 #ifndef DIM
 # define DIM(v)		     (sizeof(v)/sizeof((v)[0]))
diff --git a/tests/benchmark.c b/tests/benchmark.c
index 61badd5..c4b5258 100644
--- a/tests/benchmark.c
+++ b/tests/benchmark.c
@@ -31,7 +31,7 @@
 #endif
 
 #ifdef _GCRYPT_IN_LIBGCRYPT
-# include "../src/gcrypt.h"
+# include "../src/gcrypt-int.h"
 # include "../compat/libcompat.h"
 #else
 # include <gcrypt.h>
diff --git a/tests/curves.c b/tests/curves.c
index 6cfcd4f..664e875 100644
--- a/tests/curves.c
+++ b/tests/curves.c
@@ -26,7 +26,7 @@
 #include <string.h>
 #include <stdarg.h>
 
-#include "../src/gcrypt.h"
+#include "../src/gcrypt-int.h"
 
 /* Number of curves defined in ../cipger/ecc.c */
 #define N_CURVES 12
diff --git a/tests/fips186-dsa.c b/tests/fips186-dsa.c
index 401acff..10b18ab 100644
--- a/tests/fips186-dsa.c
+++ b/tests/fips186-dsa.c
@@ -26,7 +26,7 @@
 #include <stdarg.h>
 
 #ifdef _GCRYPT_IN_LIBGCRYPT
-# include "../src/gcrypt.h"
+# include "../src/gcrypt-int.h"
 #else
 # include <gcrypt.h>
 #endif
diff --git a/tests/fipsdrv.c b/tests/fipsdrv.c
index 2d4c362..eef2ddd 100644
--- a/tests/fipsdrv.c
+++ b/tests/fipsdrv.c
@@ -35,7 +35,7 @@
 #include <unistd.h>
 
 #ifdef _GCRYPT_IN_LIBGCRYPT
-# include "../src/gcrypt.h"
+# include "../src/gcrypt-int.h"
 #else
 # include <gcrypt.h>
 # define PACKAGE_BUGREPORT "devnull at example.org"
diff --git a/tests/hmac.c b/tests/hmac.c
index 292a2fa..5d695ea 100644
--- a/tests/hmac.c
+++ b/tests/hmac.c
@@ -26,7 +26,7 @@
 #include <string.h>
 #include <stdarg.h>
 
-#include "../src/gcrypt.h"
+#include "../src/gcrypt-int.h"
 
 static int verbose;
 static int error_count;
diff --git a/tests/keygen.c b/tests/keygen.c
index 05593c3..1d1b43e 100644
--- a/tests/keygen.c
+++ b/tests/keygen.c
@@ -25,7 +25,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdarg.h>
-#include "../src/gcrypt.h"
+#include "../src/gcrypt-int.h"
 
 
 
diff --git a/tests/keygrip.c b/tests/keygrip.c
index a496ca2..a89bba8 100644
--- a/tests/keygrip.c
+++ b/tests/keygrip.c
@@ -28,7 +28,7 @@
 #include <stdarg.h>
 #include <assert.h>
 
-#include "../src/gcrypt.h"
+#include "../src/gcrypt-int.h"
 
 static int verbose;
 static int repetitions;
diff --git a/tests/mpitests.c b/tests/mpitests.c
index 3b75ea7..5643c1b 100644
--- a/tests/mpitests.c
+++ b/tests/mpitests.c
@@ -28,7 +28,7 @@
 #include <stdarg.h>
 
 #ifdef _GCRYPT_IN_LIBGCRYPT
-# include "../src/gcrypt.h"
+# include "../src/gcrypt-int.h"
 #else
 # include <gcrypt.h>
 #endif
diff --git a/tests/pkcs1v2.c b/tests/pkcs1v2.c
index bb06292..20f1b64 100644
--- a/tests/pkcs1v2.c
+++ b/tests/pkcs1v2.c
@@ -26,7 +26,7 @@
 #include <stdarg.h>
 
 #ifdef _GCRYPT_IN_LIBGCRYPT
-# include "../src/gcrypt.h"
+# include "../src/gcrypt-int.h"
 #else
 # include <gcrypt.h>
 #endif
diff --git a/tests/prime.c b/tests/prime.c
index 5d928bd..6e825ae 100644
--- a/tests/prime.c
+++ b/tests/prime.c
@@ -24,7 +24,7 @@
 #include <string.h>
 #include <stdlib.h>
 
-#include "../src/gcrypt.h"
+#include "../src/gcrypt-int.h"
 
 static int verbose;
 
diff --git a/tests/pubkey.c b/tests/pubkey.c
index 4534175..ffaecb3 100644
--- a/tests/pubkey.c
+++ b/tests/pubkey.c
@@ -26,7 +26,7 @@
 #include <string.h>
 
 
-#include "../src/gcrypt.h"
+#include "../src/gcrypt-int.h"
 
 /* Sample RSA keys, taken from basic.c.  */
 
diff --git a/tests/random.c b/tests/random.c
index a46d754..ccaa3f9 100644
--- a/tests/random.c
+++ b/tests/random.c
@@ -30,7 +30,7 @@
 # include <sys/wait.h>
 #endif
 
-#include "../src/gcrypt.h"
+#include "../src/gcrypt-int.h"
 
 #define PGM "random"
 
diff --git a/tests/rsacvt.c b/tests/rsacvt.c
index 014cd2a..6fb5c76 100644
--- a/tests/rsacvt.c
+++ b/tests/rsacvt.c
@@ -52,7 +52,7 @@ e7a7ca5367c661f8e6[...]71
 #include <unistd.h>
 
 #ifdef _GCRYPT_IN_LIBGCRYPT
-# include "../src/gcrypt.h"
+# include "../src/gcrypt-int.h"
 #else
 # include <gcrypt.h>
 # define PACKAGE_BUGREPORT "devnull at example.org"
diff --git a/tests/t-kdf.c b/tests/t-kdf.c
index 50deba0..adbe6cc 100644
--- a/tests/t-kdf.c
+++ b/tests/t-kdf.c
@@ -27,7 +27,7 @@
 #include <stdarg.h>
 #include <assert.h>
 
-#include "../src/gcrypt.h"
+#include "../src/gcrypt-int.h"
 
 #ifndef DIM
 # define DIM(v)		     (sizeof(v)/sizeof((v)[0]))
diff --git a/tests/t-mpi-bit.c b/tests/t-mpi-bit.c
index 85bd32e..b1c999e 100644
--- a/tests/t-mpi-bit.c
+++ b/tests/t-mpi-bit.c
@@ -28,7 +28,7 @@
 #include <assert.h>
 #include <stdarg.h>
 
-#include "../src/gcrypt.h"
+#include "../src/gcrypt-int.h"
 
 #define PGM "t-mpi-bit"
 
diff --git a/tests/t-mpi-point.c b/tests/t-mpi-point.c
index 98236e7..2631a11 100644
--- a/tests/t-mpi-point.c
+++ b/tests/t-mpi-point.c
@@ -26,7 +26,7 @@
 #include <assert.h>
 #include <stdarg.h>
 
-#include "../src/gcrypt.h"
+#include "../src/gcrypt-int.h"
 
 #define PGM "t-mpi-point"
 
diff --git a/tests/tsexp.c b/tests/tsexp.c
index 73d3d6e..cef3ed1 100644
--- a/tests/tsexp.c
+++ b/tests/tsexp.c
@@ -25,7 +25,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdarg.h>
-#include "../src/gcrypt.h"
+#include "../src/gcrypt-int.h"
 
 #define PGMNAME "tsexp"
 
diff --git a/tests/version.c b/tests/version.c
index af3c4c3..1332c7c 100644
--- a/tests/version.c
+++ b/tests/version.c
@@ -33,7 +33,7 @@
 #include <string.h>
 #include <stdarg.h>
 
-#include "../src/gcrypt.h"
+#include "../src/gcrypt-int.h"
 
 #define PGM "version"
 

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

Summary of changes:
 configure.ac                             |   11 +--------
 src/Makefile.am                          |    3 +-
 src/cipher.h                             |    2 +-
 cipher/hash-common.h => src/gcrypt-int.h |   31 ++++++++++++++++++-----------
 src/visibility.h                         |    4 +-
 tests/aeswrap.c                          |    2 +-
 tests/basic.c                            |    2 +-
 tests/benchmark.c                        |    2 +-
 tests/curves.c                           |    2 +-
 tests/fips186-dsa.c                      |    2 +-
 tests/fipsdrv.c                          |    2 +-
 tests/hmac.c                             |    2 +-
 tests/keygen.c                           |    2 +-
 tests/keygrip.c                          |    2 +-
 tests/mpitests.c                         |    2 +-
 tests/pkcs1v2.c                          |    2 +-
 tests/prime.c                            |    2 +-
 tests/pubkey.c                           |    2 +-
 tests/random.c                           |    2 +-
 tests/rsacvt.c                           |    2 +-
 tests/t-kdf.c                            |    2 +-
 tests/t-mpi-bit.c                        |    2 +-
 tests/t-mpi-point.c                      |    2 +-
 tests/tsexp.c                            |    2 +-
 tests/version.c                          |    2 +-
 25 files changed, 46 insertions(+), 45 deletions(-)
 copy cipher/hash-common.h => src/gcrypt-int.h (53%)


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




More information about the Gnupg-commits mailing list