EVP_Digest*: enable SHA3 pre-hashing for ECDSA
authorPatrick Steuer <patrick.steuer@de.ibm.com>
Tue, 21 May 2019 15:43:54 +0000 (17:43 +0200)
committerPatrick Steuer <patrick.steuer@de.ibm.com>
Wed, 22 May 2019 14:49:45 +0000 (16:49 +0200)
Fixes #8957

Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8970)

crypto/ec/ec_pmeth.c

index 68211ed197031378d060304acfb207f8eb7cc3b5..45798b4f39dcd3619d7f9aab521d94c27a929861 100644 (file)
@@ -323,7 +323,11 @@ static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
             EVP_MD_type((const EVP_MD *)p2) != NID_sha224 &&
             EVP_MD_type((const EVP_MD *)p2) != NID_sha256 &&
             EVP_MD_type((const EVP_MD *)p2) != NID_sha384 &&
-            EVP_MD_type((const EVP_MD *)p2) != NID_sha512) {
+            EVP_MD_type((const EVP_MD *)p2) != NID_sha512 &&
+            EVP_MD_type((const EVP_MD *)p2) != NID_sha3_224 &&
+            EVP_MD_type((const EVP_MD *)p2) != NID_sha3_256 &&
+            EVP_MD_type((const EVP_MD *)p2) != NID_sha3_384 &&
+            EVP_MD_type((const EVP_MD *)p2) != NID_sha3_512) {
             ECerr(EC_F_PKEY_EC_CTRL, EC_R_INVALID_DIGEST_TYPE);
             return 0;
         }