diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2021-01-25 21:17:52 +0200 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2021-01-26 19:42:41 +0200 |
commit | 17aad639d29c7c835a7effb89181c7c99b16cb6a (patch) | |
tree | 642d948953a963b3243bc49fe7f99bfc29fd0532 | |
parent | 1e72c50f864ae1c77ba80c191224b9ef1d22a2e2 (diff) | |
download | libgcrypt-17aad639d29c7c835a7effb89181c7c99b16cb6a.tar.gz |
cipher-proto: remove forward typedef of cipher_bulk_ops_t
* cipher/cipher-proto (cipher_bulk_ops_t): Remove typedef, leave
forward declaration of 'struct cipher_bulk_ops'.
(gcry_cipher_setkey_t): Change 'bulk_ops' to
'struct cipher_bulk_ops *'.
* cipher/arcfour.c: Include 'cipher-internal.h'.
* cipher/gost28147.c: Ditto.
* cipher/idea.c: Ditto.
* cipher/rfc2268.c: Ditto.
* cipher/salsa20.c: Ditto.
* cipher/seed.c: Ditto.
* cipher/mac-internal.h (CTX_MAGIC_NORMAL): Rename to...
(CTX_MAC_MAGIC_NORMAL): ... this.
(CTX_MAGIC_SECURE): Rename to...
(CTX_MAC_MAGIC_SECURE): ... this.
* cipher/mac-cmac.c (cmac_open): Use CTX_MAC_MAGIC_SECURE.
* cipher/mac-gmac.c (gmac_open): Ditto.
* cipher/mac-hmac.c (hmac_open): Ditto.
* cipher/mac-poly1305.c (poly1305mac_open): Ditto.
* cipher/mac.c (mac_open): Use CTX_MAC_MAGIC_SECURE and
CTX_MAC_MAGIC_NORMAL.
--
CTX_MAC_MAGIC_* change is needed since gost28147.c now includes
both 'cipher-internal.h' and 'mac-internal.h' which both defined
CTX_MAC_MAGIC_* with different values.
GnuPG-bug-id: 5264
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
-rw-r--r-- | cipher/arcfour.c | 1 | ||||
-rw-r--r-- | cipher/gost28147.c | 1 | ||||
-rw-r--r-- | cipher/idea.c | 1 | ||||
-rw-r--r-- | cipher/mac-cmac.c | 2 | ||||
-rw-r--r-- | cipher/mac-gmac.c | 2 | ||||
-rw-r--r-- | cipher/mac-hmac.c | 2 | ||||
-rw-r--r-- | cipher/mac-internal.h | 4 | ||||
-rw-r--r-- | cipher/mac-poly1305.c | 2 | ||||
-rw-r--r-- | cipher/mac.c | 2 | ||||
-rw-r--r-- | cipher/rfc2268.c | 1 | ||||
-rw-r--r-- | cipher/salsa20.c | 1 | ||||
-rw-r--r-- | cipher/seed.c | 1 | ||||
-rw-r--r-- | src/cipher-proto.h | 4 |
13 files changed, 15 insertions, 9 deletions
diff --git a/cipher/arcfour.c b/cipher/arcfour.c index 9e71857c..353de00b 100644 --- a/cipher/arcfour.c +++ b/cipher/arcfour.c @@ -30,6 +30,7 @@ #include "types.h" #include "g10lib.h" #include "cipher.h" +#include "cipher-internal.h" /* USE_AMD64_ASM indicates whether to use AMD64 assembly code. */ #undef USE_AMD64_ASM diff --git a/cipher/gost28147.c b/cipher/gost28147.c index 1bafe317..9445b378 100644 --- a/cipher/gost28147.c +++ b/cipher/gost28147.c @@ -35,6 +35,7 @@ #include "cipher.h" #include "mac-internal.h" #include "bufhelp.h" +#include "cipher-internal.h" #include "gost.h" #include "gost-sb.h" diff --git a/cipher/idea.c b/cipher/idea.c index a503c08f..0a810818 100644 --- a/cipher/idea.c +++ b/cipher/idea.c @@ -48,6 +48,7 @@ #include "types.h" /* for byte and u32 typedefs */ #include "g10lib.h" #include "cipher.h" +#include "cipher-internal.h" #define IDEA_KEYSIZE 16 diff --git a/cipher/mac-cmac.c b/cipher/mac-cmac.c index d4760bc2..8d5d5ca3 100644 --- a/cipher/mac-cmac.c +++ b/cipher/mac-cmac.c @@ -69,7 +69,7 @@ cmac_open (gcry_mac_hd_t h) { gcry_err_code_t err; gcry_cipher_hd_t hd; - int secure = (h->magic == CTX_MAGIC_SECURE); + int secure = (h->magic == CTX_MAC_MAGIC_SECURE); int cipher_algo; unsigned int flags; diff --git a/cipher/mac-gmac.c b/cipher/mac-gmac.c index b9805eea..e04c6d1e 100644 --- a/cipher/mac-gmac.c +++ b/cipher/mac-gmac.c @@ -54,7 +54,7 @@ gmac_open (gcry_mac_hd_t h) { gcry_err_code_t err; gcry_cipher_hd_t hd; - int secure = (h->magic == CTX_MAGIC_SECURE); + int secure = (h->magic == CTX_MAC_MAGIC_SECURE); int cipher_algo; unsigned int flags; diff --git a/cipher/mac-hmac.c b/cipher/mac-hmac.c index e38a74c9..4e10dd2c 100644 --- a/cipher/mac-hmac.c +++ b/cipher/mac-hmac.c @@ -107,7 +107,7 @@ hmac_open (gcry_mac_hd_t h) { gcry_err_code_t err; gcry_md_hd_t hd; - int secure = (h->magic == CTX_MAGIC_SECURE); + int secure = (h->magic == CTX_MAC_MAGIC_SECURE); unsigned int flags; int md_algo; diff --git a/cipher/mac-internal.h b/cipher/mac-internal.h index d907a46f..e49885be 100644 --- a/cipher/mac-internal.h +++ b/cipher/mac-internal.h @@ -39,8 +39,8 @@ struct poly1305mac_context_s; /* Magic values for the context structure. */ -#define CTX_MAGIC_NORMAL 0x59d9b8af -#define CTX_MAGIC_SECURE 0x12c27cd0 +#define CTX_MAC_MAGIC_NORMAL 0x59d9b8af +#define CTX_MAC_MAGIC_SECURE 0x12c27cd0 /* MAC module functions. */ diff --git a/cipher/mac-poly1305.c b/cipher/mac-poly1305.c index d27a31c6..46ea735f 100644 --- a/cipher/mac-poly1305.c +++ b/cipher/mac-poly1305.c @@ -45,7 +45,7 @@ static gcry_err_code_t poly1305mac_open (gcry_mac_hd_t h) { struct poly1305mac_context_s *mac_ctx; - int secure = (h->magic == CTX_MAGIC_SECURE); + int secure = (h->magic == CTX_MAC_MAGIC_SECURE); unsigned int flags = (secure ? GCRY_CIPHER_SECURE : 0); gcry_err_code_t err; int cipher_algo; diff --git a/cipher/mac.c b/cipher/mac.c index e274b356..babe99e3 100644 --- a/cipher/mac.c +++ b/cipher/mac.c @@ -517,7 +517,7 @@ mac_open (gcry_mac_hd_t * hd, int algo, int secure, gcry_ctx_t ctx) if (!h) return gpg_err_code_from_syserror (); - h->magic = secure ? CTX_MAGIC_SECURE : CTX_MAGIC_NORMAL; + h->magic = secure ? CTX_MAC_MAGIC_SECURE : CTX_MAC_MAGIC_NORMAL; h->spec = spec; h->algo = algo; h->gcry_ctx = ctx; diff --git a/cipher/rfc2268.c b/cipher/rfc2268.c index 348c4d41..f018b640 100644 --- a/cipher/rfc2268.c +++ b/cipher/rfc2268.c @@ -35,6 +35,7 @@ #include "g10lib.h" #include "types.h" #include "cipher.h" +#include "cipher-internal.h" #define RFC2268_BLOCKSIZE 8 diff --git a/cipher/salsa20.c b/cipher/salsa20.c index 58e2dc6f..d8c5c81f 100644 --- a/cipher/salsa20.c +++ b/cipher/salsa20.c @@ -39,6 +39,7 @@ #include "g10lib.h" #include "cipher.h" #include "bufhelp.h" +#include "cipher-internal.h" /* USE_AMD64 indicates whether to compile with AMD64 code. */ diff --git a/cipher/seed.c b/cipher/seed.c index c8ae4a01..2c8958fa 100644 --- a/cipher/seed.c +++ b/cipher/seed.c @@ -30,6 +30,7 @@ #include "g10lib.h" #include "cipher.h" #include "bufhelp.h" +#include "cipher-internal.h" #define NUMKC 16 diff --git a/src/cipher-proto.h b/src/cipher-proto.h index bb16d48d..f9fbb553 100644 --- a/src/cipher-proto.h +++ b/src/cipher-proto.h @@ -129,13 +129,13 @@ typedef struct gcry_pk_spec * */ -typedef struct cipher_bulk_ops cipher_bulk_ops_t; +struct cipher_bulk_ops; /* Type for the cipher_setkey function. */ typedef gcry_err_code_t (*gcry_cipher_setkey_t) (void *c, const unsigned char *key, unsigned keylen, - cipher_bulk_ops_t *bulk_ops); + struct cipher_bulk_ops *bulk_ops); /* Type for the cipher_encrypt function. */ typedef unsigned int (*gcry_cipher_encrypt_t) (void *c, |