openssl/providers/implementations
Clemens Lang 6c73ca4a2f signature: Clamp PSS salt len to MD len
FIPS 186-4 section 5 "The RSA Digital Signature Algorithm", subsection
5.5 "PKCS #1" says: "For RSASSA-PSS […] the length (in bytes) of the
salt (sLen) shall satisfy 0 <= sLen <= hLen, where hLen is the length of
the hash function output block (in bytes)."

Introduce a new option RSA_PSS_SALTLEN_AUTO_DIGEST_MAX and make it the
default. The new value will behave like RSA_PSS_SALTLEN_AUTO, but will
not use more than the digest length when signing, so that FIPS 186-4 is
not violated. This value has two advantages when compared with
RSA_PSS_SALTLEN_DIGEST: (1) It will continue to do auto-detection when
verifying signatures for maximum compatibility, where
RSA_PSS_SALTLEN_DIGEST would fail for other digest sizes. (2) It will
work for combinations where the maximum salt length is smaller than the
digest size, which typically happens with large digest sizes (e.g.,
SHA-512) and small RSA keys.

J.-S. Coron shows in "Optimal Security Proofs for PSS and Other
Signature Schemes. Advances in Cryptology – Eurocrypt 2002, volume 2332
of Lecture Notes in Computer Science, pp. 272 – 287. Springer Verlag,
2002." that longer salts than the output size of modern hash functions
do not increase security: "For example,for an application in which at
most one billion signatures will be generated, k0 = 30 bits of random
salt are actually sufficient to guarantee the same level of security as
RSA, and taking a larger salt does not increase the security level."

Signed-off-by: Clemens Lang <cllang@redhat.com>

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19724)
2022-12-08 11:02:52 +01:00
..
asymciphers set MGF1 digest correctly 2022-10-07 19:53:04 +02:00
ciphers aes: add AES-GCM-SIV modes to the FIPS provider 2022-11-30 07:50:33 +11:00
digests Avoid putting ripemd_prov.c in libcommon otherwise it is regarded as fips source 2022-10-19 13:21:01 +02:00
encode_decode Cleanup : directly include of internal/nelem.h when required. 2022-11-23 18:08:25 +01:00
exchange Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
include/prov Implement deterministic ECDSA sign (RFC6979) 2022-11-30 07:31:53 +00:00
kdfs Implement deterministic ECDSA sign (RFC6979) 2022-11-30 07:31:53 +00:00
kem Implements Hybrid Public Key Encryption (HPKE) as per RFC9180. 2022-11-25 16:26:55 +00:00
keymgmt Honor OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT as set and default to UNCOMPRESSED 2022-11-29 16:03:04 +01:00
macs cmac_set_ctx_params(): Fail if cipher mode is not CBC 2022-11-11 16:54:50 +01:00
rands Implement deterministic ECDSA sign (RFC6979) 2022-11-30 07:31:53 +00:00
signature signature: Clamp PSS salt len to MD len 2022-12-08 11:02:52 +01:00
storemgmt Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
build.info