提交 fe56d8e8 编写于 作者: D David Benjamin 提交者: Emilia Kasper

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: NRich Salz <rsalz@openssl.org>
Reviewed-by: NEmilia Käsper <emilia@openssl.org>
上级 eb47aae5
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册