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

Unified Diff: net/quic/crypto/crypto_server_test.cc

Issue 2126053003: Require support for X509 certificates in QUIC CHLO PDMDs. Protected by --quic_require_x509 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@126432842
Patch Set: Created 4 years, 5 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/quic/crypto/quic_crypto_server_config.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/crypto_server_test.cc
diff --git a/net/quic/crypto/crypto_server_test.cc b/net/quic/crypto/crypto_server_test.cc
index d66f3cc6ae687399eec2bf5540402be5444f5807..91a4458b2261494999b2d0c57916bba0ba29712a 100644
--- a/net/quic/crypto/crypto_server_test.cc
+++ b/net/quic/crypto/crypto_server_test.cc
@@ -149,6 +149,7 @@ class CryptoServerTest : public ::testing::TestWithParam<TestParams> {
// clang-format off
CryptoHandshakeMessage client_hello = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"AEAD", "AESG",
"KEXS", "C255",
"PUBS", pub_hex_.c_str(),
@@ -399,6 +400,7 @@ TEST_P(CryptoServerTest, BadSNI) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"SNI", kBadSNIs[i],
"VER\0", client_version_string_.c_str(),
"$padding", static_cast<int>(kClientHelloMinimumSize),
@@ -448,6 +450,7 @@ TEST_P(CryptoServerTest, RejectTooLarge) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"AEAD", "AESG",
"KEXS", "C255",
"PUBS", pub_hex_.c_str(),
@@ -477,6 +480,7 @@ TEST_P(CryptoServerTest, RejectTooLargeButValidSTK) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"AEAD", "AESG",
"KEXS", "C255",
"PUBS", pub_hex_.c_str(),
@@ -508,6 +512,7 @@ TEST_P(CryptoServerTest, TooSmall) {
// clang-format off
ShouldFailMentioning("too small", CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"VER\0", client_version_string_.c_str(),
nullptr));
// clang-format on
@@ -531,6 +536,7 @@ TEST_P(CryptoServerTest, BadSourceAddressToken) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"STK", kBadSourceAddressTokens[i],
"VER\0", client_version_string_.c_str(),
"$padding", static_cast<int>(kClientHelloMinimumSize), nullptr);
@@ -556,6 +562,7 @@ TEST_P(CryptoServerTest, BadClientNonce) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"NONC", kBadNonces[i],
"VER\0", client_version_string_.c_str(),
"$padding", static_cast<int>(kClientHelloMinimumSize),
@@ -570,6 +577,7 @@ TEST_P(CryptoServerTest, BadClientNonce) {
// clang-format off
CryptoHandshakeMessage msg1 = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"AEAD", "AESG",
"KEXS", "C255",
"SCID", scid_hex_.c_str(),
@@ -597,6 +605,7 @@ TEST_P(CryptoServerTest, NoClientNonce) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"VER\0", client_version_string_.c_str(),
"$padding", static_cast<int>(kClientHelloMinimumSize),
nullptr);
@@ -610,6 +619,7 @@ TEST_P(CryptoServerTest, NoClientNonce) {
// clang-format off
CryptoHandshakeMessage msg1 = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"AEAD", "AESG",
"KEXS", "C255",
"SCID", scid_hex_.c_str(),
@@ -641,6 +651,7 @@ TEST_P(CryptoServerTest, DowngradeAttack) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"VER\0", bad_version.c_str(),
"$padding", static_cast<int>(kClientHelloMinimumSize),
nullptr);
@@ -656,6 +667,7 @@ TEST_P(CryptoServerTest, CorruptServerConfig) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"AEAD", "AESG",
"KEXS", "C255",
"SCID", (string(1, 'X') + scid_hex_).c_str(),
@@ -678,6 +690,7 @@ TEST_P(CryptoServerTest, CorruptSourceAddressToken) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"AEAD", "AESG",
"KEXS", "C255",
"SCID", scid_hex_.c_str(),
@@ -701,6 +714,7 @@ TEST_P(CryptoServerTest, CorruptClientNonceAndSourceAddressToken) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"AEAD", "AESG",
"KEXS", "C255",
"SCID", scid_hex_.c_str(),
@@ -724,6 +738,7 @@ TEST_P(CryptoServerTest, CorruptMultipleTags) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"AEAD", "AESG",
"KEXS", "C255",
"SCID", scid_hex_.c_str(),
@@ -758,6 +773,7 @@ TEST_P(CryptoServerTest, NoServerNonce) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"AEAD", "AESG",
"KEXS", "C255",
"SCID", scid_hex_.c_str(),
@@ -855,6 +871,7 @@ TEST_P(CryptoServerTest, RejectInvalidXlct) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"AEAD", "AESG",
"KEXS", "C255",
"SCID", scid_hex_.c_str(),
@@ -884,6 +901,7 @@ TEST_P(CryptoServerTest, ValidXlct) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"AEAD", "AESG",
"KEXS", "C255",
"SCID", scid_hex_.c_str(),
@@ -910,6 +928,7 @@ TEST_P(CryptoServerTest, NonceInSHLO) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"AEAD", "AESG",
"KEXS", "C255",
"SCID", scid_hex_.c_str(),
@@ -1022,6 +1041,7 @@ TEST_P(CryptoServerTestNoConfig, DontCrash) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"VER\0", client_version_string_.c_str(),
"$padding", static_cast<int>(kClientHelloMinimumSize),
nullptr);
@@ -1047,6 +1067,7 @@ TEST_P(CryptoServerTestOldVersion, ServerIgnoresXlct) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"AEAD", "AESG",
"KEXS", "C255",
"SCID", scid_hex_.c_str(),
@@ -1071,6 +1092,7 @@ TEST_P(CryptoServerTestOldVersion, XlctNotRequired) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"AEAD", "AESG",
"KEXS", "C255",
"SCID", scid_hex_.c_str(),
@@ -1116,6 +1138,7 @@ TEST_P(AsyncStrikeServerVerificationTest, AsyncReplayProtection) {
// clang-format off
CryptoHandshakeMessage msg = CryptoTestUtils::Message(
"CHLO",
+ "PDMD", "X509",
"AEAD", "AESG",
"KEXS", "C255",
"SCID", scid_hex_.c_str(),
« no previous file with comments | « no previous file | net/quic/crypto/quic_crypto_server_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698