diff options
author | David Benjamin <davidben@google.com> | 2016-03-07 09:57:58 -0500 |
---|---|---|
committer | Emilia Kasper <emilia@openssl.org> | 2016-03-29 20:03:48 +0200 |
commit | fe56d8e8a3665dc7e6784e0c170f790e6df8153f (patch) | |
tree | 739fa5589676ea422aae96520fdac3db861c53f9 /crypto | |
parent | eb47aae5d33de3d39379c15e20cbbd12ea8a29be (diff) |
RT 4393: Call EC_GROUP_order_bits in priv2opt.
The private key is a scalar and should be sized by the order, not the
degree. See RFC 5915.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/ec/ec_key.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index d241154630..f7948ccab2 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -607,7 +607,7 @@ size_t ec_key_simple_priv2oct(const EC_KEY *eckey, { size_t buf_len; - buf_len = (EC_GROUP_get_degree(eckey->group) + 7) / 8; + buf_len = (EC_GROUP_order_bits(eckey->group) + 7) / 8; if (eckey->priv_key == NULL) return 0; if (buf == NULL) |