summaryrefslogtreecommitdiffstats
path: root/crypto/ec
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-05-29 14:33:12 +0100
committerMatt Caswell <matt@openssl.org>2018-05-31 10:38:51 +0100
commit5be77b074c17a506f222a28f13a0b64bbef9da7a (patch)
tree3cca08822524fc90f95148c7e356a3562e9293f6 /crypto/ec
parent3190d1dca43ecfd748c06aa06752de06af3768b9 (diff)
Remove some logically dead code
Issues found by Coverity Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6373)
Diffstat (limited to 'crypto/ec')
-rw-r--r--crypto/ec/ec_pmeth.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/crypto/ec/ec_pmeth.c b/crypto/ec/ec_pmeth.c
index 2fde4f7a5b..b4105c20f2 100644
--- a/crypto/ec/ec_pmeth.c
+++ b/crypto/ec/ec_pmeth.c
@@ -219,10 +219,8 @@ static int pkey_ecies_encrypt(EVP_PKEY_CTX *ctx,
if (dctx->md)
md_type = EVP_MD_type(dctx->md);
- else if (ec_nid == NID_sm2)
- md_type = NID_sm3;
else
- md_type = NID_sha256;
+ md_type = NID_sm3;
if (out == NULL) {
*outlen = SM2_ciphertext_size(ec, EVP_get_digestbynid(md_type),
@@ -259,13 +257,12 @@ static int pkey_ecies_decrypt(EVP_PKEY_CTX *ctx,
if (dctx->md)
md_type = EVP_MD_type(dctx->md);
- else if (ec_nid == NID_sm2)
- md_type = NID_sm3;
else
- md_type = NID_sha256;
+ md_type = NID_sm3;
if (out == NULL) {
- *outlen = SM2_plaintext_size(ec, EVP_get_digestbynid(md_type), inlen);
+ *outlen = SM2_plaintext_size(ec, EVP_get_digestbynid(md_type),
+ inlen);
ret = 1;
}
else {