Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BIGNUM编码的r/s长度不一定等于32,有可能前面会补0 #1577

Open
wants to merge 1 commit into
base: GmSSL-v2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions crypto/gmapi/gmapi_sdf_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,12 +520,6 @@ int ECDSA_SIG_set_ECCSignature(ECDSA_SIG *sig, const ECCSignature *ref)
GMAPIerr(GMAPI_F_ECDSA_SIG_SET_ECCSIGNATURE, ERR_R_BN_LIB);
goto end;
}
/* when using `sm2p256v1`, we need to check (s, r) length correct */
if (BN_num_bytes(r) != 256/8 || BN_num_bytes(s) != 256/8) {
GMAPIerr(GMAPI_F_ECDSA_SIG_SET_ECCSIGNATURE,
GMAPI_R_INVALID_SM2_SIGNATURE);
goto end;
}

/* set return value
* `ECDSA_SIG_set0` should make sure that if failed, do not accept
Expand Down