mirror of
https://github.com/openssl/openssl.git
synced 2024-12-14 20:43:46 +08:00
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>
This commit is contained in:
parent
eb47aae5d3
commit
fe56d8e8a3
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user