inject a random source into the token protector

This commit is contained in:
Marten Seemann 2020-08-23 17:03:15 +07:00
parent 166d91ae0f
commit 556bf18dbf
6 changed files with 44 additions and 10 deletions

View file

@ -3,6 +3,7 @@ package quic
import (
"bytes"
"context"
"crypto/rand"
"crypto/tls"
"errors"
"fmt"
@ -185,7 +186,7 @@ func listen(conn net.PacketConn, tlsConf *tls.Config, config *Config, acceptEarl
if err != nil {
return nil, err
}
tokenGenerator, err := handshake.NewTokenGenerator()
tokenGenerator, err := handshake.NewTokenGenerator(rand.Reader)
if err != nil {
return nil, err
}