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

Side by Side Diff: net/ssl/ssl_cipher_suite_names_unittest.cc

Issue 291093002: Fail the SPDY transaction if it does not meet TLS base requirements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address forgotten comment. Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/ssl/ssl_cipher_suite_names.cc ('k') | net/ssl/ssl_connection_status_flags.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/ssl/ssl_cipher_suite_names.h" 5 #include "net/ssl/ssl_cipher_suite_names.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace net { 10 namespace net {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 "0x004", 49 "0x004",
50 "0xBEEFY", 50 "0xBEEFY",
51 }; 51 };
52 52
53 for (size_t i = 0; i < arraysize(cipher_strings); ++i) { 53 for (size_t i = 0; i < arraysize(cipher_strings); ++i) {
54 uint16 cipher_suite = 0; 54 uint16 cipher_suite = 0;
55 EXPECT_FALSE(ParseSSLCipherString(cipher_strings[i], &cipher_suite)); 55 EXPECT_FALSE(ParseSSLCipherString(cipher_strings[i], &cipher_suite));
56 } 56 }
57 } 57 }
58 58
59 TEST(CipherSuiteNamesTest, SecureCipherSuites) {
60 // Picked some random cipher suites.
61 EXPECT_FALSE(IsSecureTLSCipherSuite(0x0));
62 EXPECT_FALSE(IsSecureTLSCipherSuite(0x39));
63 EXPECT_FALSE(IsSecureTLSCipherSuite(0xc5));
64 EXPECT_FALSE(IsSecureTLSCipherSuite(0xc00f));
65 EXPECT_FALSE(IsSecureTLSCipherSuite(0xc083));
66
67 // Non-existent cipher suite.
68 EXPECT_FALSE(IsSecureTLSCipherSuite(0xffff)) << "Doesn't exist!";
69
70 // Secure ones.
71 EXPECT_TRUE(IsSecureTLSCipherSuite(0xcc13));
72 EXPECT_TRUE(IsSecureTLSCipherSuite(0xcc14));
73 }
74
59 } // anonymous namespace 75 } // anonymous namespace
60 76
61 } // namespace net 77 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/ssl_cipher_suite_names.cc ('k') | net/ssl/ssl_connection_status_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698