]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
PROV: Fix encoding of MDWithRSAEncryption signature AlgorithmID
authorRichard Levitte <levitte@openssl.org>
Sun, 31 Jan 2021 22:15:08 +0000 (23:15 +0100)
committerRichard Levitte <levitte@openssl.org>
Fri, 5 Feb 2021 15:53:30 +0000 (16:53 +0100)
All {MD}WithRSAEncryption signature AlgorithmID have the parameters
being NULL, according to PKCS#1.  We didn't.  Now corrected.

This bug was the topic of this thread on openssl-users@openssl.org:
https://mta.openssl.org/pipermail/openssl-users/2021-January/013416.html

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14030)

providers/common/der/der_rsa_sig.c

index 94ed60b69ff9b5ab465220a0f66fa46342fe131d..7fb69f87b09aba4dd78261878b6fb494ffb3b8d3 100644 (file)
@@ -58,7 +58,9 @@ int ossl_DER_w_algorithmIdentifier_MDWithRSAEncryption(WPACKET *pkt, int tag,
     }
 
     return ossl_DER_w_begin_sequence(pkt, tag)
-        /* No parameters (yet?) */
+        /* PARAMETERS, always NULL according to current standards */
+        && ossl_DER_w_null(pkt, -1)
+        /* OID */
         && ossl_DER_w_precompiled(pkt, -1, precompiled, precompiled_sz)
         && ossl_DER_w_end_sequence(pkt, tag);
 }