disable deterministic ecdsa for fips builds
FIPS 186-5 [1] allows the usage deterministic ECDSA (Section 6.3) which
is compabile with RFC 6979 [2] but OpenSSL seems to follow FIPS 186-4
(Section 6.3) [3] which only allows for random k values, failing
k value generation for OpenSSL >=3.2. [4]
Fix signing by not using deterministic ECDSA when FIPS mode is active.
[1]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf
[2]: https://datatracker.ietf.org/doc/html/rfc6979
[3]: https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf
[4]: 85f17585b0/crypto/ec/ecdsa_ossl.c (L201-L207)
This commit is contained in:
committed by
Michal Nowak
parent
6306031409
commit
8d093a6b66
@@ -31,6 +31,7 @@
|
||||
#include <cmocka.h>
|
||||
|
||||
#include <isc/file.h>
|
||||
#include <isc/fips.h>
|
||||
#include <isc/hex.h>
|
||||
#include <isc/result.h>
|
||||
#include <isc/stdio.h>
|
||||
@@ -467,7 +468,11 @@ ISC_RUN_TEST_IMPL(ecdsa_determinism_test) {
|
||||
dst_context_destroy(&ctx);
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30200000L
|
||||
assert_memory_equal(sigbuf1->base, sigbuf2->base, siglen);
|
||||
if (isc_fips_mode()) {
|
||||
assert_memory_not_equal(sigbuf1->base, sigbuf2->base, siglen);
|
||||
} else {
|
||||
assert_memory_equal(sigbuf1->base, sigbuf2->base, siglen);
|
||||
}
|
||||
#else
|
||||
assert_memory_not_equal(sigbuf1->base, sigbuf2->base, siglen);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user