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/01/09 02:46:06 UTC

[trafficserver] branch quic-latest updated: Conver keys and IVs to hex only if the debug tag is set

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


The following commit(s) were added to refs/heads/quic-latest by this push:
     new a851522  Conver keys and IVs to hex only if the debug tag is set
a851522 is described below

commit a851522a2c8ba57d942c4fcb486099de58ce623e
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Tue Jan 9 11:42:26 2018 +0900

    Conver keys and IVs to hex only if the debug tag is set
---
 iocore/net/quic/QUICCrypto.cc | 40 ++++++++++++++++++++++++----------------
 1 file changed, 24 insertions(+), 16 deletions(-)

diff --git a/iocore/net/quic/QUICCrypto.cc b/iocore/net/quic/QUICCrypto.cc
index 4846108..c997c17 100644
--- a/iocore/net/quic/QUICCrypto.cc
+++ b/iocore/net/quic/QUICCrypto.cc
@@ -177,17 +177,21 @@ QUICCryptoTls::initialize_key_materials(QUICConnectionId cid)
   uint8_t print_buf[512];
   std::unique_ptr<KeyMaterial> km;
   km = this->_keygen_for_client.generate(cid);
-  to_hex(print_buf, km->key, km->key_len);
-  Debug("vv_quic_crypto", "client key 0x%s", print_buf);
-  to_hex(print_buf, km->iv, km->iv_len);
-  Debug("vv_quic_crypto", "client iv 0x%s", print_buf);
+  if (is_debug_tag_set("vv_quic_crypto")) {
+    to_hex(print_buf, km->key, km->key_len);
+    Debug("vv_quic_crypto", "client key 0x%s", print_buf);
+    to_hex(print_buf, km->iv, km->iv_len);
+    Debug("vv_quic_crypto", "client iv 0x%s", print_buf);
+  }
   this->_client_pp->set_key(std::move(km), QUICKeyPhase::CLEARTEXT);
 
   km = this->_keygen_for_server.generate(cid);
-  to_hex(print_buf, km->key, km->key_len);
-  Debug("vv_quic_crypto", "server key 0x%s", print_buf);
-  to_hex(print_buf, km->iv, km->iv_len);
-  Debug("vv_quic_crypto", "server iv 0x%s", print_buf);
+  if (is_debug_tag_set("vv_quic_crypto")) {
+    to_hex(print_buf, km->key, km->key_len);
+    Debug("vv_quic_crypto", "server key 0x%s", print_buf);
+    to_hex(print_buf, km->iv, km->iv_len);
+    Debug("vv_quic_crypto", "server iv 0x%s", print_buf);
+  }
   this->_server_pp->set_key(std::move(km), QUICKeyPhase::CLEARTEXT);
 
   // Update algorithm
@@ -222,16 +226,20 @@ QUICCryptoTls::update_key_materials()
   uint8_t print_buf[512];
   std::unique_ptr<KeyMaterial> km;
   km = this->_keygen_for_client.generate(this->_ssl);
-  to_hex(print_buf, km->key, km->key_len);
-  Debug("vv_quic_crypto", "client key 0x%s", print_buf);
-  to_hex(print_buf, km->iv, km->iv_len);
-  Debug("vv_quic_crypto", "client iv 0x%s", print_buf);
+  if (is_debug_tag_set("vv_quic_crypto")) {
+    to_hex(print_buf, km->key, km->key_len);
+    Debug("vv_quic_crypto", "client key 0x%s", print_buf);
+    to_hex(print_buf, km->iv, km->iv_len);
+    Debug("vv_quic_crypto", "client iv 0x%s", print_buf);
+  }
   this->_client_pp->set_key(std::move(km), next_key_phase);
   km = this->_keygen_for_server.generate(this->_ssl);
-  to_hex(print_buf, km->key, km->key_len);
-  Debug("vv_quic_crypto", "server key 0x%s", print_buf);
-  to_hex(print_buf, km->iv, km->iv_len);
-  Debug("vv_quic_crypto", "server iv 0x%s", print_buf);
+  if (is_debug_tag_set("vv_quic_crypto")) {
+    to_hex(print_buf, km->key, km->key_len);
+    Debug("vv_quic_crypto", "server key 0x%s", print_buf);
+    to_hex(print_buf, km->iv, km->iv_len);
+    Debug("vv_quic_crypto", "server iv 0x%s", print_buf);
+  }
   this->_server_pp->set_key(std::move(km), next_key_phase);
 
   // Update algorithm

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