summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec2_oct.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ec2_oct.c')
-rw-r--r--src/lib/libcrypto/ec/ec2_oct.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/libcrypto/ec/ec2_oct.c b/src/lib/libcrypto/ec/ec2_oct.c
index 268eccf471..5f7f7e3c99 100644
--- a/src/lib/libcrypto/ec/ec2_oct.c
+++ b/src/lib/libcrypto/ec/ec2_oct.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec2_oct.c,v 1.11 2018/07/15 16:27:39 tb Exp $ */ 1/* $OpenBSD: ec2_oct.c,v 1.12 2020/12/04 08:55:30 tb Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
4 * 4 *
@@ -346,6 +346,10 @@ ec_GF2m_simple_oct2point(const EC_GROUP *group, EC_POINT *point,
346 goto err; 346 goto err;
347 } 347 }
348 if (form == POINT_CONVERSION_COMPRESSED) { 348 if (form == POINT_CONVERSION_COMPRESSED) {
349 /*
350 * EC_POINT_set_compressed_coordinates_GF2m checks that the
351 * point is on the curve as required by X9.62.
352 */
349 if (!EC_POINT_set_compressed_coordinates_GF2m(group, point, x, y_bit, ctx)) 353 if (!EC_POINT_set_compressed_coordinates_GF2m(group, point, x, y_bit, ctx))
350 goto err; 354 goto err;
351 } else { 355 } else {
@@ -363,15 +367,14 @@ ec_GF2m_simple_oct2point(const EC_GROUP *group, EC_POINT *point,
363 goto err; 367 goto err;
364 } 368 }
365 } 369 }
370 /*
371 * EC_POINT_set_affine_coordinates_GF2m checks that the
372 * point is on the curve as required by X9.62.
373 */
366 if (!EC_POINT_set_affine_coordinates_GF2m(group, point, x, y, ctx)) 374 if (!EC_POINT_set_affine_coordinates_GF2m(group, point, x, y, ctx))
367 goto err; 375 goto err;
368 } 376 }
369 377
370 /* test required by X9.62 */
371 if (EC_POINT_is_on_curve(group, point, ctx) <= 0) {
372 ECerror(EC_R_POINT_IS_NOT_ON_CURVE);
373 goto err;
374 }
375 ret = 1; 378 ret = 1;
376 379
377 err: 380 err: