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

Unified Diff: net/ssl/ssl_cipher_suite_names_unittest.cc

Issue 2012353002: Add CECPQ1 ciphers to the cipher suites table. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing mab's comments Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/ssl/ssl_cipher_suite_names.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f86367710832693ba7bb9acdc07f3b5680c09e5d 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,43 @@ TEST(CipherSuiteNamesTest, HTTP2CipherSuites) {
0xcca9 /* ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 */));
}
+TEST(CipherSuiteNamesTest, CECPQ1) {
+ const std::vector<uint16_t> kCECPQ1CipherSuites = {
+ 0x16b7, // TLS_CECPQ1_RSA_WITH_CHACHA20_POLY1305_SHA256 (non-standard)
+ 0x16b8, // TLS_CECPQ1_ECDSA_WITH_CHACHA20_POLY1305_SHA256 (non-standard)
+ 0x16b9, // TLS_CECPQ1_RSA_WITH_AES_256_GCM_SHA384 (non-standard)
+ 0x16ba, // TLS_CECPQ1_ECDSA_WITH_AES_256_GCM_SHA384 (non-standard)
+ };
+ 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));
+ 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
« no previous file with comments | « net/ssl/ssl_cipher_suite_names.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698