From b0593c086dd303af31dc1e30233149978dd613c4 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Fri, 7 Feb 2020 09:09:50 +0100 Subject: [PATCH] PROV: Ensure the AlgorithmIdentifier registers in DSA signature impl 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 (Merged from https://github.com/openssl/openssl/pull/11037) --- providers/implementations/signature/dsa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/providers/implementations/signature/dsa.c b/providers/implementations/signature/dsa.c index b2309ef510..72cf71927d 100644 --- a/providers/implementations/signature/dsa.c +++ b/providers/implementations/signature/dsa.c @@ -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; } -- 2.34.1