mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 04:07:35 +03:00
add a Transport config option for the key used to encrypt tokens (#4066)
* add a Transport config option for the key used to encrypt tokens * handshake: remove unused error return values
This commit is contained in:
parent
37a3c417a7
commit
862e64c7b9
9 changed files with 78 additions and 85 deletions
12
server.go
12
server.go
|
@ -2,7 +2,6 @@ package quic
|
|||
|
||||
import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
@ -227,18 +226,15 @@ func newServer(
|
|||
config *Config,
|
||||
tracer logging.Tracer,
|
||||
onClose func(),
|
||||
tokenGeneratorKey TokenGeneratorKey,
|
||||
disableVersionNegotiation bool,
|
||||
acceptEarly bool,
|
||||
) (*baseServer, error) {
|
||||
tokenGenerator, err := handshake.NewTokenGenerator(rand.Reader)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
) *baseServer {
|
||||
s := &baseServer{
|
||||
conn: conn,
|
||||
tlsConf: tlsConf,
|
||||
config: config,
|
||||
tokenGenerator: tokenGenerator,
|
||||
tokenGenerator: handshake.NewTokenGenerator(tokenGeneratorKey),
|
||||
connIDGenerator: connIDGenerator,
|
||||
connHandler: connHandler,
|
||||
connQueue: make(chan quicConn),
|
||||
|
@ -260,7 +256,7 @@ func newServer(
|
|||
go s.run()
|
||||
go s.runSendQueue()
|
||||
s.logger.Debugf("Listening for %s connections on %s", conn.LocalAddr().Network(), conn.LocalAddr().String())
|
||||
return s, nil
|
||||
return s
|
||||
}
|
||||
|
||||
func (s *baseServer) run() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue