summaryrefslogtreecommitdiffstats
path: root/providers/implementations/ciphers/cipher_idea.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2020-09-08 12:56:34 +1000
committerPauli <paul.dale@oracle.com>2020-09-12 16:46:51 +1000
commitf99d3eedf7c3e1e2b10aad911f469f1fc783a395 (patch)
tree3fae1a4f153367e1296c2c61d782bd59acbf73dc /providers/implementations/ciphers/cipher_idea.c
parent422cbcee6167faa20f439726a8b7bff0af51edc9 (diff)
ciphers: add FIPS error state handling
The functions that check for the provider being runnable are: new, init, final and dupctx. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12801)
Diffstat (limited to 'providers/implementations/ciphers/cipher_idea.c')
-rw-r--r--providers/implementations/ciphers/cipher_idea.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/providers/implementations/ciphers/cipher_idea.c b/providers/implementations/ciphers/cipher_idea.c
index 7fc5d8403d..07a6d4b997 100644
--- a/providers/implementations/ciphers/cipher_idea.c
+++ b/providers/implementations/ciphers/cipher_idea.c
@@ -18,6 +18,7 @@
#include "cipher_idea.h"
#include "prov/implementations.h"
+#include "prov/providercommon.h"
static OSSL_FUNC_cipher_freectx_fn idea_freectx;
static OSSL_FUNC_cipher_dupctx_fn idea_dupctx;
@@ -33,8 +34,12 @@ static void idea_freectx(void *vctx)
static void *idea_dupctx(void *ctx)
{
PROV_IDEA_CTX *in = (PROV_IDEA_CTX *)ctx;
- PROV_IDEA_CTX *ret = OPENSSL_malloc(sizeof(*ret));
+ PROV_IDEA_CTX *ret;
+ if (!ossl_prov_is_running())
+ return NULL;
+
+ ret = OPENSSL_malloc(sizeof(*ret));
if (ret == NULL) {
ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE);
return NULL;