summaryrefslogtreecommitdiffstats
path: root/providers/implementations/kdfs/kbkdf.c
diff options
context:
space:
mode:
Diffstat (limited to 'providers/implementations/kdfs/kbkdf.c')
-rw-r--r--providers/implementations/kdfs/kbkdf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/providers/implementations/kdfs/kbkdf.c b/providers/implementations/kdfs/kbkdf.c
index f3122ac1bd..c8b5cdf8c6 100644
--- a/providers/implementations/kdfs/kbkdf.c
+++ b/providers/implementations/kdfs/kbkdf.c
@@ -41,6 +41,7 @@
#include "prov/implementations.h"
#include "prov/provider_ctx.h"
#include "prov/provider_util.h"
+#include "prov/providercommon.h"
#include "prov/providercommonerr.h"
#include "e_os.h"
@@ -99,6 +100,9 @@ static void *kbkdf_new(void *provctx)
{
KBKDF *ctx;
+ if (!ossl_prov_is_running())
+ return NULL;
+
ctx = OPENSSL_zalloc(sizeof(*ctx));
if (ctx == NULL) {
ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE);
@@ -192,6 +196,9 @@ static int kbkdf_derive(void *vctx, unsigned char *key, size_t keylen)
uint32_t l = be32(keylen * 8);
size_t h = 0;
+ if (!ossl_prov_is_running())
+ return 0;
+
/* label, context, and iv are permitted to be empty. Check everything
* else. */
if (ctx->ctx_init == NULL) {