Skip to content

Commit 7e3aafb

Browse files
authored
Fix for FIPS ECC integrity check with crypto callback set (#6425)
Skip ECC private key check when the TPM is used to generate the key, since it doesn't release the private part. this option needs to be used with a FIPS approved TPM for the end result to be FIPS approved
1 parent f3b66a3 commit 7e3aafb

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

configure.ac

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,6 @@ AS_CASE([$FIPS_VERSION],
434434
]
435435
)
436436

437-
438437
# For reproducible build, gate out from the build anything that might
439438
# introduce semantically frivolous jitter, maximizing chance of
440439
# identical object files.

wolfcrypt/src/ecc.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5676,7 +5676,12 @@ int wc_ecc_make_key_ex2(WC_RNG* rng, int keysize, ecc_key* key, int curve_id,
56765676
if (err == MP_OKAY) {
56775677
err = _ecc_validate_public_key(key, 0, 0);
56785678
}
5679-
if (err == MP_OKAY) {
5679+
if (err == MP_OKAY
5680+
#if defined(WOLF_CRYPTO_CB)
5681+
/* even if WOLF_CRYPTO_CB we generate the key if the devId is invalid */
5682+
&& key->devId == INVALID_DEVID
5683+
#endif
5684+
) {
56805685
err = _ecc_pairwise_consistency_test(key, rng);
56815686
}
56825687
#endif

0 commit comments

Comments
 (0)