os3sec / Extended-DNSSEC-Validator

Firefox add-on for verification of x509 certificates using DNSSEC as bootstrap mechanism
http://os3sec.org
15 stars 9 forks source link

Incorrect hash comparison #13

Closed lampeh closed 12 years ago

lampeh commented 13 years ago

In my tests, the hasher repeats the first byte after the hash and prevents successful comparison to the TLSA value:

extval: checking tlsa record: 66749697B26211E9AB46AC498D7FF023A882CE988A608994DA8EBE0872A196A3666666666666 / 66749697B26211E9AB46AC498D7FF023A882CE988A608994DA8EBE0872A196A3

Cutting the hash to the appropriate length restores validation:

extval: checking tlsa record: 66749697B26211E9AB46AC498D7FF023A882CE988A608994DA8EBE0872A196A3 / 66749697B26211E9AB46AC498D7FF023A882CE988A608994DA8EBE0872A196A3 extval: dns_trusted = true extval: Changing state to: certDNSSEC(www.hauke-lampe.de)

This patch works for me:

--- Extended-DNSSEC-Validator/add-on/content/Extval.CertTools.js.orig +++ Extended-DNSSEC-Validator/add-on/content/Extval.CertTools.js @@ -125,11 +125,14 @@ check_cert: function(cert, tlsa_record) { var ihash = Components.interfaces.nsICryptoHash; var hasher = Components.classes["@mozilla.org/security/hash;1"].createInstance(ihash);

dannygroenewegen commented 12 years ago

Thanks! Applied this fix in 0.6