OLD | NEW |
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 Loading... |
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 |
OLD | NEW |