Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(525)

Unified Diff: Source/core/frame/SubresourceIntegrityTest.cpp

Issue 798043002: SRI: Accept dashed hash algorithms. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Feedback. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/frame/SubresourceIntegrity.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/SubresourceIntegrityTest.cpp
diff --git a/Source/core/frame/SubresourceIntegrityTest.cpp b/Source/core/frame/SubresourceIntegrityTest.cpp
index f6fd01512513d1418d9543394219175898011fd0..e038cbcf2c9f23910731aae6b0082950fedcbf76 100644
--- a/Source/core/frame/SubresourceIntegrityTest.cpp
+++ b/Source/core/frame/SubresourceIntegrityTest.cpp
@@ -135,12 +135,12 @@ TEST_F(SubresourceIntegrityTest, ParseAlgorithm)
expectAlgorithm("sha256;", HashAlgorithmSha256);
expectAlgorithm("sha384;", HashAlgorithmSha384);
expectAlgorithm("sha512;", HashAlgorithmSha512);
+ expectAlgorithm("sha-256;", HashAlgorithmSha256);
+ expectAlgorithm("sha-384;", HashAlgorithmSha384);
+ expectAlgorithm("sha-512;", HashAlgorithmSha512);
expectAlgorithmFailure("sha1;");
expectAlgorithmFailure("sha-1;");
- expectAlgorithmFailure("sha-256;");
- expectAlgorithmFailure("sha-384;");
- expectAlgorithmFailure("sha-512;");
}
TEST_F(SubresourceIntegrityTest, ParseDigest)
@@ -173,6 +173,11 @@ TEST_F(SubresourceIntegrityTest, Parsing)
HashAlgorithmSha256);
expectParse(
+ "ni:///sha-256;BpfBw7ivV8q2jLiT13fxDYAe2tJllusRSZ273h2nFSE=",
+ "BpfBw7ivV8q2jLiT13fxDYAe2tJllusRSZ273h2nFSE=",
+ HashAlgorithmSha256);
+
+ expectParse(
" ni:///sha256;BpfBw7ivV8q2jLiT13fxDYAe2tJllusRSZ273h2nFSE= ",
"BpfBw7ivV8q2jLiT13fxDYAe2tJllusRSZ273h2nFSE=",
HashAlgorithmSha256);
@@ -183,9 +188,19 @@ TEST_F(SubresourceIntegrityTest, Parsing)
HashAlgorithmSha384);
expectParse(
+ "ni:///sha-384;XVVXBGoYw6AJOh9J/Z8pBDMVVPfkBpngexkA7JqZu8d5GENND6TEIup/tA1v5GPr",
+ "XVVXBGoYw6AJOh9J/Z8pBDMVVPfkBpngexkA7JqZu8d5GENND6TEIup/tA1v5GPr",
+ HashAlgorithmSha384);
+
+ expectParse(
"ni:///sha512;tbUPioKbVBplr0b1ucnWB57SJWt4x9dOE0Vy2mzCXvH3FepqDZ+07yMK81ytlg0MPaIrPAjcHqba5csorDWtKg==",
"tbUPioKbVBplr0b1ucnWB57SJWt4x9dOE0Vy2mzCXvH3FepqDZ+07yMK81ytlg0MPaIrPAjcHqba5csorDWtKg==",
HashAlgorithmSha512);
+
+ expectParse(
+ "ni:///sha-512;tbUPioKbVBplr0b1ucnWB57SJWt4x9dOE0Vy2mzCXvH3FepqDZ+07yMK81ytlg0MPaIrPAjcHqba5csorDWtKg==",
+ "tbUPioKbVBplr0b1ucnWB57SJWt4x9dOE0Vy2mzCXvH3FepqDZ+07yMK81ytlg0MPaIrPAjcHqba5csorDWtKg==",
+ HashAlgorithmSha512);
}
//
« no previous file with comments | « Source/core/frame/SubresourceIntegrity.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698