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

Unified Diff: net/cert/internal/verify_name_match_unittest.cc

Issue 1160643002: Remove dangerous std::string constructor for der::Input (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Put helper in anonymous namespace 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 | « no previous file | net/der/input.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/cert/internal/verify_name_match_unittest.cc
diff --git a/net/cert/internal/verify_name_match_unittest.cc b/net/cert/internal/verify_name_match_unittest.cc
index 0bdce8a028ac56ee7b8dd92e0d91257a57273100..b7e16ad0ade4b5102543a36992a3865836c6fc39 100644
--- a/net/cert/internal/verify_name_match_unittest.cc
+++ b/net/cert/internal/verify_name_match_unittest.cc
@@ -11,10 +11,13 @@ namespace net {
TEST(VerifyNameMatchTest, Simple) {
// TODO(mattm): Use valid Names.
- EXPECT_TRUE(VerifyNameMatch(der::Input("hello"), der::Input("hello")));
- EXPECT_FALSE(VerifyNameMatch(der::Input("aello"), der::Input("hello")));
- EXPECT_FALSE(VerifyNameMatch(der::Input("hello"), der::Input("hello1")));
- EXPECT_FALSE(VerifyNameMatch(der::Input("hello1"), der::Input("hello")));
+ const uint8_t hello[] = {'h', 'e', 'l', 'l', 'o'};
+ const uint8_t aello[] = {'a', 'e', 'l', 'l', 'o'};
+ const uint8_t hello1[] = {'h', 'e', 'l', 'l', 'o', '1'};
+ EXPECT_TRUE(VerifyNameMatch(der::Input(hello), der::Input(hello)));
+ EXPECT_FALSE(VerifyNameMatch(der::Input(aello), der::Input(hello)));
+ EXPECT_FALSE(VerifyNameMatch(der::Input(hello), der::Input(hello1)));
+ EXPECT_FALSE(VerifyNameMatch(der::Input(hello1), der::Input(hello)));
}
} // namespace net
« no previous file with comments | « no previous file | net/der/input.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698