Skip to content

Commit

Permalink
Update ec lib
Browse files Browse the repository at this point in the history
  • Loading branch information
guanzhi committed Dec 19, 2018
1 parent d4917f2 commit 3e3cc9d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crypto/ec/ec_ameth.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,12 @@ static int ec_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
#endif

case ASN1_PKEY_CTRL_DEFAULT_MD_NID:
#if !defined(OPENSSL_NO_SM2) && !defined(OPENSSL_NO_SM3)
if (EC_KEY_is_sm2p256v1(EVP_PKEY_get0_EC_KEY(pkey))) {
*(int *)arg2 = NID_sm3;
return 2;
}
#endif
*(int *)arg2 = NID_sha256;
return 2;

Expand Down

0 comments on commit 3e3cc9d

Please sign in to comment.