From 91a20916faa95c10d5d902017deaddec16e748f5 Mon Sep 17 00:00:00 2001 From: yesting Date: Wed, 26 Apr 2023 00:02:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sm2_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sm2_key.c b/src/sm2_key.c index 677370439..e376d6b78 100644 --- a/src/sm2_key.c +++ b/src/sm2_key.c @@ -86,7 +86,7 @@ int sm2_key_set_public_key(SM2_KEY *key, const SM2_POINT *public_key) error_print(); return -1; } - if (!sm2_point_is_on_curve(public_key)) { + if (sm2_point_is_on_curve(public_key) != 1) { error_print(); return -1; } From 40331e3bfe566f69799546e01bffe2883fff52eb Mon Sep 17 00:00:00 2001 From: yesting Date: Wed, 26 Apr 2023 00:06:08 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sm2_alg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sm2_alg.c b/src/sm2_alg.c index 4eb24fad4..7b2c2e762 100644 --- a/src/sm2_alg.c +++ b/src/sm2_alg.c @@ -1127,7 +1127,7 @@ int sm2_point_from_x(SM2_POINT *P, const uint8_t x[32], int y) sm2_bn_clean(_g); sm2_bn_clean(_z); - if (!sm2_point_is_on_curve(P)) { + if (sm2_point_is_on_curve(P) != 1) { error_print(); return -1; }