From 6bb11abcd70d0e8ba58ccffd3041b407a7b6abea Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Thu, 9 Apr 2020 08:33:59 +0700 Subject: [PATCH] use the optimized HKDF-Expand-Label everywhere --- internal/handshake/aead.go | 4 ++-- internal/handshake/updatable_aead.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/handshake/aead.go b/internal/handshake/aead.go index 3175e9973..0eaffd577 100644 --- a/internal/handshake/aead.go +++ b/internal/handshake/aead.go @@ -9,8 +9,8 @@ import ( ) func createAEAD(suite *qtls.CipherSuiteTLS13, trafficSecret []byte) cipher.AEAD { - key := qtls.HkdfExpandLabel(suite.Hash, trafficSecret, []byte{}, "quic key", suite.KeyLen) - iv := qtls.HkdfExpandLabel(suite.Hash, trafficSecret, []byte{}, "quic iv", suite.IVLen()) + key := hkdfExpandLabel(suite.Hash, trafficSecret, []byte{}, "quic key", suite.KeyLen) + iv := hkdfExpandLabel(suite.Hash, trafficSecret, []byte{}, "quic iv", suite.IVLen()) return suite.AEAD(key, iv) } diff --git a/internal/handshake/updatable_aead.go b/internal/handshake/updatable_aead.go index 8453e982a..feaffe7e7 100644 --- a/internal/handshake/updatable_aead.go +++ b/internal/handshake/updatable_aead.go @@ -115,7 +115,7 @@ func (a *updatableAEAD) rollKeys(now time.Time) { } func (a *updatableAEAD) getNextTrafficSecret(hash crypto.Hash, ts []byte) []byte { - return qtls.HkdfExpandLabel(hash, ts, []byte{}, "quic ku", hash.Size()) + return hkdfExpandLabel(hash, ts, []byte{}, "quic ku", hash.Size()) } // For the client, this function is called before SetWriteKey.