summaryrefslogtreecommitdiffstats
path: root/providers/implementations/ciphers/cipher_aria_gcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'providers/implementations/ciphers/cipher_aria_gcm.c')
-rw-r--r--providers/implementations/ciphers/cipher_aria_gcm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/providers/implementations/ciphers/cipher_aria_gcm.c b/providers/implementations/ciphers/cipher_aria_gcm.c
index 6ffa0910fa..f9eb64cc19 100644
--- a/providers/implementations/ciphers/cipher_aria_gcm.c
+++ b/providers/implementations/ciphers/cipher_aria_gcm.c
@@ -30,10 +30,16 @@ static void *aria_gcm_newctx(void *provctx, size_t keybits)
static void *aria_gcm_dupctx(void *provctx)
{
PROV_ARIA_GCM_CTX *ctx = provctx;
+ PROV_ARIA_GCM_CTX *dctx = NULL;
if (ctx == NULL)
return NULL;
- return OPENSSL_memdup(ctx, sizeof(*ctx));
+
+ dctx = OPENSSL_memdup(ctx, sizeof(*ctx));
+ if (dctx != NULL && dctx->base.gcm.key != NULL)
+ dctx->base.gcm.key = &dctx->ks.ks;
+
+ return dctx;
}
static OSSL_FUNC_cipher_freectx_fn aria_gcm_freectx;