diff options
author | Richard Levitte <levitte@openssl.org> | 2022-04-28 08:15:53 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2022-07-13 07:59:55 +0200 |
commit | 372f4b80e35954d19ffb255692bdd6e4807e5f7a (patch) | |
tree | 61dd8212aa1dfda056ae3ba46c0f3eaaa94a2983 /include | |
parent | 8d222dd9ec5f1542035b55395c7d7a4b42d618b0 (diff) |
Pre-declare all core dispatch table functions, and fix the internal ones
When assigning pointers to functions in an OSSL_DISPATCH table, we try
to ensure that those functions are properly defined or declared with
an extra declaration using the corresponding function typedefs that
are defined by include/openssl/core_dispatch.h.
For the core dispatch table, found in crypto/provider_core.c, it seems
we forgot this habit, and thus didn't ensure well enough that the
function pointers that are assigned in the table can actually be used
for those dispatch table indexes.
This change adds all the missing declarations, and compensates for
differences with functions that do the necessary casting, making those
explicit rather than implicit, thereby trying to assure that we know
what we're doing.
One function is not fixed in this change, because there's a controversy,
a clash between the signature of BIO_ctrl() and OSSL_FUNC_BIO_ctrl_fn.
They have different return types.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18198)
(cherry picked from commit 9574842e90e29015daa2b071e965cec9aa885c17)
Diffstat (limited to 'include')
-rw-r--r-- | include/crypto/rand.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/crypto/rand.h b/include/crypto/rand.h index fa3b5b2b93..758aeed4af 100644 --- a/include/crypto/rand.h +++ b/include/crypto/rand.h @@ -108,15 +108,15 @@ void ossl_random_add_conf_module(void); /* * Get and cleanup random seed material. */ -size_t ossl_rand_get_entropy(ossl_unused OSSL_CORE_HANDLE *handle, +size_t ossl_rand_get_entropy(ossl_unused const OSSL_CORE_HANDLE *handle, unsigned char **pout, int entropy, size_t min_len, size_t max_len); -void ossl_rand_cleanup_entropy(ossl_unused OSSL_CORE_HANDLE *handle, +void ossl_rand_cleanup_entropy(ossl_unused const OSSL_CORE_HANDLE *handle, unsigned char *buf, size_t len); -size_t ossl_rand_get_nonce(ossl_unused OSSL_CORE_HANDLE *handle, +size_t ossl_rand_get_nonce(ossl_unused const OSSL_CORE_HANDLE *handle, unsigned char **pout, size_t min_len, size_t max_len, const void *salt, size_t salt_len); -void ossl_rand_cleanup_nonce(ossl_unused OSSL_CORE_HANDLE *handle, +void ossl_rand_cleanup_nonce(ossl_unused const OSSL_CORE_HANDLE *handle, unsigned char *buf, size_t len); /* |