From 803b17a8b3d004c0500bf40daba0f87efe5b1467 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Wed, 6 Dec 2023 23:04:52 -0600 Subject: [PATCH] src/ssl_crypto.c: in wolfSSL_CMAC_CTX_free(), gate wc_CmacFree() on !FIPS || FIPS>=5.3. --- src/ssl_crypto.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ssl_crypto.c b/src/ssl_crypto.c index 0523ad952..3c73b88f5 100644 --- a/src/ssl_crypto.c +++ b/src/ssl_crypto.c @@ -2106,7 +2106,9 @@ void wolfSSL_CMAC_CTX_free(WOLFSSL_CMAC_CTX *ctx) if (ctx != NULL) { /* Deallocate dynamically allocated fields. */ if (ctx->internal != NULL) { +#if (!defined(HAVE_FIPS) || FIPS_VERSION_GE(5, 3)) && !defined(HAVE_SELFTEST) wc_CmacFree((Cmac*)ctx->internal); +#endif XFREE(ctx->internal, NULL, DYNAMIC_TYPE_CMAC); } if (ctx->cctx != NULL) {