Update version

This commit is contained in:
Shtorm
2026-11-06 20:36:41 +03:00
parent 272b0255b3
commit 35723df677
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -113,7 +113,7 @@ func (c *CommonConn) Read(b []byte) (int, error) {
if _, err := io.ReadFull(c.Conn, peerHeader[:]); err != nil {
return 0, err
}
l, err := DecodeHeader(peerHeader[:]) // l: 17~17000
l, err := DecodeHeader(peerHeader[:]) // l: 17~16640
if err != nil {
if c.Client != nil && errors.Is(err, ErrInvalidHeader) { // client's 0-RTT
c.Client.RWLock.Lock()
@@ -238,7 +238,7 @@ func DecodeHeader(h []byte) (l int, err error) {
if h[0] != 23 || h[1] != 3 || h[2] != 3 {
l = 0
}
if l < 17 || l > 17000 { // TODO: TLSv1.3 max length
if l < 17 || l > 16640 { // TLS 1.3 max record: 16384 + 256 (RFC 8446 §5.2)
err = fmt.Errorf("%w: %v", ErrInvalidHeader, h[:5]) // DO NOT CHANGE: relied by client's Read()
}
return
+4 -4
View File
@@ -319,6 +319,10 @@ func parseServerDecryption(raw string) (serverDecryptionConfig, error) {
if segment == "" {
return cfg, E.New("invalid empty segment in decryption string")
}
if paddingPhase && len(segment) < 20 {
paddingParts = append(paddingParts, segment)
continue
}
if data, err := base64.RawURLEncoding.DecodeString(segment); err == nil {
if len(data) == 32 || len(data) == 64 {
cfg.keys = append(cfg.keys, data)
@@ -327,10 +331,6 @@ func parseServerDecryption(raw string) (serverDecryptionConfig, error) {
}
return cfg, E.New("invalid decryption key length: ", len(data))
}
if paddingPhase {
paddingParts = append(paddingParts, segment)
continue
}
return cfg, E.New("invalid decryption key: ", segment)
}
if len(cfg.keys) == 0 {