Bug 1356522 - Remove unnecessary nsICryptoHash output CRLF filtering in nsCSPUtils.cpp. r?ckerschb
This filtering is no longer necessary now that the fix for
Bug 1338897 has landed and
has gotten rid of the CRLF behaviour.
MozReview-Commit-ID: 9OKmrtQN3Cq
--- a/dom/security/nsCSPUtils.cpp
+++ b/dom/security/nsCSPUtils.cpp
@@ -914,20 +914,16 @@ nsCSPHashSrc::allows(enum CSPKeyword aKe
rv = hasher->Update((uint8_t *)utf8_hash.get(), utf8_hash.Length());
NS_ENSURE_SUCCESS(rv, false);
nsAutoCString hash;
rv = hasher->Finish(true, hash);
NS_ENSURE_SUCCESS(rv, false);
- // The NSS Base64 encoder automatically adds linebreaks "\r\n" every 64
- // characters. We need to remove these so we can properly validate longer
- // (SHA-512) base64-encoded hashes
- hash.StripChars("\r\n");
return NS_ConvertUTF16toUTF8(mHash).Equals(hash);
}
bool
nsCSPHashSrc::visit(nsCSPSrcVisitor* aVisitor) const
{
return aVisitor->visitHashSrc(*this);
}