#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 hmac_data_st *macctx;
+ if (!ossl_prov_is_running())
+ return NULL;
+
if ((macctx = OPENSSL_zalloc(sizeof(*macctx))) == NULL
|| (macctx->ctx = HMAC_CTX_new()) == NULL) {
OPENSSL_free(macctx);
static void *hmac_dup(void *vsrc)
{
struct hmac_data_st *src = vsrc;
- struct hmac_data_st *dst = hmac_new(src->provctx);
+ struct hmac_data_st *dst;
HMAC_CTX *ctx;
+ if (!ossl_prov_is_running())
+ return NULL;
+ dst = hmac_new(src->provctx);
if (dst == NULL)
return NULL;
static int hmac_init(void *vmacctx)
{
struct hmac_data_st *macctx = vmacctx;
- const EVP_MD *digest = ossl_prov_digest_md(&macctx->digest);
+ const EVP_MD *digest;
int rv = 1;
+ if (!ossl_prov_is_running())
+ return 0;
+
+ digest = ossl_prov_digest_md(&macctx->digest);
/* HMAC_Init_ex doesn't tolerate all zero params, so we must be careful */
if (macctx->tls_data_size == 0 && digest != NULL)
rv = HMAC_Init_ex(macctx->ctx, NULL, 0, digest,
unsigned int hlen;
struct hmac_data_st *macctx = vmacctx;
+ if (!ossl_prov_is_running())
+ return 0;
if (macctx->tls_data_size > 0) {
if (macctx->tls_mac_out_size == 0)
return 0;