[Pkg-privacy-commits] [obfsproxy] 108/353: Fix the max padding error condition in obfs3.
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:01:46 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository obfsproxy.
commit 31f108c66321e60a5fd80b9509c3bebe16ddafa9
Author: George Kadianakis <desnacked at riseup.net>
Date: Wed Jan 30 13:35:15 2013 +0200
Fix the max padding error condition in obfs3.
The max padding check in obfs3 did not take into account the situation
where we receive MAX_PADDING bytes of padding plus a partial but legit
magic string, in our TCP stream.
---
obfsproxy/transports/obfs2.py | 1 -
obfsproxy/transports/obfs3.py | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/obfsproxy/transports/obfs2.py b/obfsproxy/transports/obfs2.py
index 4e61886..ee06998 100644
--- a/obfsproxy/transports/obfs2.py
+++ b/obfsproxy/transports/obfs2.py
@@ -27,7 +27,6 @@ HASH_ITERATIONS = 100000
KEYLEN = 16 # is the length of the key used by E(K,s) -- that is, 16.
IVLEN = 16 # is the length of the IV used by E(K,s) -- that is, 16.
-HASHLEN = 16 # is the length of the output of H() -- that is, 32.
ST_WAIT_FOR_KEY = 0
ST_WAIT_FOR_PADDING = 1
diff --git a/obfsproxy/transports/obfs3.py b/obfsproxy/transports/obfs3.py
index 88390e9..0727cc2 100644
--- a/obfsproxy/transports/obfs3.py
+++ b/obfsproxy/transports/obfs3.py
@@ -20,7 +20,7 @@ MAX_PADDING = 8194
PUBKEY_LEN = 192
KEYLEN = 16 # is the length of the key used by E(K,s) -- that is, 16.
-IVLEN = 16 # is the length of the IV used by E(K,s) -- that is, 16.
+HASHLEN = 32 # length of output of sha256
ST_WAIT_FOR_KEY = 0 # Waiting for public key from the other party
ST_SEARCHING_MAGIC = 1 # Waiting for magic strings from the other party
@@ -170,7 +170,7 @@ class Obfs3Transport(base.BaseTransport):
index = chunk.find(self.other_magic_value)
if index < 0:
- if (len(data) > MAX_PADDING):
+ if (len(data) > MAX_PADDING+HASHLEN):
raise base.PluggableTransportError("obfs3: Too much padding (%d)!" % len(data))
log.debug("%s: Did not find magic this time (%d)." % (log_prefix, len(data)))
return
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/obfsproxy.git
More information about the Pkg-privacy-commits
mailing list