Bug 1356522 - Remove unnecessary nsICryptoHash output CRLF filtering in nsCSPUtils.cpp. r?ckerschb draft
authorCykesiopka <cykesiopka.bmo@gmail.com>
Mon, 17 Apr 2017 17:34:18 +0800
changeset 563587 c2cdacf66af5d0007eacd26aac5783603bf0edcc
parent 563410 c697e756f738ce37abc56f31bfbc48f55625d617
child 624517 2a8b3a49b6914989c30e0961f9a7db1feb2cfffe
push id54358
push usercykesiopka.bmo@gmail.com
push dateMon, 17 Apr 2017 09:34:42 +0000
reviewersckerschb
bugs1356522, 1338897
milestone55.0a1
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
dom/security/nsCSPUtils.cpp
--- 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);
 }