aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-04-21 17:35:53 +0900
committerKazuki Yamaguchi <k@rhe.jp>2016-04-21 17:57:32 +0900
commit2708b7c5e2cb13223df8f9a320fc0d9438e13fcb (patch)
tree5e6a1157113dd32e7d74b0ff17cc4bef00e71f40
parenta043d0b91d62fd8526a3fd791e3ad2ebcf888cd9 (diff)
downloadopenssl-fix/EC_KEY_set_private_key-null.tar.gz
Fix EC_KEY_set_private_key() to call key->group->meth->set_private()fix/EC_KEY_set_private_key-null
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().
-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)