commit 7a374dd4446543339eee75421fbc1af73aa2c011 Author: Philipp Winter phw@torproject.org Date: Mon Mar 3 23:10:51 2014 +0100
Only search for mark in expected space.
We know in which array slice the mark is expected. As a result, we don't have to look any further than that. Patch by Yawning Angel. See the following ticket for reference: https://bugs.torproject.org/11092. --- obfsproxy/transports/scramblesuit/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/obfsproxy/transports/scramblesuit/util.py b/obfsproxy/transports/scramblesuit/util.py index bbb6c6a..bb0557e 100644 --- a/obfsproxy/transports/scramblesuit/util.py +++ b/obfsproxy/transports/scramblesuit/util.py @@ -79,7 +79,7 @@ def locateMark( mark, payload ): `mark' could not be found, `None' is returned. """
- index = payload.find(mark) + index = payload.find(mark, 0, const.MAX_PADDING_LENGTH + const.MARK_LENGTH) if index < 0: log.debug("Could not find the mark just yet.") return None