mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-06-20 03:44:15 +08:00
fix: use constant-time comparisons for auth tags
This commit is contained in:
@@ -161,7 +161,7 @@ int sm4_cbc_sm3_hmac_decrypt_finish(SM4_CBC_SM3_HMAC_CTX *ctx, uint8_t *out, siz
|
||||
error_print();
|
||||
return -1;
|
||||
}
|
||||
if (memcmp(mac, ctx->mac, SM3_HMAC_SIZE) != 0) {
|
||||
if (gmssl_secure_memcmp(mac, ctx->mac, SM3_HMAC_SIZE) != 0) {
|
||||
error_print();
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user