Skip to content

Commit e3c72fb

Browse files
seism0saurushasenradball
authored andcommitted
Only check the actual used lenght of the hash. (esp8266#8709)
1 parent fefcda6 commit e3c72fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/ESP8266WiFi/src/BearSSLHelpers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ extern "C" bool SigningVerifier_verify(PublicKey *_pubKey, UpdaterHashClass *has
945945
}
946946
br_rsa_pkcs1_vrfy vrfy = br_rsa_pkcs1_vrfy_get_default();
947947
bool ret = vrfy((const unsigned char *)signature, signatureLen, hash->oid(), hash->len(), _pubKey->getRSA(), vrf);
948-
if (!ret || memcmp(vrf, hash->hash(), sizeof(vrf)) ) {
948+
if (!ret || memcmp(vrf, hash->hash(), std::min(HashLengthMax, hash->len())) ) {
949949
return false;
950950
} else {
951951
return true;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy