aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-04-21 17:35:53 +0900
committerDr. Stephen Henson <steve@openssl.org>2016-04-23 04:24:27 +0100
commitacde647fb0347f64af8f8678b73ce41f2f499c02 (patch)
treecb21a13ced1ce32c8f5e6ed7b0b8ae8c0d67cbf4
parent9f13d4dd5ec420fb2fa0a7b94a6d66bb2700a492 (diff)
downloadopenssl-acde647fb0347f64af8f8678b73ce41f2f499c02.tar.gz
Fix EC_KEY_set_private_key() to call key->group->meth->set_private()
Fix a bug introduced by 6903e2e7e9a4 (Extended EC_METHOD customisation support., 2016-02-01). key->meth->set_private() is wrongly called where it should call key->group->meth->set_private(). PR#4517 Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Stephen Henson <steve@openssl.org>
-rw-r--r--crypto/ec/ec_key.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c
index f7948ccab2..22c6535e30 100644
--- a/crypto/ec/ec_key.c
+++ b/crypto/ec/ec_key.c
@@ -483,8 +483,8 @@ int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *priv_key)
{
if (key->group == NULL || key->group->meth == NULL)
return 0;
- if (key->group->meth->set_private
- && key->meth->set_private(key, priv_key) == 0)
+ if (key->group->meth->set_private != NULL
+ && key->group->meth->set_private(key, priv_key) == 0)
return 0;
if (key->meth->set_private != NULL
&& key->meth->set_private(key, priv_key) == 0)