mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Represent fingerprint internally as byte array
This commit is contained in:
parent
fa2f6824d9
commit
2f89fbc2ed
4 changed files with 20 additions and 4 deletions
|
@ -5,6 +5,7 @@ package messages
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
|
||||
|
@ -105,6 +106,9 @@ func DecodeClientPollRequest(data []byte) (*ClientPollRequest, error) {
|
|||
if message.Fingerprint == "" {
|
||||
message.Fingerprint = defaultBridgeFingerprint
|
||||
}
|
||||
if hex.DecodedLen(len(message.Fingerprint)) != 20 {
|
||||
return nil, fmt.Errorf("cannot decode fingerprint")
|
||||
}
|
||||
|
||||
switch message.NAT {
|
||||
case "":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue