Fix DSA parameter generation control error
authorRichard Levitte <levitte@openssl.org>
Wed, 18 Jan 2017 15:19:26 +0000 (16:19 +0100)
committerRichard Levitte <levitte@openssl.org>
Fri, 20 Jan 2017 07:30:35 +0000 (08:30 +0100)
When setting the digest parameter for DSA parameter generation, the
signature MD was set instead of the parameter generation one.
Fortunately, that's also the one that was used for parameter
generation, but it ultimately meant the parameter generator MD and the
signature MD would always be the same.

Fixes github issue #2016

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2250)
(cherry picked from commit 8a05c4d3b5a1bfb9193ea24e71735e11de7168d2)

crypto/dsa/dsa_pmeth.c

index 418095871ec264b5ff2142d25ac81008e53739e7..95f088a5ec2527cc11473bdf7429b6046160a9c5 100644 (file)
@@ -136,7 +136,7 @@ static int pkey_dsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
             DSAerr(DSA_F_PKEY_DSA_CTRL, DSA_R_INVALID_DIGEST_TYPE);
             return 0;
         }
-        dctx->md = p2;
+        dctx->pmd = p2;
         return 1;
 
     case EVP_PKEY_CTRL_MD: