From 805048ad5378e310a08a063a465bfb90366e9e1f Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Mon, 23 Mar 2020 14:10:16 +0700 Subject: [PATCH] use hkdf.New instead of hkdf.Expand for stateless reset key derivation --- p2p/transport/quic/transport.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/transport/quic/transport.go b/p2p/transport/quic/transport.go index 534984abd..55e7a1bf8 100644 --- a/p2p/transport/quic/transport.go +++ b/p2p/transport/quic/transport.go @@ -117,7 +117,7 @@ func NewTransport(key ic.PrivKey, psk pnet.PSK, filters *filter.Filters) (tpt.Tr if err != nil { return nil, err } - keyReader := hkdf.Expand(sha256.New, keyBytes, []byte("libp2p quic stateless reset key")) + keyReader := hkdf.New(sha256.New, keyBytes, nil, []byte("libp2p quic stateless reset key")) config.StatelessResetKey = make([]byte, 32) if _, err := io.ReadFull(keyReader, config.StatelessResetKey); err != nil { return nil, err