With the Windows version of openssl(3.2.1) we want to generate a certificate with these conditions:
Hash method: SHA-256
Mask Generation Function: MGF1 with SHA-256
Length of the salt: 32 bytes
Trailer Field: 0xBC
The specified parameters correspond to the specifications of the RSASSA-PSS signature scheme as described in RFC 8017
Unfortunately, a certificate is always generated that contains the value 0x01 in the trailer field.
Steps:
Generate Key
openssl genpkey -algorithm rsa-pss -pkeyopt rsa_keygen_bits:4096 -pkeyopt rsa_pss_keygen_md:sha256 -pkeyopt rsa_pss_keygen_mgf1_md:sha256 -pkeyopt rsa_pss_keygen_saltlen:32 -out 20240314_privateKey.pemGenerate certifikat
openssl req -new -nodes -x509 -days 3650 -pkeyopt rsa_keygen_bits:4096 -sigopt rsa_pss_saltlen:32 -key 20240314_privateKey.pem -out 20240314_certifcate.pemDisplay certificate
openssl x509 -in 20240314_certifcate.pem -text
Result ... Mask Algorithm: mgf1 with sha256 Salt Length: 0x20 Trailer Field: 0x01 (default) ...
Does anyone have any idea how to fix this problem?
Many thanks in advance
The encoded trailer field value of
01corresponds to a trailer value ofBC. As the only legal value (to my knowledge), everyone writes an01there, corresponding to everyone usingBCin the EMSA-PSS steps.From https://datatracker.ietf.org/doc/html/rfc8017#appendix-A.2.3: