mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
Only check the actual used lenght of the hash. (#8709)
This commit is contained in:
parent
3a2fe9ff0f
commit
80bf716625
@ -945,7 +945,7 @@ extern "C" bool SigningVerifier_verify(PublicKey *_pubKey, UpdaterHashClass *has
|
||||
}
|
||||
br_rsa_pkcs1_vrfy vrfy = br_rsa_pkcs1_vrfy_get_default();
|
||||
bool ret = vrfy((const unsigned char *)signature, signatureLen, hash->oid(), hash->len(), _pubKey->getRSA(), vrf);
|
||||
if (!ret || memcmp(vrf, hash->hash(), sizeof(vrf)) ) {
|
||||
if (!ret || memcmp(vrf, hash->hash(), std::min(HashLengthMax, hash->len())) ) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user