Skip to content

Commit 8425efa

Browse files
committed
Merged PR 11412419: Additional FIPS 140-3 fixes: run ECDSA CAST before key usage/export, as with...
In !11324214, we added Known-Answer Tests (KATs) for RSA, DSA, and ECDSA, to satisfy FIPS 140-3 requirement for Cryptographic Algorithm Self-Tests (CASTs). Prior to that change, we were using Pairwise Consistency Tests (PCTs) to satisfy that requirement, but we received feedback from evaluators that PCTs do not satisfy the CAST requirement. Unfortunately, there was an oversight in the previous change and the CAST was only added for key import, not key generation. To fix this, we execute the CAST in `SymCryptEckeySetRandom` as well. Related work items: #53481333
1 parent 2b82f03 commit 8425efa

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
New changes will be listed here as they are developed. The version number is determined
44
prior to the creation of a new release, based on the changes contained in that release.
55

6+
- Additional internal self-test changes to support FIPS 140-3 certification
7+
68
# Version 103.5.0
79

810
- Internal self-test changes to support FIPS 140-3 certification

lib/eckey.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -905,8 +905,13 @@ SymCryptEckeySetRandom(
905905

906906
if ( (flags & SYMCRYPT_FLAG_KEY_NO_FIPS) == 0 )
907907
{
908-
// We defer the ECDSA PCT to before first use of the Eckey in EcDsaSign, or first time
909-
// private key is exported - whichever comes first.
908+
if( ( flags & SYMCRYPT_FLAG_ECKEY_ECDSA ) != 0 )
909+
{
910+
// Ensure ECDSA algorithm selftest is run before first use of ECDSA algorithm
911+
SYMCRYPT_RUN_SELFTEST_ONCE(
912+
SymCryptEcDsaSelftest,
913+
SYMCRYPT_SELFTEST_ALGORITHM_ECDSA );
914+
}
910915

911916
if( ( flags & SYMCRYPT_FLAG_ECKEY_ECDH ) != 0 )
912917
{

0 commit comments

Comments
 (0)