test: add error reasons to RSA tests

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/25135)
This commit is contained in:
Pauli 2024-08-08 13:25:18 +10:00
parent 8e316edd71
commit 068c9bee37

View File

@ -1941,6 +1941,7 @@ Securitycheck = 1
Key = RSA-2048
Input = "Hello"
Result = DIGESTSIGNINIT_ERROR
Reason = invalid digest
# Signing with a 1024 bit key is not allowed in fips mode
FIPSversion = >=3.4.0
@ -1949,6 +1950,7 @@ Securitycheck = 1
Key = RSA-1024
Input = "Hello"
Result = DIGESTSIGNINIT_ERROR
Reason = invalid key length
# Verifying with a legacy digest in fips mode is not allowed
FIPSversion = >=3.4.0
@ -1957,6 +1959,7 @@ Securitycheck = 1
Key = RSA-2048
Input = "Hello"
Result = DIGESTVERIFYINIT_ERROR
Reason = unsupported
# Verifying with a key smaller than 1024 bits in fips mode is not allowed
FIPSversion = >=3.4.0
@ -1965,6 +1968,7 @@ Securitycheck = 1
Key = RSA-512
Input = "Hello"
Result = DIGESTVERIFYINIT_ERROR
Reason = invalid key length
# RSA Signing with X931 is not approved in FIPS 140-3
FIPSversion = >=3.4.0
@ -1973,6 +1977,7 @@ Ctrl = rsa_padding_mode:x931
Input = "0123456789ABCDEF123456789ABC"
Output = c09d402423cbf233d26cae21f954547bc43fe80fd41360a0336cfdbe9aedad05bef6fd2eaee6cd60089a52482d4809a238149520df3bdde4cb9e23d9307b05c0a6f327052325a29adf2cc95b66523be7024e2a585c3d4db15dfbe146efe0ecdc0402e33fe5d40324ee96c5c3edd374a15cdc0f5d84aa243c0f07e188c6518fbfceae158a9943be398e31097da81b62074f626eff738be6160741d5a26957a482b3251fd85d8df78b98148459de10aa93305dbb4a5230aa1da291a9b0e481918f99b7638d72bb687f97661d304ae145d64a474437a4ef39d7b8059332ddeb07e92bf6e0e3acaf8afedc93795e4511737ec1e7aab6d5bc9466afc950c1c17b48ad
Result = PKEY_CTRL_ERROR
Reason = illegal or unsupported padding mode
##################################################
# Check that the indicator callback is triggered