From: tb Date: Thu, 24 Nov 2022 16:35:32 +0000 (+0000) Subject: Merge the second y_bit check into the first one where it belongs X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=fd932388b2d770011871c4c62732089425b3b100;p=openbsd Merge the second y_bit check into the first one where it belongs suggested by jsing --- diff --git a/lib/libcrypto/ec/ecp_oct.c b/lib/libcrypto/ec/ecp_oct.c index 5e3484e2bcf..354ae5489d9 100644 --- a/lib/libcrypto/ec/ecp_oct.c +++ b/lib/libcrypto/ec/ecp_oct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecp_oct.c,v 1.17 2022/11/24 16:34:13 tb Exp $ */ +/* $OpenBSD: ecp_oct.c,v 1.18 2022/11/24 16:35:32 tb Exp $ */ /* Includes code written by Lenka Fibikova * for the OpenSSL project. * Includes code written by Bodo Moeller for the OpenSSL project. @@ -167,10 +167,10 @@ ec_GFp_simple_set_compressed_coordinates(const EC_GROUP *group, } if (!BN_usub(y, &group->field, y)) goto err; - } - if (y_bit != BN_is_odd(y)) { - ECerror(ERR_R_INTERNAL_ERROR); - goto err; + if (y_bit != BN_is_odd(y)) { + ECerror(ERR_R_INTERNAL_ERROR); + goto err; + } } if (!EC_POINT_set_affine_coordinates(group, point, x, y, ctx)) goto err;