mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-18 10:34:19 +00:00
Merge pull request #844 from antonio-nino-diaz-arm/an/no-timingsafe
Revert "tbbr: Use constant-time bcmp() to compare hashes"
This commit is contained in:
commit
93f398205a
2 changed files with 2 additions and 2 deletions
|
@ -217,7 +217,7 @@ static int verify_hash(void *data_ptr, unsigned int data_len,
|
|||
}
|
||||
|
||||
/* Compare values */
|
||||
rc = timingsafe_bcmp(data_hash, hash, mbedtls_md_get_size(md_info));
|
||||
rc = memcmp(data_hash, hash, mbedtls_md_get_size(md_info));
|
||||
if (rc != 0) {
|
||||
return CRYPTO_ERR_HASH;
|
||||
}
|
||||
|
|
|
@ -393,7 +393,7 @@ static int cert_parse(void *img, unsigned int img_len)
|
|||
if (sig_alg1.len != sig_alg2.len) {
|
||||
return IMG_PARSER_ERR_FORMAT;
|
||||
}
|
||||
if (0 != timingsafe_bcmp(sig_alg1.p, sig_alg2.p, sig_alg1.len)) {
|
||||
if (0 != memcmp(sig_alg1.p, sig_alg2.p, sig_alg1.len)) {
|
||||
return IMG_PARSER_ERR_FORMAT;
|
||||
}
|
||||
memcpy(&sig_alg, &sig_alg1, sizeof(sig_alg));
|
||||
|
|
Loading…
Add table
Reference in a new issue