Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions iocore/net/quic/QUICConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,6 @@ quic_new_ssl_ctx()
// QUIC Transport Parameters are accessible with SSL_set_quic_transport_params and SSL_get_peer_quic_transport_params
#endif

#ifdef SSL_MODE_QUIC_HACK
// tatsuhiro-t's custom OpenSSL for QUIC draft-13
// https://github.com/tatsuhiro-t/openssl/tree/quic-draft-13
SSL_CTX_set_mode(ssl_ctx, SSL_MODE_QUIC_HACK);
SSL_CTX_add_custom_ext(ssl_ctx, QUICTransportParametersHandler::TRANSPORT_PARAMETER_ID,
SSL_EXT_TLS_ONLY | SSL_EXT_CLIENT_HELLO | SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS,
&QUICTransportParametersHandler::add, &QUICTransportParametersHandler::free, nullptr,
&QUICTransportParametersHandler::parse, nullptr);

#endif

return ssl_ctx;
}

Expand Down Expand Up @@ -93,11 +82,9 @@ quic_init_client_ssl_ctx(const QUICConfigParams *params)
SSL_CTX_sess_set_new_cb(ssl_ctx.get(), QUIC::ssl_client_new_session);
}

#ifdef SSL_MODE_QUIC_HACK
if (params->client_keylog_file() != nullptr) {
SSL_CTX_set_keylog_callback(ssl_ctx.get(), QUIC::ssl_client_keylog_cb);
}
#endif

return ssl_ctx;
}
Expand Down
46 changes: 0 additions & 46 deletions iocore/net/quic/QUICTransportParameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -418,49 +418,3 @@ QUICTransportParametersInEncryptedExtensions::_validate_parameters(QUICVersion v

return 0;
}

#ifndef OPENSSL_IS_BORINGSSL

//
// QUICTransportParametersHandler
//

int
QUICTransportParametersHandler::add(SSL *s, unsigned int ext_type, unsigned int context, const unsigned char **out, size_t *outlen,
X509 *x, size_t chainidx, int *al, void *add_arg)
{
QUICTLS *qtls = static_cast<QUICTLS *>(SSL_get_ex_data(s, QUIC::ssl_quic_tls_index));
*out = reinterpret_cast<const unsigned char *>(ats_malloc(TRANSPORT_PARAMETERS_MAXIMUM_SIZE));
qtls->local_transport_parameters()->store(const_cast<uint8_t *>(*out), reinterpret_cast<uint16_t *>(outlen));

return 1;
}

void
QUICTransportParametersHandler::free(SSL *s, unsigned int ext_type, unsigned int context, const unsigned char *out, void *add_arg)
{
ats_free(const_cast<unsigned char *>(out));
}

int
QUICTransportParametersHandler::parse(SSL *s, unsigned int ext_type, unsigned int context, const unsigned char *in, size_t inlen,
X509 *x, size_t chainidx, int *al, void *parse_arg)
{
QUICTLS *qtls = static_cast<QUICTLS *>(SSL_get_ex_data(s, QUIC::ssl_quic_tls_index));
const QUICConnection *qc = static_cast<const QUICConnection *>(SSL_get_ex_data(s, QUIC::ssl_quic_qc_index));
QUICVersion version = qc->negotiated_version();
switch (context) {
case SSL_EXT_CLIENT_HELLO:
qtls->set_remote_transport_parameters(std::make_shared<QUICTransportParametersInClientHello>(in, inlen, version));
break;
case SSL_EXT_TLS1_3_ENCRYPTED_EXTENSIONS:
qtls->set_remote_transport_parameters(std::make_shared<QUICTransportParametersInEncryptedExtensions>(in, inlen, version));
break;
default:
// Do nothing
break;
}

return 1;
}
#endif
12 changes: 0 additions & 12 deletions iocore/net/quic/QUICTransportParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,3 @@ class QUICTransportParametersInEncryptedExtensions : public QUICTransportParamet
std::ptrdiff_t _parameters_offset(const uint8_t *buf) const override;
int _validate_parameters(QUICVersion version) const override;
};

class QUICTransportParametersHandler
{
public:
static constexpr int TRANSPORT_PARAMETER_ID = 0xffa5;

static int add(SSL *s, unsigned int ext_type, unsigned int context, const unsigned char **out, size_t *outlen, X509 *x,
size_t chainidx, int *al, void *add_arg);
static void free(SSL *s, unsigned int ext_type, unsigned int context, const unsigned char *out, void *add_arg);
static int parse(SSL *s, unsigned int ext_type, unsigned int context, const unsigned char *in, size_t inlen, X509 *x,
size_t chainidx, int *al, void *parse_arg);
};
1 change: 0 additions & 1 deletion iocore/net/quic/QUICTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ using QUICFrameId = uint64_t;
// Note: Prefix for drafts (0xff000000) + draft number
// Note: Fix "Supported Version" field in test case of QUICPacketFactory_Create_VersionNegotiationPacket
// Note: Fix QUIC_ALPN_PROTO_LIST in QUICConfig.cc
// Note: Change ExtensionType (QUICTransportParametersHandler::TRANSPORT_PARAMETER_ID) if it's changed
constexpr QUICVersion QUIC_SUPPORTED_VERSIONS[] = {
0xff00001d,
0xff00001b,
Expand Down