summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ecp_oct.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ecp_oct.c')
-rw-r--r--src/lib/libcrypto/ec/ecp_oct.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/libcrypto/ec/ecp_oct.c b/src/lib/libcrypto/ec/ecp_oct.c
index 90c5ca2e4e..29d9990546 100644
--- a/src/lib/libcrypto/ec/ecp_oct.c
+++ b/src/lib/libcrypto/ec/ecp_oct.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecp_oct.c,v 1.11 2018/07/15 16:27:39 tb Exp $ */ 1/* $OpenBSD: ecp_oct.c,v 1.12 2020/12/04 08:55:30 tb Exp $ */
2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de> 2/* Includes code written by Lenka Fibikova <fibikova@exp-math.uni-essen.de>
3 * for the OpenSSL project. 3 * for the OpenSSL project.
4 * Includes code written by Bodo Moeller for the OpenSSL project. 4 * Includes code written by Bodo Moeller for the OpenSSL project.
@@ -362,6 +362,10 @@ ec_GFp_simple_oct2point(const EC_GROUP * group, EC_POINT * point,
362 goto err; 362 goto err;
363 } 363 }
364 if (form == POINT_CONVERSION_COMPRESSED) { 364 if (form == POINT_CONVERSION_COMPRESSED) {
365 /*
366 * EC_POINT_set_compressed_coordinates_GFp checks that the point
367 * is on the curve as required by X9.62.
368 */
365 if (!EC_POINT_set_compressed_coordinates_GFp(group, point, x, y_bit, ctx)) 369 if (!EC_POINT_set_compressed_coordinates_GFp(group, point, x, y_bit, ctx))
366 goto err; 370 goto err;
367 } else { 371 } else {
@@ -377,15 +381,14 @@ ec_GFp_simple_oct2point(const EC_GROUP * group, EC_POINT * point,
377 goto err; 381 goto err;
378 } 382 }
379 } 383 }
384 /*
385 * EC_POINT_set_affine_coordinates_GFp checks that the point is
386 * on the curve as required by X9.62.
387 */
380 if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) 388 if (!EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx))
381 goto err; 389 goto err;
382 } 390 }
383 391
384 /* test required by X9.62 */
385 if (EC_POINT_is_on_curve(group, point, ctx) <= 0) {
386 ECerror(EC_R_POINT_IS_NOT_ON_CURVE);
387 goto err;
388 }
389 ret = 1; 392 ret = 1;
390 393
391 err: 394 err: