Forward bridge fingerprint

gitlab 28651
This commit is contained in:
Arlo Breault 2022-03-08 16:27:52 -05:00
parent 281d917beb
commit b563141c6a
7 changed files with 41 additions and 11 deletions

View file

@ -43,6 +43,7 @@ type BrokerChannel struct {
keepLocalAddresses bool
natType string
lock sync.Mutex
BridgeFingerprint string
}
// We make a copy of DefaultTransport because we want the default Dial
@ -92,6 +93,7 @@ func newBrokerChannelFromConfig(config ClientConfig) (*BrokerChannel, error) {
Rendezvous: rendezvous,
keepLocalAddresses: config.KeepLocalAddresses,
natType: nat.NATUnknown,
BridgeFingerprint: config.BridgeFingerprint,
}, nil
}
@ -116,8 +118,9 @@ func (bc *BrokerChannel) Negotiate(offer *webrtc.SessionDescription) (
// Encode the client poll request.
bc.lock.Lock()
req := &messages.ClientPollRequest{
Offer: offerSDP,
NAT: bc.natType,
Offer: offerSDP,
NAT: bc.natType,
Fingerprint: bc.BridgeFingerprint,
}
encReq, err := req.EncodeClientPollRequest()
bc.lock.Unlock()

View file

@ -103,6 +103,9 @@ type ClientConfig struct {
// UTLSRemoveSNI is the flag to control whether SNI should be removed from Client Hello
// when uTLS is used.
UTLSRemoveSNI bool
// BridgeFingerprint is the fingerprint of the bridge that the client will eventually
// connect to, as specified in the Bridge line of the torrc.
BridgeFingerprint string
}
// NewSnowflakeClient creates a new Snowflake transport client that can spawn multiple