[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [obfs4/master] fixup! transports/meeklite: uTLS for ClientHello camouflage



commit f01e92dde7c2d4e55e3e030da39e991b4e341899
Author: Yawning Angel <yawning@xxxxxxxxxxxxxxx>
Date:   Fri Feb 1 09:44:12 2019 +0000

    fixup! transports/meeklite: uTLS for ClientHello camouflage
    
    Fix `getDialTLSAddr` to always return a integer port.  Thanks to dcf for
    reporting the issue.
---
 transports/meeklite/transport.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/transports/meeklite/transport.go b/transports/meeklite/transport.go
index a6e1734..65da92e 100644
--- a/transports/meeklite/transport.go
+++ b/transports/meeklite/transport.go
@@ -24,6 +24,7 @@ import (
 	"net"
 	"net/http"
 	"net/url"
+	"strconv"
 	"strings"
 	"sync"
 
@@ -164,8 +165,9 @@ func getDialTLSAddr(u *url.URL) string {
 	if err == nil {
 		return net.JoinHostPort(host, port)
 	}
+	pInt, _ := net.LookupPort("tcp", u.Scheme)
 
-	return net.JoinHostPort(u.Host, u.Scheme)
+	return net.JoinHostPort(u.Host, strconv.Itoa(pInt))
 }
 
 func newRoundTripper(dialFn base.DialFunc, clientHelloID *utls.ClientHelloID) http.RoundTripper {



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits