提交 29b490a4 编写于 作者: P Piotr Sikora 提交者: Dr. Stephen Henson

Fix SSL_OP_SINGLE_ECDH_USE

Don't require a public key in tls1_set_ec_id if compression status is
not needed. This fixes a bug where SSL_OP_SINGLE_ECDH_USE wouldn't work.
(cherry picked from commit 5ff68e8f6dac3b0d8997b8bc379f9111c2bab74f)
上级 a9bc1af9
...@@ -590,14 +590,12 @@ static int tls1_set_ec_id(unsigned char *curve_id, unsigned char *comp_id, ...@@ -590,14 +590,12 @@ static int tls1_set_ec_id(unsigned char *curve_id, unsigned char *comp_id,
{ {
int is_prime, id; int is_prime, id;
const EC_GROUP *grp; const EC_GROUP *grp;
const EC_POINT *pt;
const EC_METHOD *meth; const EC_METHOD *meth;
if (!ec) if (!ec)
return 0; return 0;
/* Determine if it is a prime field */ /* Determine if it is a prime field */
grp = EC_KEY_get0_group(ec); grp = EC_KEY_get0_group(ec);
pt = EC_KEY_get0_public_key(ec); if (!grp)
if (!grp || !pt)
return 0; return 0;
meth = EC_GROUP_method_of(grp); meth = EC_GROUP_method_of(grp);
if (!meth) if (!meth)
...@@ -625,6 +623,8 @@ static int tls1_set_ec_id(unsigned char *curve_id, unsigned char *comp_id, ...@@ -625,6 +623,8 @@ static int tls1_set_ec_id(unsigned char *curve_id, unsigned char *comp_id,
} }
if (comp_id) if (comp_id)
{ {
if (EC_KEY_get0_public_key(ec) == NULL)
return 0;
if (EC_KEY_get_conv_form(ec) == POINT_CONVERSION_COMPRESSED) if (EC_KEY_get_conv_form(ec) == POINT_CONVERSION_COMPRESSED)
{ {
if (is_prime) if (is_prime)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册