PROV: Ensure the AlgorithmIdentifier registers in DSA signature impl
authorRichard Levitte <levitte@openssl.org>
Fri, 7 Feb 2020 08:09:50 +0000 (09:09 +0100)
committerRichard Levitte <levitte@openssl.org>
Mon, 10 Feb 2020 09:22:32 +0000 (10:22 +0100)
When setting up the hash function for DSA signature, the encoded
AlgorithmIdentifier for the DSA+hash combination is queried, but not
stored, which leads to problems when signing ASN.1 items in libcrypto.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11037)

providers/implementations/signature/dsa.c

index b2309ef510e5ccd0e1c67f4ba5a5081962a22de1..72cf71927da807b2fdf51c261c623587dacfedd2 100644 (file)
@@ -157,6 +157,8 @@ static int dsa_setup_md(PROV_DSA_CTX *ctx,
 
         ctx->md = md;
         OPENSSL_strlcpy(ctx->mdname, mdname, sizeof(ctx->mdname));
+        memcpy(ctx->aid, algorithmidentifier, algorithmidentifier_len);
+        ctx->aid_len = algorithmidentifier_len;
     }
     return 1;
 }