mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-14 05:11:19 -04:00
reject message with 2047 bytes to reserve higher bits
This commit is contained in:
parent
94eddc6391
commit
182fb83d98
1 changed files with 3 additions and 0 deletions
|
@ -40,6 +40,9 @@ func (c packetPaddingContainer) Unpack(wrappedData_OWNERSHIP_RELINQUISHED []byte
|
||||||
}
|
}
|
||||||
|
|
||||||
dataLen := int(binary.BigEndian.Uint16(wrappedData_OWNERSHIP_RELINQUISHED[dataLength-2:]))
|
dataLen := int(binary.BigEndian.Uint16(wrappedData_OWNERSHIP_RELINQUISHED[dataLength-2:]))
|
||||||
|
if dataLen > 2047 {
|
||||||
|
return nil, 0
|
||||||
|
}
|
||||||
paddingLength := dataLength - dataLen - 2
|
paddingLength := dataLength - dataLen - 2
|
||||||
if paddingLength < 0 {
|
if paddingLength < 0 {
|
||||||
return nil, paddingLength
|
return nil, paddingLength
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue