#include "prov/implementations.h"
#include "prov/provider_ctx.h"
#include "prov/provider_util.h"
+#include "prov/providercommon.h"
/*
* Forward declaration of everything implemented here. This is not strictly
{
struct kmac_data_st *kctx;
+ if (!ossl_prov_is_running())
+ return NULL;
+
if ((kctx = OPENSSL_zalloc(sizeof(*kctx))) == NULL
|| (kctx->ctx = EVP_MD_CTX_new()) == NULL) {
kmac_free(kctx);
static void *kmac_dup(void *vsrc)
{
struct kmac_data_st *src = vsrc;
- struct kmac_data_st *dst = kmac_new(src->provctx);
+ struct kmac_data_st *dst;
+
+ if (!ossl_prov_is_running())
+ return NULL;
+ dst = kmac_new(src->provctx);
if (dst == NULL)
return NULL;
unsigned char out[KMAC_MAX_BLOCKSIZE];
int out_len, block_len;
+ if (!ossl_prov_is_running())
+ return 0;
/* Check key has been set */
if (kctx->key_len == 0) {
unsigned char encoded_outlen[KMAC_MAX_ENCODED_HEADER_LEN];
int ok;
+ if (!ossl_prov_is_running())
+ return 0;
+
/* KMAC XOF mode sets the encoded length to 0 */
lbits = (kctx->xof_mode ? 0 : (kctx->out_len * 8));