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/21 08:27:34 UTC
[trafficserver] 01/02: Rename QUICCrypto to QUICHandshakeProtocol
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 4d58fcd16ff3d0ee5d23710d33dee45b8106f7bc
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Wed Feb 21 17:04:00 2018 +0900
Rename QUICCrypto to QUICHandshakeProtocol
---
.gitignore | 2 +-
iocore/net/P_QUICNetVConnection.h | 4 +-
iocore/net/QUICNetVConnection.cc | 6 +-
iocore/net/quic/Makefile.am | 8 +--
iocore/net/quic/Mock.h | 4 +-
iocore/net/quic/QUICHandshake.cc | 22 ++++----
iocore/net/quic/QUICHandshake.h | 4 +-
.../{QUICCrypto.cc => QUICHandshakeProtocol.cc} | 8 +--
.../quic/{QUICCrypto.h => QUICHandshakeProtocol.h} | 6 +-
...ngssl.cc => QUICHandshakeProtocol_boringssl.cc} | 2 +-
...openssl.cc => QUICHandshakeProtocol_openssl.cc} | 2 +-
iocore/net/quic/QUICPacket.cc | 20 +++----
iocore/net/quic/QUICPacket.h | 6 +-
iocore/net/quic/{QUICCryptoTls.h => QUICTLS.h} | 4 +-
iocore/net/quic/test/Makefile.am | 64 +++++++++++-----------
iocore/net/quic/test/test_QUICFrame.cc | 4 +-
...QUICCrypto.cc => test_QUICHandshakeProtocol.cc} | 14 ++---
iocore/net/quic/test/test_QUICLossDetector.cc | 4 +-
iocore/net/quic/test/test_QUICPacketFactory.cc | 12 ++--
iocore/net/quic/test/test_QUICVersionNegotiator.cc | 4 +-
20 files changed, 100 insertions(+), 100 deletions(-)
diff --git a/.gitignore b/.gitignore
index e056037..e79029f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -91,7 +91,7 @@ lib/perl/lib/Apache/TS.pm
iocore/net/test_certlookup
iocore/net/test_UDPNet
iocore/net/quic/test/test_QUICAckFrameCreator
-iocore/net/quic/test/test_QUICCrypto
+iocore/net/quic/test/test_QUICHandshakeProtocol
iocore/net/quic/test/test_QUICFlowController
iocore/net/quic/test/test_QUICFrame
iocore/net/quic/test/test_QUICFrameDispatcher
diff --git a/iocore/net/P_QUICNetVConnection.h b/iocore/net/P_QUICNetVConnection.h
index a7c7ca0..06d7139 100644
--- a/iocore/net/P_QUICNetVConnection.h
+++ b/iocore/net/P_QUICNetVConnection.h
@@ -51,7 +51,7 @@
#include "quic/QUICHandshake.h"
#include "quic/QUICApplication.h"
#include "quic/QUICStream.h"
-#include "quic/QUICCrypto.h"
+#include "quic/QUICHandshakeProtocol.h"
#include "quic/QUICAckFrameCreator.h"
#include "quic/QUICLossDetector.h"
#include "quic/QUICStreamManager.h"
@@ -243,7 +243,7 @@ private:
// TODO: use custom allocator and make them std::unique_ptr or std::shared_ptr
// or make them just member variables.
QUICHandshake *_handshake_handler = nullptr;
- QUICCrypto *_crypto = nullptr;
+ QUICHandshakeProtocol *_hs_protocol = nullptr;
QUICLossDetector *_loss_detector = nullptr;
QUICFrameDispatcher *_frame_dispatcher = nullptr;
QUICStreamManager *_stream_manager = nullptr;
diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 8ae5038..cb0beae 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -183,9 +183,9 @@ QUICNetVConnection::start(SSL_CTX *ssl_ctx)
this->_application_map = new QUICApplicationMap();
this->_application_map->set(STREAM_ID_FOR_HANDSHAKE, this->_handshake_handler);
- this->_crypto = this->_handshake_handler->crypto_module();
+ this->_hs_protocol = this->_handshake_handler->protocol();
this->_frame_dispatcher = new QUICFrameDispatcher();
- this->_packet_factory.set_crypto_module(this->_crypto);
+ this->_packet_factory.set_hs_protocol(this->_hs_protocol);
// Create frame handlers
this->_stream_manager = new QUICStreamManager(this->connection_id(), this, this->_application_map);
@@ -217,7 +217,7 @@ QUICNetVConnection::free(EThread *t)
delete this->_handshake_handler;
delete this->_application_map;
- delete this->_crypto;
+ delete this->_hs_protocol;
delete this->_loss_detector;
delete this->_frame_dispatcher;
delete this->_stream_manager;
diff --git a/iocore/net/quic/Makefile.am b/iocore/net/quic/Makefile.am
index 999f07c..7ff8913 100644
--- a/iocore/net/quic/Makefile.am
+++ b/iocore/net/quic/Makefile.am
@@ -35,10 +35,10 @@ AM_CPPFLAGS += \
noinst_LIBRARIES = libquic.a
if OPENSSL_IS_BORINGSSL
-QUICCrypto_impl = QUICCrypto_boringssl.cc
+QUICHandshakeProtocol_impl = QUICHandshakeProtocol_boringssl.cc
QUICKeyGenerator_impl = QUICKeyGenerator_boringssl.cc
else
-QUICCrypto_impl = QUICCrypto_openssl.cc
+QUICHandshakeProtocol_impl = QUICHandshakeProtocol_openssl.cc
QUICKeyGenerator_impl = QUICKeyGenerator_openssl.cc
endif
@@ -56,8 +56,8 @@ libquic_a_SOURCES = \
QUICStreamState.cc \
QUICStream.cc \
QUICHandshake.cc \
- QUICCrypto.cc \
- $(QUICCrypto_impl) \
+ QUICHandshakeProtocol.cc \
+ $(QUICHandshakeProtocol_impl) \
QUICKeyGenerator.cc \
$(QUICKeyGenerator_impl) \
QUICKeyGenerator.cc \
diff --git a/iocore/net/quic/Mock.h b/iocore/net/quic/Mock.h
index 50697e3..fbac350 100644
--- a/iocore/net/quic/Mock.h
+++ b/iocore/net/quic/Mock.h
@@ -459,10 +459,10 @@ private:
}
};
-class MockQUICCrypto : public QUICCrypto
+class MockQUICHandshakeProtocol : public QUICHandshakeProtocol
{
public:
- MockQUICCrypto() : QUICCrypto() {}
+ MockQUICHandshakeProtocol() : QUICHandshakeProtocol() {}
int
handshake(uint8_t *out, size_t &out_len, size_t max_out_len, const uint8_t *in, size_t in_len) override
diff --git a/iocore/net/quic/QUICHandshake.cc b/iocore/net/quic/QUICHandshake.cc
index 9014d8d..51bdbf2 100644
--- a/iocore/net/quic/QUICHandshake.cc
+++ b/iocore/net/quic/QUICHandshake.cc
@@ -28,7 +28,7 @@
#include "P_SSLNextProtocolSet.h"
#include "P_VConnection.h"
-#include "QUICCryptoTls.h"
+#include "QUICTLS.h"
#include "QUICEvents.h"
#include "QUICGlobals.h"
#include "QUICVersionNegotiator.h"
@@ -93,14 +93,14 @@ QUICHandshake::QUICHandshake(QUICConnection *qc, SSL_CTX *ssl_ctx) : QUICHandsha
QUICHandshake::QUICHandshake(QUICConnection *qc, SSL_CTX *ssl_ctx, QUICStatelessResetToken token)
: QUICApplication(qc),
_ssl(SSL_new(ssl_ctx)),
- _crypto(new QUICCryptoTls(this->_ssl, qc->direction())),
+ _hs_protocol(new QUICCryptoTls(this->_ssl, qc->direction())),
_version_negotiator(new QUICVersionNegotiator()),
_netvc_context(qc->direction()),
_reset_token(token)
{
SSL_set_ex_data(this->_ssl, QUIC::ssl_quic_qc_index, qc);
SSL_set_ex_data(this->_ssl, QUIC::ssl_quic_hs_index, this);
- this->_crypto->initialize_key_materials(this->_client_qc->original_connection_id());
+ this->_hs_protocol->initialize_key_materials(this->_client_qc->original_connection_id());
SET_HANDLER(&QUICHandshake::state_initial);
}
@@ -155,10 +155,10 @@ QUICHandshake::is_completed()
return this->handler == &QUICHandshake::state_complete;
}
-QUICCrypto *
-QUICHandshake::crypto_module()
+QUICHandshakeProtocol *
+QUICHandshake::protocol()
{
- return this->_crypto;
+ return this->_hs_protocol;
}
QUICVersion
@@ -172,7 +172,7 @@ const char *
QUICHandshake::negotiated_cipher_suite()
{
// FIXME Generalize and remove dynamic_cast
- QUICCryptoTls *crypto_tls = dynamic_cast<QUICCryptoTls *>(this->_crypto);
+ QUICCryptoTls *crypto_tls = dynamic_cast<QUICCryptoTls *>(this->_hs_protocol);
if (crypto_tls) {
return SSL_get_cipher_name(crypto_tls->ssl_handle());
}
@@ -184,7 +184,7 @@ void
QUICHandshake::negotiated_application_name(const uint8_t **name, unsigned int *len)
{
// FIXME Generalize and remove dynamic_cast
- QUICCryptoTls *crypto_tls = dynamic_cast<QUICCryptoTls *>(this->_crypto);
+ QUICCryptoTls *crypto_tls = dynamic_cast<QUICCryptoTls *>(this->_hs_protocol);
if (crypto_tls) {
SSL_get0_alpn_selected(crypto_tls->ssl_handle(), name, len);
}
@@ -309,7 +309,7 @@ QUICHandshake::state_key_exchange(int event, Event *data)
QUICErrorUPtr error = QUICErrorUPtr(new QUICNoError());
switch (event) {
case QUIC_EVENT_HANDSHAKE_PACKET_WRITE_COMPLETE: {
- if (this->_crypto->is_handshake_finished()) {
+ if (this->_hs_protocol->is_handshake_finished()) {
int res = this->_complete_handshake();
if (!res) {
this->_abort_handshake(QUICTransErrorCode::TLS_HANDSHAKE_FAILED);
@@ -457,7 +457,7 @@ QUICHandshake::_do_handshake(bool initial)
uint8_t out[MAX_HANDSHAKE_MSG_LEN] = {0};
size_t out_len = 0;
- int result = this->_crypto->handshake(out, out_len, MAX_HANDSHAKE_MSG_LEN, in, in_len);
+ int result = this->_hs_protocol->handshake(out, out_len, MAX_HANDSHAKE_MSG_LEN, in, in_len);
if (out_len > 0) {
I_WANNA_DUMP_THIS_BUF(out, static_cast<int64_t>(out_len));
@@ -573,7 +573,7 @@ QUICHandshake::_complete_handshake()
SET_HANDLER(&QUICHandshake::state_complete);
QUICHSDebug("%s", this->negotiated_cipher_suite());
- int res = this->_crypto->update_key_materials();
+ int res = this->_hs_protocol->update_key_materials();
if (res) {
QUICHSDebug("Keying Materials are exported");
} else {
diff --git a/iocore/net/quic/QUICHandshake.h b/iocore/net/quic/QUICHandshake.h
index 770f172..3fd0dfe 100644
--- a/iocore/net/quic/QUICHandshake.h
+++ b/iocore/net/quic/QUICHandshake.h
@@ -72,7 +72,7 @@ public:
int state_closed(int event, void *data);
// Getters
- QUICCrypto *crypto_module();
+ QUICHandshakeProtocol *protocol();
QUICVersion negotiated_version();
const char *negotiated_cipher_suite();
void negotiated_application_name(const uint8_t **name, unsigned int *len);
@@ -88,7 +88,7 @@ public:
private:
SSL *_ssl = nullptr;
- QUICCrypto *_crypto = nullptr;
+ QUICHandshakeProtocol *_hs_protocol = nullptr;
std::shared_ptr<QUICTransportParameters> _local_transport_parameters = nullptr;
std::shared_ptr<QUICTransportParameters> _remote_transport_parameters = nullptr;
diff --git a/iocore/net/quic/QUICCrypto.cc b/iocore/net/quic/QUICHandshakeProtocol.cc
similarity index 98%
rename from iocore/net/quic/QUICCrypto.cc
rename to iocore/net/quic/QUICHandshakeProtocol.cc
index 1e7681f..6b80632 100644
--- a/iocore/net/quic/QUICCrypto.cc
+++ b/iocore/net/quic/QUICHandshakeProtocol.cc
@@ -1,6 +1,6 @@
/** @file
*
- * QUIC Crypto (TLS to Secure QUIC)
+ * QUIC Handshake Protocol (TLS to Secure QUIC)
*
* @section license License
*
@@ -21,7 +21,7 @@
* limitations under the License.
*/
#include "QUICGlobals.h"
-#include "QUICCryptoTls.h"
+#include "QUICTLS.h"
#include <openssl/err.h>
#include <openssl/ssl.h>
@@ -94,9 +94,9 @@ QUICPacketProtection::key_phase() const
}
//
-// QUICCrypto
+// QUICHandshakeProtocol
//
-QUICCryptoTls::QUICCryptoTls(SSL *ssl, NetVConnectionContext_t nvc_ctx) : QUICCrypto(), _ssl(ssl), _netvc_context(nvc_ctx)
+QUICCryptoTls::QUICCryptoTls(SSL *ssl, NetVConnectionContext_t nvc_ctx) : QUICHandshakeProtocol(), _ssl(ssl), _netvc_context(nvc_ctx)
{
if (this->_netvc_context == NET_VCONNECTION_IN) {
SSL_set_accept_state(this->_ssl);
diff --git a/iocore/net/quic/QUICCrypto.h b/iocore/net/quic/QUICHandshakeProtocol.h
similarity index 96%
rename from iocore/net/quic/QUICCrypto.h
rename to iocore/net/quic/QUICHandshakeProtocol.h
index 6ab434f..cb73cd9 100644
--- a/iocore/net/quic/QUICCrypto.h
+++ b/iocore/net/quic/QUICHandshakeProtocol.h
@@ -42,11 +42,11 @@ private:
QUICKeyPhase _key_phase = QUICKeyPhase::CLEARTEXT;
};
-class QUICCrypto
+class QUICHandshakeProtocol
{
public:
- QUICCrypto(){};
- virtual ~QUICCrypto(){};
+ QUICHandshakeProtocol(){};
+ virtual ~QUICHandshakeProtocol(){};
virtual int handshake(uint8_t *out, size_t &out_len, size_t max_out_len, const uint8_t *in, size_t in_len) = 0;
virtual bool is_handshake_finished() const = 0;
diff --git a/iocore/net/quic/QUICCrypto_boringssl.cc b/iocore/net/quic/QUICHandshakeProtocol_boringssl.cc
similarity index 99%
rename from iocore/net/quic/QUICCrypto_boringssl.cc
rename to iocore/net/quic/QUICHandshakeProtocol_boringssl.cc
index 4d848fd..1010a8c 100644
--- a/iocore/net/quic/QUICCrypto_boringssl.cc
+++ b/iocore/net/quic/QUICHandshakeProtocol_boringssl.cc
@@ -20,7 +20,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include "QUICCryptoTls.h"
+#include "QUICTLS.h"
#include <openssl/base.h>
#include <openssl/err.h>
diff --git a/iocore/net/quic/QUICCrypto_openssl.cc b/iocore/net/quic/QUICHandshakeProtocol_openssl.cc
similarity index 99%
rename from iocore/net/quic/QUICCrypto_openssl.cc
rename to iocore/net/quic/QUICHandshakeProtocol_openssl.cc
index 9eae6b3..2325a49 100644
--- a/iocore/net/quic/QUICCrypto_openssl.cc
+++ b/iocore/net/quic/QUICHandshakeProtocol_openssl.cc
@@ -20,7 +20,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-#include "QUICCryptoTls.h"
+#include "QUICTLS.h"
#include <openssl/err.h>
#include <openssl/ssl.h>
diff --git a/iocore/net/quic/QUICPacket.cc b/iocore/net/quic/QUICPacket.cc
index 114eb6e..9f2c9ac 100644
--- a/iocore/net/quic/QUICPacket.cc
+++ b/iocore/net/quic/QUICPacket.cc
@@ -672,8 +672,8 @@ QUICPacketFactory::create(ats_unique_buf buf, size_t len, QUICPacketNumber base_
result = QUICPacketCreationResult::SUCCESS;
break;
case QUICPacketType::PROTECTED:
- if (this->_crypto->is_key_derived()) {
- if (this->_crypto->decrypt(plain_txt.get(), plain_txt_len, max_plain_txt_len, header->payload(), header->payload_size(),
+ if (this->_hs_protocol->is_key_derived()) {
+ if (this->_hs_protocol->decrypt(plain_txt.get(), plain_txt_len, max_plain_txt_len, header->payload(), header->payload_size(),
header->packet_number(), header->buf(), header->size(), header->key_phase())) {
result = QUICPacketCreationResult::SUCCESS;
} else {
@@ -684,9 +684,9 @@ QUICPacketFactory::create(ats_unique_buf buf, size_t len, QUICPacketNumber base_
}
break;
case QUICPacketType::INITIAL:
- if (!this->_crypto->is_key_derived()) {
+ if (!this->_hs_protocol->is_key_derived()) {
if (QUICTypeUtil::is_supported_version(header->version())) {
- if (this->_crypto->decrypt(plain_txt.get(), plain_txt_len, max_plain_txt_len, header->payload(), header->payload_size(),
+ if (this->_hs_protocol->decrypt(plain_txt.get(), plain_txt_len, max_plain_txt_len, header->payload(), header->payload_size(),
header->packet_number(), header->buf(), header->size(), QUICKeyPhase::CLEARTEXT)) {
result = QUICPacketCreationResult::SUCCESS;
} else {
@@ -700,8 +700,8 @@ QUICPacketFactory::create(ats_unique_buf buf, size_t len, QUICPacketNumber base_
}
break;
case QUICPacketType::HANDSHAKE:
- if (!this->_crypto->is_key_derived()) {
- if (this->_crypto->decrypt(plain_txt.get(), plain_txt_len, max_plain_txt_len, header->payload(), header->payload_size(),
+ if (!this->_hs_protocol->is_key_derived()) {
+ if (this->_hs_protocol->decrypt(plain_txt.get(), plain_txt_len, max_plain_txt_len, header->payload(), header->payload_size(),
header->packet_number(), header->buf(), header->size(), QUICKeyPhase::CLEARTEXT)) {
result = QUICPacketCreationResult::SUCCESS;
} else {
@@ -768,7 +768,7 @@ QUICPacketUPtr
QUICPacketFactory::create_server_protected_packet(QUICConnectionId connection_id, QUICPacketNumber base_packet_number,
ats_unique_buf payload, size_t len, bool retransmittable)
{
- // TODO Key phase should be picked up from QUICCrypto, probably
+ // TODO Key phase should be picked up from QUICHandshakeProtocol, probably
QUICPacketHeader *header =
QUICPacketHeader::build(QUICPacketType::PROTECTED, QUICKeyPhase::PHASE_0, connection_id, this->_packet_number_generator.next(),
base_packet_number, std::move(payload), len);
@@ -820,7 +820,7 @@ QUICPacketFactory::_create_encrypted_packet(QUICPacketHeader *header, bool retra
size_t cipher_txt_len = 0;
QUICPacket *packet = nullptr;
- if (this->_crypto->encrypt(cipher_txt.get(), cipher_txt_len, max_cipher_txt_len, header->payload(), header->payload_size(),
+ if (this->_hs_protocol->encrypt(cipher_txt.get(), cipher_txt_len, max_cipher_txt_len, header->payload(), header->payload_size(),
header->packet_number(), header->buf(), header->size(), header->key_phase())) {
packet = quicPacketAllocator.alloc();
new (packet) QUICPacket(header, std::move(cipher_txt), cipher_txt_len, retransmittable);
@@ -836,9 +836,9 @@ QUICPacketFactory::set_version(QUICVersion negotiated_version)
}
void
-QUICPacketFactory::set_crypto_module(QUICCrypto *crypto)
+QUICPacketFactory::set_hs_protocol(QUICHandshakeProtocol *hs_protocol)
{
- this->_crypto = crypto;
+ this->_hs_protocol = hs_protocol;
}
//
diff --git a/iocore/net/quic/QUICPacket.h b/iocore/net/quic/QUICPacket.h
index a7d554d..3bb3307 100644
--- a/iocore/net/quic/QUICPacket.h
+++ b/iocore/net/quic/QUICPacket.h
@@ -31,7 +31,7 @@
#include "I_IOBuffer.h"
#include "QUICTypes.h"
-#include "QUICCrypto.h"
+#include "QUICHandshakeProtocol.h"
#define QUIC_FIELD_OFFSET_CONNECTION_ID 1
#define QUIC_FIELD_OFFSET_PACKET_NUMBER 4
@@ -306,11 +306,11 @@ public:
static QUICPacketUPtr create_stateless_reset_packet(QUICConnectionId connection_id,
QUICStatelessResetToken stateless_reset_token);
void set_version(QUICVersion negotiated_version);
- void set_crypto_module(QUICCrypto *crypto);
+ void set_hs_protocol(QUICHandshakeProtocol *hs_protocol);
private:
QUICVersion _version = QUIC_SUPPORTED_VERSIONS[0];
- QUICCrypto *_crypto = nullptr;
+ QUICHandshakeProtocol *_hs_protocol = nullptr;
QUICPacketNumberGenerator _packet_number_generator;
static QUICPacketUPtr _create_unprotected_packet(QUICPacketHeader *header);
diff --git a/iocore/net/quic/QUICCryptoTls.h b/iocore/net/quic/QUICTLS.h
similarity index 97%
rename from iocore/net/quic/QUICCryptoTls.h
rename to iocore/net/quic/QUICTLS.h
index c42ec26..ea52733 100644
--- a/iocore/net/quic/QUICCryptoTls.h
+++ b/iocore/net/quic/QUICTLS.h
@@ -34,9 +34,9 @@
#include "I_EventSystem.h"
#include "I_NetVConnection.h"
-#include "QUICCrypto.h"
+#include "QUICHandshakeProtocol.h"
-class QUICCryptoTls : public QUICCrypto
+class QUICCryptoTls : public QUICHandshakeProtocol
{
public:
QUICCryptoTls(SSL *ssl, NetVConnectionContext_t nvc_ctx);
diff --git a/iocore/net/quic/test/Makefile.am b/iocore/net/quic/test/Makefile.am
index bbfdd7b..c0ea1e2 100644
--- a/iocore/net/quic/test/Makefile.am
+++ b/iocore/net/quic/test/Makefile.am
@@ -27,7 +27,7 @@ check_PROGRAMS = \
test_QUICStreamManager \
test_QUICTransportParameters \
test_QUICKeyGenerator \
- test_QUICCrypto \
+ test_QUICHandshakeProtocol \
test_QUICLossDetector \
test_QUICTypeUtil \
test_QUICAckFrameCreator \
@@ -53,10 +53,10 @@ AM_CPPFLAGS += \
if OPENSSL_IS_BORINGSSL
QUICKeyGenerator_impl = ../QUICKeyGenerator_boringssl.cc
-QUICCrypto_impl = ../QUICCrypto_boringssl.cc
+QUICHandshakeProtocol_impl = ../QUICHandshakeProtocol_boringssl.cc
else
QUICKeyGenerator_impl = ../QUICKeyGenerator_openssl.cc
-QUICCrypto_impl = ../QUICCrypto_openssl.cc
+QUICHandshakeProtocol_impl = ../QUICHandshakeProtocol_openssl.cc
endif
#
@@ -72,8 +72,8 @@ test_QUICPacket_SOURCES = \
event_processor_main.cc \
test_QUICPacket.cc \
../QUICPacket.cc \
- ../QUICCrypto.cc \
- $(QUICCrypto_impl) \
+ ../QUICHandshakeProtocol.cc \
+ $(QUICHandshakeProtocol_impl) \
../QUICTypes.cc
test_QUICPacket_LDADD = \
@@ -100,8 +100,8 @@ test_QUICPacketFactory_SOURCES = \
event_processor_main.cc \
test_QUICPacketFactory.cc \
../QUICPacket.cc \
- ../QUICCrypto.cc \
- $(QUICCrypto_impl) \
+ ../QUICHandshakeProtocol.cc \
+ $(QUICHandshakeProtocol_impl) \
../QUICTypes.cc
test_QUICPacketFactory_LDADD = \
@@ -134,8 +134,8 @@ test_QUICFrame_SOURCES = \
../QUICKeyGenerator.cc \
$(QUICKeyGenerator_impl) \
../QUICHKDF.cc \
- ../QUICCrypto.cc \
- $(QUICCrypto_impl) \
+ ../QUICHandshakeProtocol.cc \
+ $(QUICHandshakeProtocol_impl) \
../QUICTypes.cc \
../QUICStream.cc \
../QUICStreamState.cc \
@@ -182,8 +182,8 @@ test_QUICFrameDispatcher_SOURCES = \
../QUICTypes.cc \
../QUICEchoApp.cc \
../QUICDebugNames.cc \
- ../QUICCrypto.cc \
- $(QUICCrypto_impl) \
+ ../QUICHandshakeProtocol.cc \
+ $(QUICHandshakeProtocol_impl) \
../QUICKeyGenerator.cc \
$(QUICKeyGenerator_impl) \
../QUICHKDF.cc \
@@ -304,8 +304,8 @@ test_QUICTransportParameters_SOURCES = \
../QUICApplicationMap.cc \
../QUICHandshake.cc \
../QUICVersionNegotiator.cc \
- ../QUICCrypto.cc \
- $(QUICCrypto_impl) \
+ ../QUICHandshakeProtocol.cc \
+ $(QUICHandshakeProtocol_impl) \
../QUICKeyGenerator.cc \
$(QUICKeyGenerator_impl) \
../QUICHKDF.cc \
@@ -354,16 +354,16 @@ test_QUICKeyGenerator_SOURCES = \
../QUICTypes.cc
#
-# test_QUICCrypto
+# test_QUICHandshakeProtocol
#
-test_QUICCrypto_CPPFLAGS = \
+test_QUICHandshakeProtocol_CPPFLAGS = \
$(AM_CPPFLAGS)
-test_QUICCrypto_LDFLAGS = \
+test_QUICHandshakeProtocol_LDFLAGS = \
@AM_LDFLAGS@ \
@OPENSSL_LDFLAGS@
-test_QUICCrypto_LDADD = \
+test_QUICHandshakeProtocol_LDADD = \
@OPENSSL_LIBS@ \
$(top_builddir)/lib/ts/libtsutil.la \
$(top_builddir)/proxy/shared/libUglyLogStubs.a \
@@ -371,15 +371,15 @@ test_QUICCrypto_LDADD = \
$(top_builddir)/mgmt/libmgmt_p.la \
$(top_builddir)/iocore/eventsystem/libinkevent.a
-test_QUICCrypto_SOURCES = \
+test_QUICHandshakeProtocol_SOURCES = \
main.cc \
- test_QUICCrypto.cc \
+ test_QUICHandshakeProtocol.cc \
../QUICKeyGenerator.cc \
$(QUICKeyGenerator_impl) \
../QUICHKDF.cc \
- ../QUICCrypto.cc \
- $(QUICCrypto_impl) \
- ../QUICCrypto.h \
+ ../QUICHandshakeProtocol.cc \
+ $(QUICHandshakeProtocol_impl) \
+ ../QUICHandshakeProtocol.h \
../QUICTypes.cc \
../QUICGlobals.cc \
../../SSLNextProtocolSet.cc
@@ -410,8 +410,8 @@ test_QUICLossDetector_SOURCES = \
../QUICLossDetector.cc \
../QUICTypes.cc \
../QUICPacket.cc \
- ../QUICCrypto.cc \
- $(QUICCrypto_impl) \
+ ../QUICHandshakeProtocol.cc \
+ $(QUICHandshakeProtocol_impl) \
../QUICFrame.cc
#
@@ -443,8 +443,8 @@ test_QUICTypeUtil_SOURCES = \
../QUICKeyGenerator.cc \
$(QUICKeyGenerator_impl) \
../QUICHKDF.cc \
- ../QUICCrypto.cc \
- $(QUICCrypto_impl) \
+ ../QUICHandshakeProtocol.cc \
+ $(QUICHandshakeProtocol_impl) \
../QUICTypes.cc
#
@@ -479,8 +479,8 @@ test_QUICAckFrameCreator_SOURCES = \
../QUICKeyGenerator.cc \
$(QUICKeyGenerator_impl) \
../QUICHKDF.cc \
- ../QUICCrypto.cc \
- $(QUICCrypto_impl) \
+ ../QUICHandshakeProtocol.cc \
+ $(QUICHandshakeProtocol_impl) \
../../SSLNextProtocolSet.cc
#
@@ -511,8 +511,8 @@ test_QUICVersionNegotiator_SOURCES = \
../QUICKeyGenerator.cc \
$(QUICKeyGenerator_impl) \
../QUICHKDF.cc \
- ../QUICCrypto.cc \
- $(QUICCrypto_impl) \
+ ../QUICHandshakeProtocol.cc \
+ $(QUICHandshakeProtocol_impl) \
../QUICApplication.cc \
../QUICApplicationMap.cc \
../QUICHandshake.cc \
@@ -560,8 +560,8 @@ test_QUICFlowController_SOURCES = \
../QUICKeyGenerator.cc \
$(QUICKeyGenerator_impl) \
../QUICHKDF.cc \
- ../QUICCrypto.cc \
- $(QUICCrypto_impl) \
+ ../QUICHandshakeProtocol.cc \
+ $(QUICHandshakeProtocol_impl) \
../QUICFrame.cc
#
diff --git a/iocore/net/quic/test/test_QUICFrame.cc b/iocore/net/quic/test/test_QUICFrame.cc
index 3c00ec9..4623a9c 100644
--- a/iocore/net/quic/test/test_QUICFrame.cc
+++ b/iocore/net/quic/test/test_QUICFrame.cc
@@ -1113,8 +1113,8 @@ TEST_CASE("QUICFrameFactory Create RST_STREAM with a QUICStreamError", "[quic]")
TEST_CASE("Retransmit", "[quic][frame][retransmit]")
{
QUICPacketFactory factory;
- MockQUICCrypto crypto;
- factory.set_crypto_module(&crypto);
+ MockQUICHandshakeProtocol hs_protocol;
+ factory.set_hs_protocol(&hs_protocol);
QUICPacketUPtr packet = factory.create_server_protected_packet(0x01020304, 0, {nullptr, [](void *p) { ats_free(p); }}, 0, true);
SECTION("STREAM frame")
diff --git a/iocore/net/quic/test/test_QUICCrypto.cc b/iocore/net/quic/test/test_QUICHandshakeProtocol.cc
similarity index 93%
rename from iocore/net/quic/test/test_QUICCrypto.cc
rename to iocore/net/quic/test/test_QUICHandshakeProtocol.cc
index e0a2b72..0877c21 100644
--- a/iocore/net/quic/test/test_QUICCrypto.cc
+++ b/iocore/net/quic/test/test_QUICHandshakeProtocol.cc
@@ -34,7 +34,7 @@
#include <openssl/ssl.h>
#include "Mock.h"
-#include "QUICCryptoTls.h"
+#include "QUICTLS.h"
static constexpr uint32_t MAX_HANDSHAKE_MSG_LEN = 2048;
@@ -56,13 +56,13 @@ print_hex(const uint8_t *v, size_t len)
return;
}
-TEST_CASE("QUICCrypto Cleartext", "[quic]")
+TEST_CASE("QUICHndshakeProtocol Cleartext", "[quic]")
{
// Client
SSL_CTX *client_ssl_ctx = SSL_CTX_new(TLS_method());
SSL_CTX_set_min_proto_version(client_ssl_ctx, TLS1_3_VERSION);
SSL_CTX_set_max_proto_version(client_ssl_ctx, TLS1_3_VERSION);
- QUICCrypto *client = new QUICCryptoTls(SSL_new(client_ssl_ctx), NET_VCONNECTION_OUT);
+ QUICHandshakeProtocol *client = new QUICCryptoTls(SSL_new(client_ssl_ctx), NET_VCONNECTION_OUT);
// Server
SSL_CTX *server_ssl_ctx = SSL_CTX_new(TLS_method());
@@ -72,7 +72,7 @@ TEST_CASE("QUICCrypto Cleartext", "[quic]")
SSL_CTX_use_certificate(server_ssl_ctx, PEM_read_bio_X509(crt_bio, nullptr, nullptr, nullptr));
BIO *key_bio(BIO_new_mem_buf(server_key, sizeof(server_key)));
SSL_CTX_use_PrivateKey(server_ssl_ctx, PEM_read_bio_PrivateKey(key_bio, nullptr, nullptr, nullptr));
- QUICCrypto *server = new QUICCryptoTls(SSL_new(server_ssl_ctx), NET_VCONNECTION_IN);
+ QUICHandshakeProtocol *server = new QUICCryptoTls(SSL_new(server_ssl_ctx), NET_VCONNECTION_IN);
CHECK(client->initialize_key_materials(0x8394c8f03e515700));
CHECK(server->initialize_key_materials(0x8394c8f03e515700));
@@ -114,13 +114,13 @@ TEST_CASE("QUICCrypto Cleartext", "[quic]")
delete server;
}
-TEST_CASE("QUICCrypto 1-RTT", "[quic]")
+TEST_CASE("QUICHandshakeProtocol 1-RTT", "[quic]")
{
// Client
SSL_CTX *client_ssl_ctx = SSL_CTX_new(TLS_method());
SSL_CTX_set_min_proto_version(client_ssl_ctx, TLS1_3_VERSION);
SSL_CTX_set_max_proto_version(client_ssl_ctx, TLS1_3_VERSION);
- QUICCrypto *client = new QUICCryptoTls(SSL_new(client_ssl_ctx), NET_VCONNECTION_OUT);
+ QUICHandshakeProtocol *client = new QUICCryptoTls(SSL_new(client_ssl_ctx), NET_VCONNECTION_OUT);
// Server
SSL_CTX *server_ssl_ctx = SSL_CTX_new(TLS_method());
@@ -130,7 +130,7 @@ TEST_CASE("QUICCrypto 1-RTT", "[quic]")
SSL_CTX_use_certificate(server_ssl_ctx, PEM_read_bio_X509(crt_bio, nullptr, nullptr, nullptr));
BIO *key_bio(BIO_new_mem_buf(server_key, sizeof(server_key)));
SSL_CTX_use_PrivateKey(server_ssl_ctx, PEM_read_bio_PrivateKey(key_bio, nullptr, nullptr, nullptr));
- QUICCrypto *server = new QUICCryptoTls(SSL_new(server_ssl_ctx), NET_VCONNECTION_IN);
+ QUICHandshakeProtocol *server = new QUICCryptoTls(SSL_new(server_ssl_ctx), NET_VCONNECTION_IN);
CHECK(client->initialize_key_materials(0x8394c8f03e515708));
CHECK(server->initialize_key_materials(0x8394c8f03e515708));
diff --git a/iocore/net/quic/test/test_QUICLossDetector.cc b/iocore/net/quic/test/test_QUICLossDetector.cc
index 5cfdfc0..1fb01cf 100644
--- a/iocore/net/quic/test/test_QUICLossDetector.cc
+++ b/iocore/net/quic/test/test_QUICLossDetector.cc
@@ -29,9 +29,9 @@
TEST_CASE("QUICLossDetector_Loss", "[quic]")
{
- MockQUICCrypto crypto;
+ MockQUICHandshakeProtocol hs_protocol;
QUICPacketFactory pf;
- pf.set_crypto_module(&crypto);
+ pf.set_hs_protocol(&hs_protocol);
QUICAckFrameCreator *afc = new QUICAckFrameCreator();
QUICConnectionId connection_id = 1;
diff --git a/iocore/net/quic/test/test_QUICPacketFactory.cc b/iocore/net/quic/test/test_QUICPacketFactory.cc
index c328abe..ba5c523 100644
--- a/iocore/net/quic/test/test_QUICPacketFactory.cc
+++ b/iocore/net/quic/test/test_QUICPacketFactory.cc
@@ -29,8 +29,8 @@
TEST_CASE("QUICPacketFactory_Create_VersionNegotiationPacket", "[quic]")
{
QUICPacketFactory factory;
- MockQUICCrypto crypto;
- factory.set_crypto_module(&crypto);
+ MockQUICHandshakeProtocol hs_protocol;
+ factory.set_hs_protocol(&hs_protocol);
uint8_t client_initial_packet_header[] = {
0x82, // Type
@@ -57,8 +57,8 @@ TEST_CASE("QUICPacketFactory_Create_VersionNegotiationPacket", "[quic]")
TEST_CASE("QUICPacketFactory_Create_Handshake", "[quic]")
{
QUICPacketFactory factory;
- MockQUICCrypto crypto;
- factory.set_crypto_module(&crypto);
+ MockQUICHandshakeProtocol hs_protocol;
+ factory.set_hs_protocol(&hs_protocol);
factory.set_version(0x11223344);
uint8_t raw[] = {0xaa, 0xbb, 0xcc, 0xdd};
@@ -76,8 +76,8 @@ TEST_CASE("QUICPacketFactory_Create_Handshake", "[quic]")
TEST_CASE("QUICPacketFactory_Create_StatelessResetPacket", "[quic]")
{
QUICPacketFactory factory;
- MockQUICCrypto crypto;
- factory.set_crypto_module(&crypto);
+ MockQUICHandshakeProtocol hs_protocol;
+ factory.set_hs_protocol(&hs_protocol);
QUICStatelessResetToken token;
token.generate(12345, 67890);
uint8_t expected_output[] = {
diff --git a/iocore/net/quic/test/test_QUICVersionNegotiator.cc b/iocore/net/quic/test/test_QUICVersionNegotiator.cc
index 48cc23d..ea6d87b 100644
--- a/iocore/net/quic/test/test_QUICVersionNegotiator.cc
+++ b/iocore/net/quic/test/test_QUICVersionNegotiator.cc
@@ -29,8 +29,8 @@
TEST_CASE("QUICVersionNegotiator", "[quic]")
{
QUICPacketFactory packet_factory;
- MockQUICCrypto crypto;
- packet_factory.set_crypto_module(&crypto);
+ MockQUICHandshakeProtocol hs_protocol;
+ packet_factory.set_hs_protocol(&hs_protocol);
QUICVersionNegotiator vn;
SECTION("Normal case")
--
To stop receiving notification emails like this one, please contact
maskit@apache.org.