#include "internal/cryptlib.h"
#include "prov/providercommonerr.h"
#include "prov/implementations.h"
+#include "prov/providercommon.h"
/*
* Forward declaration of everything implemented here. This is not strictly
static void *blake2_mac_new(void *unused_provctx)
{
- struct blake2_mac_data_st *macctx = OPENSSL_zalloc(sizeof(*macctx));
+ struct blake2_mac_data_st *macctx;
+ if (!ossl_prov_is_running())
+ return NULL;
+
+ macctx = OPENSSL_zalloc(sizeof(*macctx));
if (macctx != NULL) {
BLAKE2_PARAM_INIT(&macctx->params);
/* ctx initialization is deferred to BLAKE2b_Init() */
struct blake2_mac_data_st *dst;
struct blake2_mac_data_st *src = vsrc;
+ if (!ossl_prov_is_running())
+ return NULL;
+
dst = OPENSSL_zalloc(sizeof(*dst));
if (dst == NULL)
return NULL;
{
struct blake2_mac_data_st *macctx = vmacctx;
+ if (!ossl_prov_is_running())
+ return 0;
+
/* Check key has been set */
if (macctx->params.key_length == 0) {
ERR_raise(ERR_LIB_PROV, PROV_R_NO_KEY_SET);
{
struct blake2_mac_data_st *macctx = vmacctx;
+ if (!ossl_prov_is_running())
+ return 0;
+
*outl = blake2_mac_size(macctx);
return BLAKE2_FINAL(out, &macctx->ctx);
}