1 |
diff -up openssl-3.0.1/crypto/ffc/ffc_params.c.fipszero openssl-3.0.1/crypto/ffc/ffc_params.c |
2 |
--- openssl-3.0.1/crypto/ffc/ffc_params.c.fipszero 2022-08-05 13:11:27.211413931 +0200 |
3 |
+++ openssl-3.0.1/crypto/ffc/ffc_params.c 2022-08-05 13:11:34.151475891 +0200 |
4 |
@@ -27,10 +27,10 @@ void ossl_ffc_params_init(FFC_PARAMS *pa |
5 |
|
6 |
void ossl_ffc_params_cleanup(FFC_PARAMS *params) |
7 |
{ |
8 |
- BN_free(params->p); |
9 |
- BN_free(params->q); |
10 |
- BN_free(params->g); |
11 |
- BN_free(params->j); |
12 |
+ BN_clear_free(params->p); |
13 |
+ BN_clear_free(params->q); |
14 |
+ BN_clear_free(params->g); |
15 |
+ BN_clear_free(params->j); |
16 |
OPENSSL_free(params->seed); |
17 |
ossl_ffc_params_init(params); |
18 |
} |
19 |
diff -up openssl-3.0.1/crypto/rsa/rsa_lib.c.fipszero openssl-3.0.1/crypto/rsa/rsa_lib.c |
20 |
--- openssl-3.0.1/crypto/rsa/rsa_lib.c.fipszero 2022-08-05 13:08:31.875848536 +0200 |
21 |
+++ openssl-3.0.1/crypto/rsa/rsa_lib.c 2022-08-05 13:09:35.438416025 +0200 |
22 |
@@ -155,8 +155,8 @@ void RSA_free(RSA *r) |
23 |
|
24 |
CRYPTO_THREAD_lock_free(r->lock); |
25 |
|
26 |
- BN_free(r->n); |
27 |
- BN_free(r->e); |
28 |
+ BN_clear_free(r->n); |
29 |
+ BN_clear_free(r->e); |
30 |
BN_clear_free(r->d); |
31 |
BN_clear_free(r->p); |
32 |
BN_clear_free(r->q); |
33 |
diff -up openssl-3.0.1/providers/implementations/kdfs/hkdf.c.fipszero openssl-3.0.1/providers/implementations/kdfs/hkdf.c |
34 |
--- openssl-3.0.1/providers/implementations/kdfs/hkdf.c.fipszero 2022-08-05 13:14:58.827303241 +0200 |
35 |
+++ openssl-3.0.1/providers/implementations/kdfs/hkdf.c 2022-08-05 13:16:24.530068399 +0200 |
36 |
@@ -116,7 +116,7 @@ static void kdf_hkdf_reset(void *vctx) |
37 |
void *provctx = ctx->provctx; |
38 |
|
39 |
ossl_prov_digest_reset(&ctx->digest); |
40 |
- OPENSSL_free(ctx->salt); |
41 |
+ OPENSSL_clear_free(ctx->salt, ctx->salt_len); |
42 |
OPENSSL_free(ctx->prefix); |
43 |
OPENSSL_free(ctx->label); |
44 |
OPENSSL_clear_free(ctx->data, ctx->data_len); |
45 |
diff -up openssl-3.0.1/providers/implementations/kdfs/pbkdf2.c.fipszero openssl-3.0.1/providers/implementations/kdfs/pbkdf2.c |
46 |
--- openssl-3.0.1/providers/implementations/kdfs/pbkdf2.c.fipszero 2022-08-05 13:12:40.552068717 +0200 |
47 |
+++ openssl-3.0.1/providers/implementations/kdfs/pbkdf2.c 2022-08-05 13:13:34.324548799 +0200 |
48 |
@@ -83,7 +83,7 @@ static void *kdf_pbkdf2_new(void *provct |
49 |
static void kdf_pbkdf2_cleanup(KDF_PBKDF2 *ctx) |
50 |
{ |
51 |
ossl_prov_digest_reset(&ctx->digest); |
52 |
- OPENSSL_free(ctx->salt); |
53 |
+ OPENSSL_clear_free(ctx->salt, ctx->salt_len); |
54 |
OPENSSL_clear_free(ctx->pass, ctx->pass_len); |
55 |
memset(ctx, 0, sizeof(*ctx)); |
56 |
} |
57 |
diff -up openssl-3.0.1/crypto/ec/ec_lib.c.fipszero openssl-3.0.1/crypto/ec/ec_lib.c |
58 |
--- openssl-3.0.1/crypto/ec/ec_lib.c.fipszero 2022-08-05 13:48:32.221345774 +0200 |
59 |
+++ openssl-3.0.1/crypto/ec/ec_lib.c 2022-08-05 13:49:16.138741452 +0200 |
60 |
@@ -744,12 +744,16 @@ EC_POINT *EC_POINT_new(const EC_GROUP *g |
61 |
|
62 |
void EC_POINT_free(EC_POINT *point) |
63 |
{ |
64 |
+#ifdef FIPS_MODULE |
65 |
+ EC_POINT_clear_free(point); |
66 |
+#else |
67 |
if (point == NULL) |
68 |
return; |
69 |
|
70 |
if (point->meth->point_finish != 0) |
71 |
point->meth->point_finish(point); |
72 |
OPENSSL_free(point); |
73 |
+#endif |
74 |
} |
75 |
|
76 |
void EC_POINT_clear_free(EC_POINT *point) |