[tor-commits] [stegotorus/master] fixed a bug in skipJSPattern()

zwol at torproject.org zwol at torproject.org
Fri Jul 20 23:17:06 UTC 2012


commit f9d8053e6c1127fc5bc9d7c0ac3ae5e98263fcf8
Author: Steven Cheung <cheung at csl.sri.com>
Date:   Thu Jan 5 00:32:58 2012 +0000

    fixed a bug in skipJSPattern()
    
    git-svn-id: svn+ssh://spartan.csl.sri.com/svn/private/DEFIANCE@202 a58ff0ac-194c-e011-a152-003048836090
---
 src/steg/payloads.cc |    2 +-
 src/steg/payloads.h  |    5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/steg/payloads.cc b/src/steg/payloads.cc
index 34c2963..8d08b1a 100644
--- a/src/steg/payloads.cc
+++ b/src/steg/payloads.cc
@@ -651,7 +651,7 @@ int skipJSPattern(char *cp, int len) {
       if (cp[j] != word[j])
 	goto next_word;
     }
-    if (!isalnum(cp[j]))
+    if (!isalnum(cp[j]) && cp[j] != JS_DELIMITER && cp[j] != JS_DELIMITER_REPLACEMENT)
       return strlen(word)+1;
       
   next_word:
diff --git a/src/steg/payloads.h b/src/steg/payloads.h
index ace7dad..0104ee0 100644
--- a/src/steg/payloads.h
+++ b/src/steg/payloads.h
@@ -14,8 +14,6 @@
    server_data, client data, protocol data
 */
 
-
-
 #define RECV_GOOD 0
 #define RECV_INCOMPLETE 0
 #define RECV_BAD -1
@@ -35,7 +33,7 @@
 #define JS_DELIMITER '?'
 // a JavaScript delimiter is used to signal the end of encoding
 // to facilitate the decoding process
-#define JS_DELIMITER_REPLACEMENT '.'
+#define JS_DELIMITER_REPLACEMENT '!'
 // JS_DELIMITER that exists in the JavaScript before the end of
 // data encoding will be replaced by JS_DELIMITER_REPLACEMENT
 #define JS_DELIMITER_SIZE 1
@@ -121,6 +119,7 @@ typedef struct service_state {
 
 
 #define HTTP_MSG_BUF_SIZE 100000
+
 void load_payloads(const char* fname);
 unsigned int find_client_payload(char* buf, int len, int type);
 unsigned int find_server_payload(char** buf, int len, int type, int contentType);





More information about the tor-commits mailing list