summaryrefslogtreecommitdiffstats
path: root/crypto/evp/kem.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/evp/kem.c')
-rw-r--r--crypto/evp/kem.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/crypto/evp/kem.c b/crypto/evp/kem.c
index f96012ccf0..6cb7ea8a8e 100644
--- a/crypto/evp/kem.c
+++ b/crypto/evp/kem.c
@@ -17,6 +17,16 @@
#include "crypto/evp.h"
#include "evp_local.h"
+static void evp_kem_free(void *data)
+{
+ EVP_KEM_free(data);
+}
+
+static int evp_kem_up_ref(void *data)
+{
+ return EVP_KEM_up_ref(data);
+}
+
static int evp_kem_init(EVP_PKEY_CTX *ctx, int operation,
const OSSL_PARAM params[], EVP_PKEY *authkey)
{
@@ -452,8 +462,8 @@ EVP_KEM *EVP_KEM_fetch(OSSL_LIB_CTX *ctx, const char *algorithm,
{
return evp_generic_fetch(ctx, OSSL_OP_KEM, algorithm, properties,
evp_kem_from_algorithm,
- (int (*)(void *))EVP_KEM_up_ref,
- (void (*)(void *))EVP_KEM_free);
+ evp_kem_up_ref,
+ evp_kem_free);
}
EVP_KEM *evp_kem_fetch_from_prov(OSSL_PROVIDER *prov, const char *algorithm,
@@ -461,8 +471,8 @@ EVP_KEM *evp_kem_fetch_from_prov(OSSL_PROVIDER *prov, const char *algorithm,
{
return evp_generic_fetch_from_prov(prov, OSSL_OP_KEM, algorithm, properties,
evp_kem_from_algorithm,
- (int (*)(void *))EVP_KEM_up_ref,
- (void (*)(void *))EVP_KEM_free);
+ evp_kem_up_ref,
+ evp_kem_free);
}
int EVP_KEM_is_a(const EVP_KEM *kem, const char *name)
@@ -491,8 +501,8 @@ void EVP_KEM_do_all_provided(OSSL_LIB_CTX *libctx,
{
evp_generic_do_all(libctx, OSSL_OP_KEM, (void (*)(void *, void *))fn, arg,
evp_kem_from_algorithm,
- (int (*)(void *))EVP_KEM_up_ref,
- (void (*)(void *))EVP_KEM_free);
+ evp_kem_up_ref,
+ evp_kem_free);
}
int EVP_KEM_names_do_all(const EVP_KEM *kem,