Fix sm2_bn_from_asn1_integer bug

This commit is contained in:
Zhi Guan
2022-12-22 22:15:21 +08:00
parent 18381f52f0
commit 765a90815b

View File

@@ -196,7 +196,7 @@ int sm2_bn_from_asn1_integer(SM2_BN r, const uint8_t *d, size_t dlen)
error_print();
return -1;
}
memcmp(buf + sizeof(buf) - dlen, d, dlen);
memcpy(buf + sizeof(buf) - dlen, d, dlen);
sm2_bn_from_bytes(r, buf);
return 1;
}