summaryrefslogtreecommitdiff
path: root/obfs4.go
diff options
context:
space:
mode:
authorYawning Angel <yawning@schwanenlied.me>2014-05-23 04:04:31 +0000
committerYawning Angel <yawning@schwanenlied.me>2014-05-23 04:04:31 +0000
commit272fb852e72ac282144fe8608fea62ab74b9549c (patch)
treeed5afd35f72cc3739caf75395674b612f812ce76 /obfs4.go
parentfd4e3c7c74ad4d1acb37c43fde8d18786616846a (diff)
Change the maximm handshake length to 8192 bytes.
* handhake_ntor_test now is considerably more comprehensive. * The padding related constants in the spec were clarified. This breaks wireprotocol compatibility.
Diffstat (limited to 'obfs4.go')
-rw-r--r--obfs4.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/obfs4.go b/obfs4.go
index e9ba2e8..f32c222 100644
--- a/obfs4.go
+++ b/obfs4.go
@@ -48,7 +48,7 @@ const (
headerLength = framing.FrameOverhead + packetOverhead
connectionTimeout = time.Duration(30) * time.Second
- maxCloseDelayBytes = framing.MaximumSegmentLength * 5
+ maxCloseDelayBytes = maxHandshakeLength
maxCloseDelay = 60
)
@@ -181,7 +181,7 @@ func (c *Obfs4Conn) clientHandshake(nodeID *ntor.NodeID, publicKey *ntor.PublicK
}
// Consume the server handshake.
- var hsBuf [serverMaxHandshakeLength]byte
+ var hsBuf [maxHandshakeLength]byte
for {
var n int
n, err = c.conn.Read(hsBuf[:])
@@ -235,7 +235,7 @@ func (c *Obfs4Conn) serverHandshake(nodeID *ntor.NodeID, keypair *ntor.Keypair)
}
// Consume the client handshake.
- var hsBuf [clientMaxHandshakeLength]byte
+ var hsBuf [maxHandshakeLength]byte
for {
var n int
n, err = c.conn.Read(hsBuf[:])