mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-05 21:27:35 +03:00
allow up to 20 byte for the initial connection IDs
This commit is contained in:
parent
deacefdd34
commit
d226f70cd7
2 changed files with 7 additions and 7 deletions
|
@ -10,7 +10,7 @@ import (
|
|||
// A ConnectionID in QUIC
|
||||
type ConnectionID []byte
|
||||
|
||||
const maxConnectionIDLen = 18
|
||||
const maxConnectionIDLen = 20
|
||||
|
||||
// GenerateConnectionID generates a connection ID using cryptographic random
|
||||
func GenerateConnectionID(len int) (ConnectionID, error) {
|
||||
|
@ -22,7 +22,7 @@ func GenerateConnectionID(len int) (ConnectionID, error) {
|
|||
}
|
||||
|
||||
// GenerateConnectionIDForInitial generates a connection ID for the Initial packet.
|
||||
// It uses a length randomly chosen between 8 and 18 bytes.
|
||||
// It uses a length randomly chosen between 8 and 20 bytes.
|
||||
func GenerateConnectionIDForInitial() (ConnectionID, error) {
|
||||
r := make([]byte, 1)
|
||||
if _, err := rand.Read(r); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue