Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Anti-censorship
Pluggable Transports
Snowflake
Commits
d5a87c3c
Verified
Commit
d5a87c3c
authored
Apr 08, 2022
by
shelikhoo
Browse files
Guard Proxy Relay URL Acceptance with Pattern Check
parent
863a8296
Changes
1
Hide whitespace changes
Inline
Side-by-side
proxy/lib/snowflake.go
View file @
d5a87c3c
...
...
@@ -30,6 +30,7 @@ import (
"crypto/rand"
"encoding/base64"
"fmt"
"git.torproject.org/pluggable-transports/snowflake.git/v2/common/namematcher"
"io"
"io/ioutil"
"log"
...
...
@@ -494,6 +495,12 @@ func (sf *SnowflakeProxy) runSession(sid string) {
tokens
.
ret
()
return
}
matcher
:=
namematcher
.
NewNameMatcher
(
sf
.
RelayDomainNamePattern
)
if
relayURL
!=
""
&&
!
matcher
.
IsMember
(
relayURL
)
{
log
.
Printf
(
"bad offer from broker: rejected Relay URL"
)
tokens
.
ret
()
return
}
dataChan
:=
make
(
chan
struct
{})
dataChannelAdaptor
:=
dataChannelHandlerWithRelayURL
{
RelayURL
:
relayURL
,
sf
:
sf
}
pc
,
err
:=
sf
.
makePeerConnectionFromOffer
(
offer
,
config
,
dataChan
,
dataChannelAdaptor
.
datachannelHandler
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment