Bug 1356522 - Remove unnecessary nsICryptoHash output CRLF filtering in nsCSPUtils.cpp. r=ckerschb
authorCykesiopka <cykesiopka.bmo@gmail.com>
Mon, 17 Apr 2017 17:34:18 +0800
changeset 353997 c1d7ee18b7d0bd59990d666473d47b8b31f4710b
parent 353996 b4bdc406fc1d750c0b19dd8a6ba7731f7072f5ce
child 353998 7492d1c0aad42af792d55fed897be329489f7219
push id31684
push usercbook@mozilla.com
push dateThu, 20 Apr 2017 09:13:26 +0000
treeherdermozilla-central@27311156637f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersckerschb
bugs1356522, 1338897
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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);
 }