trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mas...@apache.org
Subject [trafficserver] 03/03: Update labels for key generation
Date Mon, 19 Feb 2018 02:49:57 GMT
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 b6098434a09a1ad8a86ac6125092a6c8c1827b59
Author: Masakazu Kitajo <maskit@apache.org>
AuthorDate: Mon Feb 19 11:45:58 2018 +0900

    Update labels for key generation
---
 iocore/net/quic/QUICKeyGenerator.cc           |  8 ++++----
 iocore/net/quic/test/test_QUICKeyGenerator.cc | 12 ++++++------
 lib/ts/HKDF.cc                                |  4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/iocore/net/quic/QUICKeyGenerator.cc b/iocore/net/quic/QUICKeyGenerator.cc
index c07d137..06ba3b4 100644
--- a/iocore/net/quic/QUICKeyGenerator.cc
+++ b/iocore/net/quic/QUICKeyGenerator.cc
@@ -29,10 +29,10 @@
 constexpr static uint8_t QUIC_VERSION_1_SALT[] = {
   0xaf, 0xc8, 0x24, 0xec, 0x5f, 0xc7, 0x7e, 0xca, 0x1e, 0x9d, 0x36, 0xf3, 0x7f, 0xb2, 0xd4,
0x65, 0x18, 0xc3, 0x66, 0x39,
 };
-constexpr static ts::string_view LABEL_FOR_CLIENT_CLEARTEXT_SECRET("QUIC client handshake
secret"_sv);
-constexpr static ts::string_view LABEL_FOR_SERVER_CLEARTEXT_SECRET("QUIC server handshake
secret"_sv);
-constexpr static ts::string_view LABEL_FOR_CLIENT_PP_SECRET("EXPORTER-QUIC client 1-RTT Secret"_sv);
-constexpr static ts::string_view LABEL_FOR_SERVER_PP_SECRET("EXPORTER-QUIC server 1-RTT Secret"_sv);
+constexpr static ts::string_view LABEL_FOR_CLIENT_CLEARTEXT_SECRET("client hs"_sv);
+constexpr static ts::string_view LABEL_FOR_SERVER_CLEARTEXT_SECRET("server hs"_sv);
+constexpr static ts::string_view LABEL_FOR_CLIENT_PP_SECRET("EXPORTER-QUIC client 1rtt"_sv);
+constexpr static ts::string_view LABEL_FOR_SERVER_PP_SECRET("EXPORTER-QUIC server 1rtt"_sv);
 constexpr static ts::string_view LABEL_FOR_KEY("key"_sv);
 constexpr static ts::string_view LABEL_FOR_IV("iv"_sv);
 
diff --git a/iocore/net/quic/test/test_QUICKeyGenerator.cc b/iocore/net/quic/test/test_QUICKeyGenerator.cc
index 4930a1c..f364f0c 100644
--- a/iocore/net/quic/test/test_QUICKeyGenerator.cc
+++ b/iocore/net/quic/test/test_QUICKeyGenerator.cc
@@ -57,9 +57,9 @@ TEST_CASE("QUICKeyGenerator", "[quic]")
     QUICKeyGenerator keygen(QUICKeyGenerator::Context::CLIENT);
 
     QUICConnectionId cid          = 0x8394c8f03e515708;
-    uint8_t expected_client_key[] = {0x9e, 0xdc, 0x91, 0xd5, 0x51, 0x8c, 0x1e, 0x6b,
-                                     0x2f, 0x80, 0x2b, 0xd1, 0xc8, 0xad, 0x59, 0x23};
-    uint8_t expected_client_iv[] = {0x78, 0xc4, 0x90, 0xe2, 0xe4, 0x22, 0x62, 0x0b, 0x4e,
0xc1, 0xce, 0xc3};
+    uint8_t expected_client_key[] = {0x6b, 0x6a, 0xbc, 0x50, 0xf7, 0xac, 0x46, 0xd1,
+                                     0x10, 0x8c, 0x19, 0xcc, 0x63, 0x64, 0xbd, 0xe3};
+    uint8_t expected_client_iv[] = {0xb1, 0xf9, 0xa7, 0xe2, 0x7c, 0xc2, 0x33, 0xbb, 0x99,
0xe2, 0x03, 0x71};
 
     std::unique_ptr<KeyMaterial> actual_km = keygen.generate(cid);
 
@@ -74,9 +74,9 @@ TEST_CASE("QUICKeyGenerator", "[quic]")
     QUICKeyGenerator keygen(QUICKeyGenerator::Context::SERVER);
 
     QUICConnectionId cid          = 0x8394c8f03e515708;
-    uint8_t expected_server_key[] = {0xa2, 0xaa, 0x67, 0xd4, 0x32, 0x13, 0xba, 0x8d,
-                                     0x55, 0xf5, 0x76, 0x84, 0xb7, 0x1c, 0x0f, 0xc0};
-    uint8_t expected_server_iv[] = {0xa2, 0x6a, 0xa2, 0x24, 0x5c, 0x4f, 0x76, 0x24, 0xa9,
0x5b, 0x0a, 0xbd};
+    uint8_t expected_server_key[] = {0x9e, 0xe7, 0xe8, 0x57, 0x72, 0x00, 0x59, 0xaf,
+                                     0x30, 0x11, 0xfb, 0x26, 0xe1, 0x21, 0x42, 0xc9};
+    uint8_t expected_server_iv[] = {0xd5, 0xee, 0xe8, 0xb5, 0x7c, 0x9e, 0xc7, 0xc4, 0xbe,
0x98, 0x4a, 0xa5};
 
     std::unique_ptr<KeyMaterial> actual_km = keygen.generate(cid);
 
diff --git a/lib/ts/HKDF.cc b/lib/ts/HKDF.cc
index 91f5b94..5971ce1 100644
--- a/lib/ts/HKDF.cc
+++ b/lib/ts/HKDF.cc
@@ -35,8 +35,8 @@ HKDF::expand_label(uint8_t *dst, size_t *dst_len, const uint8_t *secret,
size_t
   hkdf_label[0] = (length >> 8) & 0xFF;
   hkdf_label[1] = length & 0xFF;
   hkdf_label_len += 2;
-  // "tls13 " + Label
-  hkdf_label_len += sprintf(reinterpret_cast<char *>(hkdf_label + hkdf_label_len),
"%ctls13 %.*s", static_cast<int>(6 + label_len),
+  // "QUIC " + Label
+  hkdf_label_len += sprintf(reinterpret_cast<char *>(hkdf_label + hkdf_label_len),
"%cQUIC %.*s", static_cast<int>(5 + label_len),
                             static_cast<int>(label_len), label);
   // Hash Value
   hkdf_label_len += sprintf(reinterpret_cast<char *>(hkdf_label + hkdf_label_len),
"%c%.*s", static_cast<int>(hash_value_len),

-- 
To stop receiving notification emails like this one, please contact
maskit@apache.org.

Mime
View raw message