Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
move the info used for stateless key expansion to a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Mar 25, 2020
1 parent c75d8dc commit 9637bdb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ var quicConfig = &quic.Config{
KeepAlive: true,
}

const statelessResetKeyInfo = "libp2p quic stateless reset key"

type connManager struct {
reuseUDP4 *reuse
reuseUDP6 *reuse
Expand Down Expand Up @@ -117,7 +119,7 @@ func NewTransport(key ic.PrivKey, psk pnet.PSK, filters *filter.Filters) (tpt.Tr
if err != nil {
return nil, err
}
keyReader := hkdf.New(sha256.New, keyBytes, nil, []byte("libp2p quic stateless reset key"))
keyReader := hkdf.New(sha256.New, keyBytes, nil, []byte(statelessResetKeyInfo))
config.StatelessResetKey = make([]byte, 32)
if _, err := io.ReadFull(keyReader, config.StatelessResetKey); err != nil {
return nil, err
Expand Down

0 comments on commit 9637bdb

Please sign in to comment.