Skip to content

Commit

Permalink
Merge pull request #1480 from yetsing/fix-error-check-sm2_point_is_on…
Browse files Browse the repository at this point in the history
…_curve

Fix error check sm2_point_is_on_curve
  • Loading branch information
guanzhi authored Oct 12, 2023
2 parents ee1b09c + 40331e3 commit 65c9124
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/sm2_alg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/sm2_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 65c9124

Please sign in to comment.