summaryrefslogtreecommitdiffstats
path: root/crypto/property
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/property')
-rw-r--r--crypto/property/property.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/property/property.c b/crypto/property/property.c
index c3fa8df9c6..6576ba0fd2 100644
--- a/crypto/property/property.c
+++ b/crypto/property/property.c
@@ -174,8 +174,9 @@ static int ossl_method_store_insert(OSSL_METHOD_STORE *store, ALGORITHM *alg)
}
int ossl_method_store_add(OSSL_METHOD_STORE *store,
- int nid, const char *properties,
- void *method, void (*method_destruct)(void *))
+ int nid, const char *properties, void *method,
+ int (*method_up_ref)(void *),
+ void (*method_destruct)(void *))
{
ALGORITHM *alg = NULL;
IMPLEMENTATION *impl;
@@ -190,6 +191,8 @@ int ossl_method_store_add(OSSL_METHOD_STORE *store,
impl = OPENSSL_malloc(sizeof(*impl));
if (impl == NULL)
return 0;
+ if (method_up_ref != NULL && !method_up_ref(method))
+ return 0;
impl->method = method;
impl->method_destruct = method_destruct;