trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From masa...@apache.org
Subject [trafficserver] branch quic-latest updated: Print negotiated cipher suite
Date Tue, 09 Jan 2018 02:41:10 GMT
This is an automated email from the ASF dual-hosted git repository.

masaori pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/quic-latest by this push:
     new fe29839  Print negotiated cipher suite
fe29839 is described below

commit fe29839e094550d2493177f66d666adeece1b904
Author: Masaori Koshiba <masaori@apache.org>
AuthorDate: Tue Jan 9 11:40:55 2018 +0900

    Print negotiated cipher suite
---
 iocore/net/QUICNetVConnection.cc |  2 ++
 iocore/net/quic/QUICHandshake.cc | 19 ++++++++++++++++---
 iocore/net/quic/QUICHandshake.h  |  1 +
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index ac9cb6d..770ebc6 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -1058,7 +1058,9 @@ QUICNetVConnection::_switch_to_established_state()
 {
   if (this->_complete_handshake_if_possible() == 0) {
     QUICConDebug("Enter state_connection_established");
+    QUICConDebug("%s", this->_handshake_handler->negotiated_cipher_suite());
     SET_HANDLER((NetVConnHandler)&QUICNetVConnection::state_connection_established);
+
     this->_update_alt_connection_ids(countof(this->_alt_quic_connection_ids) - 1);
   } else {
     // Illegal state change
diff --git a/iocore/net/quic/QUICHandshake.cc b/iocore/net/quic/QUICHandshake.cc
index 1952a73..cd70206 100644
--- a/iocore/net/quic/QUICHandshake.cc
+++ b/iocore/net/quic/QUICHandshake.cc
@@ -142,16 +142,29 @@ QUICHandshake::is_completed()
   return this->handler == &QUICHandshake::state_complete;
 }
 
+QUICCrypto *
+QUICHandshake::crypto_module()
+{
+  return this->_crypto;
+}
+
 QUICVersion
 QUICHandshake::negotiated_version()
 {
   return this->_version_negotiator->negotiated_version();
 }
 
-QUICCrypto *
-QUICHandshake::crypto_module()
+// Similar to SSLNetVConnection::getSSLCipherSuite()
+const char *
+QUICHandshake::negotiated_cipher_suite()
 {
-  return this->_crypto;
+  // FIXME Generalize and remove dynamic_cast
+  QUICCryptoTls *crypto_tls = dynamic_cast<QUICCryptoTls *>(this->_crypto);
+  if (crypto_tls) {
+    return SSL_get_cipher_name(crypto_tls->ssl_handle());
+  }
+
+  return nullptr;
 }
 
 void
diff --git a/iocore/net/quic/QUICHandshake.h b/iocore/net/quic/QUICHandshake.h
index 23fa4d2..6c426f2 100644
--- a/iocore/net/quic/QUICHandshake.h
+++ b/iocore/net/quic/QUICHandshake.h
@@ -67,6 +67,7 @@ public:
   // Getters
   QUICCrypto *crypto_module();
   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();
   std::shared_ptr<const QUICTransportParameters> remote_transport_parameters();

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message