mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-07 00:46:17 +08:00
Merge pull request #539 from ZZMarquis/patch-2
[bugfix] EC_KEY_set_ECCrefPublicKey转换过程中未处理字节数组偏移
This commit is contained in:
@@ -119,11 +119,11 @@ int EC_KEY_set_ECCrefPublicKey(EC_KEY *ec_key, const ECCrefPublicKey *ref)
|
||||
/* ECCrefPublicKey ==> EC_KEY */
|
||||
nbytes = (ref->bits + 7)/8;
|
||||
|
||||
if (!(x = BN_bin2bn(ref->x, nbytes, NULL))) {
|
||||
if (!(x = BN_bin2bn(ref->x + ECCref_MAX_LEN - nbytes, nbytes, NULL))) {
|
||||
GMAPIerr(GMAPI_F_EC_KEY_SET_ECCREFPUBLICKEY, ERR_R_BN_LIB);
|
||||
goto end;
|
||||
}
|
||||
if (!(y = BN_bin2bn(ref->y, nbytes, NULL))) {
|
||||
if (!(y = BN_bin2bn(ref->y + ECCref_MAX_LEN - nbytes, nbytes, NULL))) {
|
||||
GMAPIerr(GMAPI_F_EC_KEY_SET_ECCREFPUBLICKEY, ERR_R_BN_LIB);
|
||||
goto end;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user