diff options
Diffstat (limited to 'src/lib/libcrypto/ec/ec_oct.c')
-rw-r--r-- | src/lib/libcrypto/ec/ec_oct.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/lib/libcrypto/ec/ec_oct.c b/src/lib/libcrypto/ec/ec_oct.c index f44b174fd7..a285c81459 100644 --- a/src/lib/libcrypto/ec/ec_oct.c +++ b/src/lib/libcrypto/ec/ec_oct.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ec_oct.c,v 1.5 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: ec_oct.c,v 1.6 2020/12/04 08:55:30 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Originally written by Bodo Moeller for the OpenSSL project. | 3 | * Originally written by Bodo Moeller for the OpenSSL project. |
4 | */ | 4 | */ |
@@ -98,7 +98,14 @@ EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP * group, EC_POINT * point | |||
98 | group, point, x, y_bit, ctx); | 98 | group, point, x, y_bit, ctx); |
99 | #endif | 99 | #endif |
100 | } | 100 | } |
101 | return group->meth->point_set_compressed_coordinates(group, point, x, y_bit, ctx); | 101 | if (!group->meth->point_set_compressed_coordinates(group, point, x, |
102 | y_bit, ctx)) | ||
103 | return 0; | ||
104 | if (EC_POINT_is_on_curve(group, point, ctx) <= 0) { | ||
105 | ECerror(EC_R_POINT_IS_NOT_ON_CURVE); | ||
106 | return 0; | ||
107 | } | ||
108 | return 1; | ||
102 | } | 109 | } |
103 | 110 | ||
104 | #ifndef OPENSSL_NO_EC2M | 111 | #ifndef OPENSSL_NO_EC2M |
@@ -123,7 +130,14 @@ EC_POINT_set_compressed_coordinates_GF2m(const EC_GROUP * group, EC_POINT * poin | |||
123 | return ec_GF2m_simple_set_compressed_coordinates( | 130 | return ec_GF2m_simple_set_compressed_coordinates( |
124 | group, point, x, y_bit, ctx); | 131 | group, point, x, y_bit, ctx); |
125 | } | 132 | } |
126 | return group->meth->point_set_compressed_coordinates(group, point, x, y_bit, ctx); | 133 | if (!group->meth->point_set_compressed_coordinates(group, point, x, |
134 | y_bit, ctx)) | ||
135 | return 0; | ||
136 | if (EC_POINT_is_on_curve(group, point, ctx) <= 0) { | ||
137 | ECerror(EC_R_POINT_IS_NOT_ON_CURVE); | ||
138 | return 0; | ||
139 | } | ||
140 | return 1; | ||
127 | } | 141 | } |
128 | #endif | 142 | #endif |
129 | 143 | ||