diff options
author | Clemens Lang <cllang@redhat.com> | 2022-11-18 12:35:33 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-12-08 11:02:52 +0100 |
commit | 6c73ca4a2f4ea71f4a880670624e7b2fdb6f32da (patch) | |
tree | 774202724fd1eb4cff06d536c5320bac94dc41b6 /test/smime-certs | |
parent | 5a3bbe1712435d577bbc5ec046906979e8471d8b (diff) | |
download | openssl-6c73ca4a2f4ea71f4a880670624e7b2fdb6f32da.tar.gz |
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)
Diffstat (limited to 'test/smime-certs')
-rw-r--r-- | test/smime-certs/mksmime-certs.sh | 5 | ||||
-rw-r--r-- | test/smime-certs/smrsa1024.pem | 34 |
2 files changed, 39 insertions, 0 deletions
diff --git a/test/smime-certs/mksmime-certs.sh b/test/smime-certs/mksmime-certs.sh index 498190bcca..a4de65b967 100644 --- a/test/smime-certs/mksmime-certs.sh +++ b/test/smime-certs/mksmime-certs.sh @@ -34,6 +34,11 @@ CN="Test S/MIME EE RSA #3" $OPENSSL req -config ca.cnf -noenc \ $OPENSSL x509 -req -in req.pem -CA smroot.pem -days 36500 \ -extfile ca.cnf -extensions usr_cert -CAcreateserial >>smrsa3.pem +CN="Test S/MIME EE RSA 1024" $OPENSSL req -config ca.cnf -noenc \ + -keyout smrsa1024.pem -out req.pem -newkey rsa:1024 +$OPENSSL x509 -req -in req.pem -CA smroot.pem -days 36500 \ + -extfile ca.cnf -extensions usr_cert -CAcreateserial >>smrsa1024.pem + # Create DSA parameters $OPENSSL dsaparam -out dsap.pem 2048 diff --git a/test/smime-certs/smrsa1024.pem b/test/smime-certs/smrsa1024.pem new file mode 100644 index 0000000000..aa58e6463e --- /dev/null +++ b/test/smime-certs/smrsa1024.pem @@ -0,0 +1,34 @@ +-----BEGIN PRIVATE KEY----- +MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAKuDWQObVMeON25c +MY1YprdkKdZhyJ3zisFHyJ1jmXQ13aMqaBlNYzx9ECAGQTSw2De6tsJF0jpX3IHO +X7OcZyhg8XkBdFJvJ2RsYwyghcWLvoAznCt/Pqi3m2HRgc+6FCHmh5wjK7McZ9sH +uGGbnh+5GJzuFmcitcwlVM8d1ctZAgMBAAECgYBL04ARFiU/LGLZSa0mnmDmh0Pv +4b8+BaP8m23YF2aKeB4Kuv7W4N3Uqj3sypcdYmnVCZku/otY++sjAEhTMfxwpexf +JtKKfdZiE1QYQRSZROVIayTePPKsROzb4cSeB42MbNawpc5EgVazJ1dNHAjp/nQ2 +r6G7QusGW/Xiu26qWQJBAN/Yd4easmM/AdE9YpnfIWMH83S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