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

Unified Diff: components/proximity_auth/cryptauth/base64url_unittest.cc

Issue 1170363002: [Proximity auth] Disallow '+' and '/' in incoming base64-encoded strings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months 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 | « components/proximity_auth/cryptauth/base64url.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/proximity_auth/cryptauth/base64url_unittest.cc
diff --git a/components/proximity_auth/cryptauth/base64url_unittest.cc b/components/proximity_auth/cryptauth/base64url_unittest.cc
index 88fd16c6283f436817dbb0bd14ef9289c115bc9a..b24425a0f23287a0126db929afa6700d0e3b76d3 100644
--- a/components/proximity_auth/cryptauth/base64url_unittest.cc
+++ b/components/proximity_auth/cryptauth/base64url_unittest.cc
@@ -64,4 +64,16 @@ TEST(ProximityAuthBase64UrlTest, DecodeSpecialCharacters) {
EXPECT_EQ("/+Y=", non_web_safe_encoded);
}
+TEST(ProximityAuthBase64UrlTest, DecodeBailsOnPlus) {
+ const std::string encoded = "_+Y=";
+ std::string decoded;
+ EXPECT_FALSE(Base64UrlDecode(encoded, &decoded));
+}
+
+TEST(ProximityAuthBase64UrlTest, DecodeBailsOnSlash) {
+ const std::string encoded = "/-Y=";
Ryan Sleevi 2015/06/09 22:39:48 Just to confirm: Are these valid b64strings otherw
Ilya Sherman 2015/06/09 23:08:40 Done. "/+Y=" is the string that's tested above; b
+ std::string decoded;
+ EXPECT_FALSE(Base64UrlDecode(encoded, &decoded));
+}
+
} // namespace proximity_auth
« no previous file with comments | « components/proximity_auth/cryptauth/base64url.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698