diff options
-rw-r--r-- | configure.ac | 11 | ||||
-rw-r--r-- | src/Makefile.am | 3 | ||||
-rw-r--r-- | src/cipher.h | 2 | ||||
-rw-r--r-- | src/gcrypt-int.h | 40 | ||||
-rw-r--r-- | src/visibility.h | 4 | ||||
-rw-r--r-- | tests/aeswrap.c | 2 | ||||
-rw-r--r-- | tests/basic.c | 2 | ||||
-rw-r--r-- | tests/benchmark.c | 2 | ||||
-rw-r--r-- | tests/curves.c | 2 | ||||
-rw-r--r-- | tests/fips186-dsa.c | 2 | ||||
-rw-r--r-- | tests/fipsdrv.c | 2 | ||||
-rw-r--r-- | tests/hmac.c | 2 | ||||
-rw-r--r-- | tests/keygen.c | 2 | ||||
-rw-r--r-- | tests/keygrip.c | 2 | ||||
-rw-r--r-- | tests/mpitests.c | 2 | ||||
-rw-r--r-- | tests/pkcs1v2.c | 2 | ||||
-rw-r--r-- | tests/prime.c | 2 | ||||
-rw-r--r-- | tests/pubkey.c | 2 | ||||
-rw-r--r-- | tests/random.c | 2 | ||||
-rw-r--r-- | tests/rsacvt.c | 2 | ||||
-rw-r--r-- | tests/t-kdf.c | 2 | ||||
-rw-r--r-- | tests/t-mpi-bit.c | 2 | ||||
-rw-r--r-- | tests/t-mpi-point.c | 2 | ||||
-rw-r--r-- | tests/tsexp.c | 2 | ||||
-rw-r--r-- | tests/version.c | 2 |
25 files changed, 67 insertions, 33 deletions
diff --git a/configure.ac b/configure.ac index d9b16392..13541bbc 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 22263d9e..8eb46e6e 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 80c88392..26206135 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 00000000..33969fe0 --- /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 6887f37b..4837ed65 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 bb52fc90..16b576d3 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 c92750cd..d1b4002a 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 61badd5d..c4b52589 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 6cfcd4f4..664e8753 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 401acff0..10b18abb 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 2d4c3624..eef2ddd1 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@example.org" diff --git a/tests/hmac.c b/tests/hmac.c index 292a2fa3..5d695ea0 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 05593c39..1d1b43ea 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 a496ca2c..a89bba87 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 3b75ea79..5643c1be 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 bb062924..20f1b642 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 5d928bdb..6e825aeb 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 45341750..ffaecb37 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 a46d754d..ccaa3f92 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 014cd2a3..6fb5c76f 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@example.org" diff --git a/tests/t-kdf.c b/tests/t-kdf.c index 50deba08..adbe6cc0 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 85bd32e9..b1c999e4 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 98236e78..2631a113 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 73d3d6ed..cef3ed13 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 af3c4c38..1332c7c7 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" |