You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2018/02/19 02:49:56 UTC
[trafficserver] 02/03: Don't send transport parameters on
NEW_SESSION_TIKECT messages
This is an automated email from the ASF dual-hosted git repository.
maskit pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 9e3d6220f37eb5e225aeb4c6f796dfe0549e9fb6
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Mon Feb 19 11:42:31 2018 +0900
Don't send transport parameters on NEW_SESSION_TIKECT messages
---
iocore/net/QUICNetProcessor.cc | 3 +--
iocore/net/quic/QUICHandshake.cc | 23 ++---------------------
iocore/net/quic/QUICHandshake.h | 2 +-
iocore/net/quic/QUICTransportParameters.cc | 6 +-----
4 files changed, 5 insertions(+), 29 deletions(-)
diff --git a/iocore/net/QUICNetProcessor.cc b/iocore/net/QUICNetProcessor.cc
index 979af87..1ab0027 100644
--- a/iocore/net/QUICNetProcessor.cc
+++ b/iocore/net/QUICNetProcessor.cc
@@ -86,8 +86,7 @@ QUICNetProcessor::start(int, size_t stacksize)
SSL_CTX_set_alpn_select_cb(this->_ssl_ctx, QUIC::ssl_select_next_protocol, nullptr);
SSL_CTX_add_custom_ext(this->_ssl_ctx, QUICTransportParametersHandler::TRANSPORT_PARAMETER_ID,
- SSL_EXT_TLS_ONLY | SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS |
- SSL_EXT_TLS1_3_NEW_SESSION_TICKET,
+ SSL_EXT_TLS_ONLY | SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS,
&QUICTransportParametersHandler::add, &QUICTransportParametersHandler::free, nullptr,
&QUICTransportParametersHandler::parse, nullptr);
diff --git a/iocore/net/quic/QUICHandshake.cc b/iocore/net/quic/QUICHandshake.cc
index 3f48a6d..9014d8d 100644
--- a/iocore/net/quic/QUICHandshake.cc
+++ b/iocore/net/quic/QUICHandshake.cc
@@ -247,28 +247,9 @@ QUICHandshake::set_transport_parameters(std::shared_ptr<QUICTransportParametersI
}
std::shared_ptr<const QUICTransportParameters>
-QUICHandshake::local_transport_parameters(bool with_version)
+QUICHandshake::local_transport_parameters()
{
- if (with_version) {
- return this->_local_transport_parameters;
- } else {
- QUICConfig::scoped_config params;
- QUICTransportParametersInNewSessionTicket *tp = new QUICTransportParametersInNewSessionTicket();
-
- // MUSTs
- tp->set(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA, params->initial_max_stream_data());
- tp->set(QUICTransportParameterId::INITIAL_MAX_DATA, params->initial_max_data());
- tp->set(QUICTransportParameterId::IDLE_TIMEOUT, static_cast<uint16_t>(params->no_activity_timeout_in()));
- tp->set(QUICTransportParameterId::STATELESS_RESET_TOKEN, this->_reset_token.buf(), QUICStatelessResetToken::LEN);
-
- // MAYs
- tp->set(QUICTransportParameterId::INITIAL_MAX_STREAM_ID_BIDI, params->initial_max_stream_id_bidi_in());
- tp->set(QUICTransportParameterId::INITIAL_MAX_STREAM_ID_UNI, params->initial_max_stream_id_uni_in());
- // this->_local_transport_parameters.add(QUICTransportParameterId::OMIT_CONNECTION_ID, {});
- // this->_local_transport_parameters.add(QUICTransportParameterId::MAX_PACKET_SIZE, {{0x00, 0x00}, 2});
-
- return std::unique_ptr<QUICTransportParameters>(tp);
- }
+ return this->_local_transport_parameters;
}
std::shared_ptr<const QUICTransportParameters>
diff --git a/iocore/net/quic/QUICHandshake.h b/iocore/net/quic/QUICHandshake.h
index 4a83225..770f172 100644
--- a/iocore/net/quic/QUICHandshake.h
+++ b/iocore/net/quic/QUICHandshake.h
@@ -76,7 +76,7 @@ public:
QUICVersion negotiated_version();
const char *negotiated_cipher_suite();
void negotiated_application_name(const uint8_t **name, unsigned int *len);
- std::shared_ptr<const QUICTransportParameters> local_transport_parameters(bool with_version = true);
+ std::shared_ptr<const QUICTransportParameters> local_transport_parameters();
std::shared_ptr<const QUICTransportParameters> remote_transport_parameters();
bool is_version_negotiated();
diff --git a/iocore/net/quic/QUICTransportParameters.cc b/iocore/net/quic/QUICTransportParameters.cc
index f2b03cb..bf524ec 100644
--- a/iocore/net/quic/QUICTransportParameters.cc
+++ b/iocore/net/quic/QUICTransportParameters.cc
@@ -563,8 +563,7 @@ QUICTransportParametersHandler::add(SSL *s, unsigned int ext_type, unsigned int
{
QUICHandshake *hs = static_cast<QUICHandshake *>(SSL_get_ex_data(s, QUIC::ssl_quic_hs_index));
*out = reinterpret_cast<const unsigned char *>(ats_malloc(TRANSPORT_PARAMETERS_MAXIMUM_SIZE));
- bool with_version = (context != SSL_EXT_TLS1_3_NEW_SESSION_TICKET);
- hs->local_transport_parameters(with_version)->store(const_cast<uint8_t *>(*out), reinterpret_cast<uint16_t *>(outlen));
+ hs->local_transport_parameters()->store(const_cast<uint8_t *>(*out), reinterpret_cast<uint16_t *>(outlen));
return 1;
}
@@ -588,9 +587,6 @@ QUICTransportParametersHandler::parse(SSL *s, unsigned int ext_type, unsigned in
case SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS:
hs->set_transport_parameters(std::make_shared<QUICTransportParametersInEncryptedExtensions>(in, inlen));
break;
- case SSL_EXT_TLS1_3_NEW_SESSION_TICKET:
- hs->set_transport_parameters(std::make_shared<QUICTransportParametersInNewSessionTicket>(in, inlen));
- break;
default:
// Do nothing
break;
--
To stop receiving notification emails like this one, please contact
maskit@apache.org.