Chromium Code Reviews| Index: net/ssl/ssl_cipher_suite_names_unittest.cc |
| diff --git a/net/ssl/ssl_cipher_suite_names_unittest.cc b/net/ssl/ssl_cipher_suite_names_unittest.cc |
| index cfa26e0a6b20c262084bb70e331861fd3ffd20b1..f37bbdb4e9947a4089d792904d66e7b35394063a 100644 |
| --- a/net/ssl/ssl_cipher_suite_names_unittest.cc |
| +++ b/net/ssl/ssl_cipher_suite_names_unittest.cc |
| @@ -5,6 +5,7 @@ |
| #include "net/ssl/ssl_cipher_suite_names.h" |
| #include "base/macros.h" |
| +#include "base/strings/stringprintf.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| namespace net { |
| @@ -138,6 +139,39 @@ TEST(CipherSuiteNamesTest, HTTP2CipherSuites) { |
| 0xcca9 /* ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 */)); |
| } |
| +TEST(CipherSuiteNamesTest, CECPQ1) { |
| + const std::vector<uint16_t> kCECPQ1CipherSuites = {0x16b7, 0x16b8, 0x16b9, |
| + 0x16ba}; |
|
mab
2016/05/26 21:14:57
Using a loop seems inconsistent with the prevailin
agl
2016/05/26 23:26:08
Indeed, but I don't like the duplication here :)
|
| + const char *key_exchange, *cipher, *mac; |
| + bool is_aead; |
| + |
| + for (const uint16_t cipher_suite_id : kCECPQ1CipherSuites) { |
| + SCOPED_TRACE(base::StringPrintf("cipher suite %x", cipher_suite_id)); |
| + EXPECT_TRUE(IsTLSCipherSuiteAllowedByHTTP2(cipher_suite_id)); |
|
mab
2016/05/26 21:14:58
In the preceding stanza there is a "(non-standard)
agl
2016/05/26 23:26:08
Done.
|
| + EXPECT_TRUE(IsSecureTLSCipherSuite(cipher_suite_id)); |
| + SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, |
| + cipher_suite_id); |
| + EXPECT_TRUE(is_aead); |
| + EXPECT_EQ(nullptr, mac); |
| + } |
| + |
| + SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, 0x16b7); |
| + EXPECT_STREQ("CECPQ1_RSA", key_exchange); |
| + EXPECT_STREQ("CHACHA20_POLY1305", cipher); |
| + |
| + SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, 0x16b8); |
| + EXPECT_STREQ("CECPQ1_ECDSA", key_exchange); |
| + EXPECT_STREQ("CHACHA20_POLY1305", cipher); |
| + |
| + SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, 0x16b9); |
| + EXPECT_STREQ("CECPQ1_RSA", key_exchange); |
| + EXPECT_STREQ("AES_256_GCM", cipher); |
| + |
| + SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, 0x16ba); |
| + EXPECT_STREQ("CECPQ1_ECDSA", key_exchange); |
| + EXPECT_STREQ("AES_256_GCM", cipher); |
| +} |
| + |
| } // anonymous namespace |
| } // namespace net |