move MaxTokenAge configuration option to the Transport (#4084)

This commit is contained in:
Marten Seemann
2023-09-16 19:10:20 +07:00
committed by GitHub
parent 9b82196578
commit 1affe38703
7 changed files with 14 additions and 13 deletions

View File

@@ -61,7 +61,7 @@ func (s *tokenProtectorImpl) DecodeToken(p []byte) ([]byte, error) {
}
func (s *tokenProtectorImpl) createAEAD(nonce []byte) (cipher.AEAD, []byte, error) {
h := hkdf.New(sha256.New, s.key[:], nonce[:], []byte("quic-go token source"))
h := hkdf.New(sha256.New, s.key[:], nonce, []byte("quic-go token source"))
key := make([]byte, 32) // use a 32 byte key, in order to select AES-256
if _, err := io.ReadFull(h, key); err != nil {
return nil, nil, err