Blame SOURCES/0077-FIPS-140-3-zeroization.patch

727bdf
diff -up openssl-3.0.1/crypto/ffc/ffc_params.c.fipszero openssl-3.0.1/crypto/ffc/ffc_params.c
727bdf
--- openssl-3.0.1/crypto/ffc/ffc_params.c.fipszero	2022-08-05 13:11:27.211413931 +0200
727bdf
+++ openssl-3.0.1/crypto/ffc/ffc_params.c	2022-08-05 13:11:34.151475891 +0200
727bdf
@@ -27,10 +27,10 @@ void ossl_ffc_params_init(FFC_PARAMS *pa
727bdf
 
727bdf
 void ossl_ffc_params_cleanup(FFC_PARAMS *params)
727bdf
 {
727bdf
-    BN_free(params->p);
727bdf
-    BN_free(params->q);
727bdf
-    BN_free(params->g);
727bdf
-    BN_free(params->j);
727bdf
+    BN_clear_free(params->p);
727bdf
+    BN_clear_free(params->q);
727bdf
+    BN_clear_free(params->g);
727bdf
+    BN_clear_free(params->j);
727bdf
     OPENSSL_free(params->seed);
727bdf
     ossl_ffc_params_init(params);
727bdf
 }
727bdf
diff -up openssl-3.0.1/crypto/rsa/rsa_lib.c.fipszero openssl-3.0.1/crypto/rsa/rsa_lib.c
727bdf
--- openssl-3.0.1/crypto/rsa/rsa_lib.c.fipszero	2022-08-05 13:08:31.875848536 +0200
727bdf
+++ openssl-3.0.1/crypto/rsa/rsa_lib.c	2022-08-05 13:09:35.438416025 +0200
727bdf
@@ -155,8 +155,8 @@ void RSA_free(RSA *r)
727bdf
 
727bdf
     CRYPTO_THREAD_lock_free(r->lock);
727bdf
 
727bdf
-    BN_free(r->n);
727bdf
-    BN_free(r->e);
727bdf
+    BN_clear_free(r->n);
727bdf
+    BN_clear_free(r->e);
727bdf
     BN_clear_free(r->d);
727bdf
     BN_clear_free(r->p);
727bdf
     BN_clear_free(r->q);
727bdf
diff -up openssl-3.0.1/providers/implementations/kdfs/hkdf.c.fipszero openssl-3.0.1/providers/implementations/kdfs/hkdf.c
727bdf
--- openssl-3.0.1/providers/implementations/kdfs/hkdf.c.fipszero	2022-08-05 13:14:58.827303241 +0200
727bdf
+++ openssl-3.0.1/providers/implementations/kdfs/hkdf.c	2022-08-05 13:16:24.530068399 +0200
727bdf
@@ -116,7 +116,7 @@ static void kdf_hkdf_reset(void *vctx)
727bdf
     void *provctx = ctx->provctx;
727bdf
 
727bdf
     ossl_prov_digest_reset(&ctx->digest);
727bdf
-    OPENSSL_free(ctx->salt);
727bdf
+    OPENSSL_clear_free(ctx->salt, ctx->salt_len);
727bdf
     OPENSSL_free(ctx->prefix);
727bdf
     OPENSSL_free(ctx->label);
727bdf
     OPENSSL_clear_free(ctx->data, ctx->data_len);
727bdf
diff -up openssl-3.0.1/providers/implementations/kdfs/pbkdf2.c.fipszero openssl-3.0.1/providers/implementations/kdfs/pbkdf2.c
727bdf
--- openssl-3.0.1/providers/implementations/kdfs/pbkdf2.c.fipszero	2022-08-05 13:12:40.552068717 +0200
727bdf
+++ openssl-3.0.1/providers/implementations/kdfs/pbkdf2.c	2022-08-05 13:13:34.324548799 +0200
727bdf
@@ -83,7 +83,7 @@ static void *kdf_pbkdf2_new(void *provct
727bdf
 static void kdf_pbkdf2_cleanup(KDF_PBKDF2 *ctx)
727bdf
 {
727bdf
     ossl_prov_digest_reset(&ctx->digest);
727bdf
-    OPENSSL_free(ctx->salt);
727bdf
+    OPENSSL_clear_free(ctx->salt, ctx->salt_len);
727bdf
     OPENSSL_clear_free(ctx->pass, ctx->pass_len);
727bdf
     memset(ctx, 0, sizeof(*ctx));
727bdf
 }
727bdf
diff -up openssl-3.0.1/crypto/ec/ec_lib.c.fipszero openssl-3.0.1/crypto/ec/ec_lib.c
727bdf
--- openssl-3.0.1/crypto/ec/ec_lib.c.fipszero	2022-08-05 13:48:32.221345774 +0200
727bdf
+++ openssl-3.0.1/crypto/ec/ec_lib.c	2022-08-05 13:49:16.138741452 +0200
727bdf
@@ -744,12 +744,16 @@ EC_POINT *EC_POINT_new(const EC_GROUP *g
727bdf
 
727bdf
 void EC_POINT_free(EC_POINT *point)
727bdf
 {
727bdf
+#ifdef FIPS_MODULE
727bdf
+    EC_POINT_clear_free(point);
727bdf
+#else
727bdf
     if (point == NULL)
727bdf
         return;
727bdf
 
727bdf
     if (point->meth->point_finish != 0)
727bdf
         point->meth->point_finish(point);
727bdf
     OPENSSL_free(point);
727bdf
+#endif
727bdf
 }
727bdf
 
727bdf
 void EC_POINT_clear_free(EC_POINT *point)