From 169bfe080112fa3f4893e67e011832c0da244450 Mon Sep 17 00:00:00 2001 From: inoguchi Date: Thu, 20 Jan 2022 11:02:44 +0000 Subject: [PATCH] Fix check for BN_mod_inverse_ct return value ok jsing@ millert@ tb@ --- lib/libcrypto/ec/ecp_smpl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libcrypto/ec/ecp_smpl.c b/lib/libcrypto/ec/ecp_smpl.c index 1d0b1d6106b..6f5280bbc97 100644 --- a/lib/libcrypto/ec/ecp_smpl.c +++ b/lib/libcrypto/ec/ecp_smpl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecp_smpl.c,v 1.33 2021/09/08 17:29:21 tb Exp $ */ +/* $OpenBSD: ecp_smpl.c,v 1.34 2022/01/20 11:02:44 inoguchi Exp $ */ /* Includes code written by Lenka Fibikova * for the OpenSSL project. * Includes code written by Bodo Moeller for the OpenSSL project. @@ -586,7 +586,7 @@ ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP * group, const EC_POIN } } } else { - if (!BN_mod_inverse_ct(Z_1, Z_, &group->field, ctx)) { + if (BN_mod_inverse_ct(Z_1, Z_, &group->field, ctx) == NULL) { ECerror(ERR_R_BN_LIB); goto err; } @@ -1316,7 +1316,7 @@ ec_GFp_simple_points_make_affine(const EC_GROUP * group, size_t num, EC_POINT * /* invert heap[1] */ if (!BN_is_zero(heap[1])) { - if (!BN_mod_inverse_ct(heap[1], heap[1], &group->field, ctx)) { + if (BN_mod_inverse_ct(heap[1], heap[1], &group->field, ctx) == NULL) { ECerror(ERR_R_BN_LIB); goto err; } -- 2.20.1