RSA: properly generate algorithm identifier for RSA-PSS signatures
authorTomas Mraz <tomas@openssl.org>
Fri, 29 Jan 2021 16:02:32 +0000 (17:02 +0100)
committerTomas Mraz <tomas@openssl.org>
Fri, 5 Feb 2021 13:04:59 +0000 (14:04 +0100)
commitbbde8566191e5851f4418cbb8acb0d50b16170d8
tree0f8ff9ecdc3f3c3f57a865c8b659da89e4a14d51
parent26372a4d44f0b4ef5423228b8bf975a5a7c814cb
RSA: properly generate algorithm identifier for RSA-PSS signatures

Fixes #13969

- properly handle the mandatory RSA-PSS key parameters
- improve parameter checking when setting the parameters
- compute the algorithm id at the time it is requested so it
  reflects the actual parameters set
- when generating keys do not override previously set parameters
  with defaults
- tests added to the test_req recipe that should cover the PSS signature
  handling

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13988)
crypto/rsa/rsa_ameth.c
crypto/rsa/rsa_backend.c
crypto/rsa/rsa_pss.c
include/crypto/rsa.h
providers/common/der/der_rsa.h.in
providers/common/der/der_rsa_key.c
providers/common/der/der_rsa_sig.c
providers/implementations/keymgmt/rsa_kmgmt.c
providers/implementations/signature/rsa.c
test/recipes/25-test_req.t
test/testrsapssmandatory.pem [new file with mode: 0644]