summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-04-15 09:40:22 +0200
committerRichard Levitte <levitte@openssl.org>2019-04-15 10:46:09 +0200
commitf2dbb71cb6bf6cd570f96e7663a22dd87854f08b (patch)
treee5fbcc1f07c18382449000fba3bb28cfcc86f115
parent0ad50b4dee36d4b576473ccbf744284d66fbffd6 (diff)
providers/common/digests/sha2.c: forward declare all dispatched functions
Forward declare the dispatched functions using typedefs from core_numbers.h. This will ensure that they have correct signatures. Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/8747)
-rw-r--r--providers/common/digests/sha2.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/providers/common/digests/sha2.c b/providers/common/digests/sha2.c
index fb2bd95f52..3698046f20 100644
--- a/providers/common/digests/sha2.c
+++ b/providers/common/digests/sha2.c
@@ -11,6 +11,22 @@
#include <openssl/crypto.h>
#include <openssl/core_numbers.h>
+/*
+ * Forward declaration of everything implemented here. This is not strictly
+ * necessary for the compiler, but provides an assurance that the signatures
+ * of the functions in the dispatch table are correct.
+ */
+static OSSL_OP_digest_newctx_fn sha256_newctx;
+#if 0 /* Not defined here */
+static OSSL_OP_digest_init_fn sha256_init;
+static OSSL_OP_digest_update_fn sha256_update;
+#endif
+static OSSL_OP_digest_final_fn sha256_final;
+static OSSL_OP_digest_freectx_fn sha256_freectx;
+static OSSL_OP_digest_dupctx_fn sha256_dupctx;
+static OSSL_OP_digest_size_fn sha256_size;
+static OSSL_OP_digest_block_size_fn sha256_size;
+
static int sha256_final(void *ctx,
unsigned char *md, size_t *mdl, size_t mdsz)
{