Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/ClientConf
Binary file not shown.
9 changes: 9 additions & 0 deletions assets/ClientConf.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

c

tapdance1.freeaeskey.xyzh�z�

tapdance2.freeaeskey.xyzi�z�

tapdance3.freeaeskey.xyzj�z�$
���yW�LjQ������`eM��{?�ho�K�� Z
20 changes: 11 additions & 9 deletions cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ func main() {
var tlsLog = flag.String("tlslog", "", "Filename to write SSL secrets to (allows Wireshark to decrypt TLS connections)")
var connect_target = flag.String("connect-addr", "", "If set, tapdance will transparently connect to provided address, which \nmust be either hostname:port or ip:port. "+
"Default(unset): connects client to \nforwardproxy, to which CONNECT request is yet to be written.")

var td = flag.Bool("td", false, "Enable tapdance cli mode for compatibility")

flag.Usage = func() {
fmt.Fprintf(os.Stderr, "Dark Decoy CLI\n$./cli -connect-addr=<decoy_address> [OPTIONS] \n\nOptions:\n")
flag.PrintDefaults()
Expand Down Expand Up @@ -67,11 +70,6 @@ func main() {
if *trace {
tapdance.Logger().Level = logrus.TraceLevel
tapdance.Logger().Trace("Trace logging enabled")

pubkey := tapdance.Assets().GetPubkey()
dst := make([]byte, hex.EncodedLen(len(pubkey)))
hex.Encode(dst, pubkey[:])
tapdance.Logger().Tracef("Using Pubkey: %s", dst)
}

if *tlsLog != "" {
Expand All @@ -81,9 +79,13 @@ func main() {
}
}

fmt.Printf("Using Station Pubkey: %s\n", hex.EncodeToString(tapdance.Assets().GetPubkey()[:]))
if *td {
fmt.Printf("Using Station Pubkey: %s\n", hex.EncodeToString(tapdance.Assets().GetPubkey()[:]))
} else {
fmt.Printf("Using Station Pubkey: %s\n", hex.EncodeToString(tapdance.Assets().GetConjurePubkey()[:]))
}

err := connectDirect(*connect_target, *port, *proxyHeader, v6Support, *width)
err := connectDirect(*td, *connect_target, *port, *proxyHeader, v6Support, *width)
if err != nil {
tapdance.Logger().Println(err)
os.Exit(1)
Expand All @@ -97,7 +99,7 @@ func main() {
}
}

func connectDirect(connect_target string, localPort int, proxyHeader bool, v6Support bool, width int) error {
func connectDirect(td bool, connect_target string, localPort int, proxyHeader bool, v6Support bool, width int) error {
if _, _, err := net.SplitHostPort(connect_target); err != nil {
return fmt.Errorf("failed to parse host and port from connect_target %s: %v",
connect_target, err)
Expand All @@ -109,7 +111,7 @@ func connectDirect(connect_target string, localPort int, proxyHeader bool, v6Sup
return fmt.Errorf("error listening on port %v: %v", localPort, err)
}

tdDialer := tapdance.Dialer{DarkDecoy: true, UseProxyHeader: proxyHeader, V6Support: v6Support, Width: width}
tdDialer := tapdance.Dialer{DarkDecoy: !td, UseProxyHeader: proxyHeader, V6Support: v6Support, Width: width}

for {
clientConn, err := l.AcceptTCP()
Expand Down
159 changes: 84 additions & 75 deletions protobuf/signalling.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions protobuf/signalling.proto
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ message ClientConf {
optional uint32 generation = 2;
optional PubKey default_pubkey = 3;
optional DarkDecoyBlocks dark_decoy_blocks = 4;
optional PubKey conjure_pubkey = 5;
}

message DecoyList {
Expand Down
9 changes: 9 additions & 0 deletions tapdance/assets.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,15 @@ func (a *assets) GetPubkey() *[32]byte {
return &pKey
}

func (a *assets) GetConjurePubkey() *[32]byte {
a.RLock()
defer a.RUnlock()

var pKey [32]byte
copy(pKey[:], a.config.GetConjurePubkey().GetKey()[:])
return &pKey
}

func (a *assets) GetGeneration() uint32 {
a.RLock()
defer a.RUnlock()
Expand Down
Loading