This is an automated email from the git hooks/post-receive script.
dcf pushed a commit to branch main in repository pluggable-transports/goptlib.
The following commit(s) were added to refs/heads/main by this push: new 3155c60 Update some references to ext-orport-spec.txt. 3155c60 is described below
commit 3155c6049a6eb37eaf82d423e4e518cf3d8a2110 Author: David Fifield david@bamsoftware.com AuthorDate: Fri Apr 14 19:13:42 2023 -0600
Update some references to ext-orport-spec.txt.
These might have been done in b31bdca77deeeb3c9da4116473b65e8ffba9ea0b, apart from the https://spec.torproject.org/ext-orport-spec permalink which did not exist at that time. --- README | 2 +- pt.go | 30 ++++++++++++++---------------- 2 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/README b/README index acab129..1a48b3c 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ goptlib is a library for writing Tor pluggable transports in Go.
https://spec.torproject.org/pt-spec -https://gitweb.torproject.org/torspec.git/tree/ext-orport-spec.txt +https://spec.torproject.org/ext-orport-spec
To download a copy of the library into $GOPATH: go get git.torproject.org/pluggable-transports/goptlib.git diff --git a/pt.go b/pt.go index d01e497..9661f0c 100644 --- a/pt.go +++ b/pt.go @@ -122,7 +122,7 @@ // https://spec.torproject.org/pt-spec // // Extended ORPort: -// https://gitweb.torproject.org/torspec.git/tree/ext-orport-spec.txt +// https://spec.torproject.org/ext-orport-spec // // The package implements a SOCKS5 server sufficient for a Tor client transport // plugin. @@ -674,7 +674,7 @@ func readAuthCookie(f io.Reader) ([]byte, error) { }
// Read and validate the contents of an auth cookie file. Returns the 32-byte -// cookie. See section 4.2.1.2 of 217-ext-orport-auth.txt. +// cookie. See section 2.1.2 of ext-orport-spec.txt. func readAuthCookieFile(filename string) (cookie []byte, err error) { f, err := os.Open(filename) if err != nil { @@ -764,7 +764,7 @@ func ServerSetup(_ []string) (info ServerInfo, err error) { return info, nil }
-// See 217-ext-orport-auth.txt section 4.2.1.3. +// See ext-orport-spec.txt section 2.1.3. func computeServerHash(authCookie, clientNonce, serverNonce []byte) []byte { h := hmac.New(sha256.New, authCookie) io.WriteString(h, "ExtORPort authentication server-to-client hash") @@ -773,7 +773,7 @@ func computeServerHash(authCookie, clientNonce, serverNonce []byte) []byte { return h.Sum([]byte{}) }
-// See 217-ext-orport-auth.txt section 4.2.1.3. +// See ext-orport-spec.txt section 2.1.3. func computeClientHash(authCookie, clientNonce, serverNonce []byte) []byte { h := hmac.New(sha256.New, authCookie) io.WriteString(h, "ExtORPort authentication client-to-server hash") @@ -783,7 +783,7 @@ func computeClientHash(authCookie, clientNonce, serverNonce []byte) []byte { }
func extOrPortAuthenticate(s io.ReadWriter, info *ServerInfo) error { - // Read auth types. 217-ext-orport-auth.txt section 4.1. + // Read auth types. ext-orport-spec.txt section 2. var authTypes [256]bool var count int for count = 0; count < 256; count++ { @@ -866,7 +866,7 @@ func extOrPortAuthenticate(s io.ReadWriter, info *ServerInfo) error { return nil }
-// See section 3.1.1 of 196-transport-control-ports.txt. +// See section 3.1 of ext-orport-spec.txt. const ( extOrCmdDone = 0x0000 extOrCmdUserAddr = 0x0001 @@ -900,19 +900,17 @@ func extOrPortSendCommand(s io.Writer, cmd uint16, body []byte) error { return nil }
-// Send a USERADDR command on s. See section 3.1.2.1 of -// 196-transport-control-ports.txt. +// Send a USERADDR command on s. See section 3.2.1 of ext-orport-spec.txt. func extOrPortSendUserAddr(s io.Writer, addr string) error { return extOrPortSendCommand(s, extOrCmdUserAddr, []byte(addr)) }
-// Send a TRANSPORT command on s. See section 3.1.2.2 of -// 196-transport-control-ports.txt. +// Send a TRANSPORT command on s. See section 3.2.2 of ext-orport-spec.txt. func extOrPortSendTransport(s io.Writer, methodName string) error { return extOrPortSendCommand(s, extOrCmdTransport, []byte(methodName)) }
-// Send a DONE command on s. See section 3.1 of 196-transport-control-ports.txt. +// Send a DONE command on s. See section 3.1 of ext-orport-spec.txt. func extOrPortSendDone(s io.Writer) error { return extOrPortSendCommand(s, extOrCmdDone, []byte{}) } @@ -1001,9 +999,9 @@ func extOrPortSetup(s net.Conn, timeout time.Duration, }
// Dial (using the given net.Dialer) info.ExtendedOrAddr if defined, or else -// info.OrAddr, and return an open net.Conn. If connecting to the extended -// OR port, extended OR port authentication à la 217-ext-orport-auth.txt is done -// before returning; an error is returned if authentication fails. +// info.OrAddr, and return an open net.Conn. If connecting to the extended OR +// port, extended OR port authentication is done before returning; an error is +// returned if authentication fails. // // The addr and methodName arguments are put in USERADDR and TRANSPORT ExtOrPort // commands, respectively. If either is "", the corresponding command is not @@ -1028,8 +1026,8 @@ func DialOrWithDialer(dialer *net.Dialer, info *ServerInfo, addr, methodName str
// Dial info.ExtendedOrAddr if defined, or else info.OrAddr, and return an open // *net.TCPConn. If connecting to the extended OR port, extended OR port -// authentication à la 217-ext-orport-auth.txt is done before returning; an -// error is returned if authentication fails. +// authentication is done before returning; an error is returned if +// authentication fails. // // The addr and methodName arguments are put in USERADDR and TRANSPORT ExtOrPort // commands, respectively. If either is "", the corresponding command is not