From: Richard Levitte Date: Fri, 7 Feb 2020 08:09:50 +0000 (+0100) Subject: PROV: Ensure the AlgorithmIdentifier registers in DSA signature impl X-Git-Tag: openssl-3.0.0-alpha1~505 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b0593c086dd303af31dc1e30233149978dd613c4;p=oweals%2Fopenssl.git 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) --- 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; }