[Telepathy-commits] [telepathy-gabble/master] Send a valid SOCKS5 connect command instead of dummy data

Marco Barisione marco at barisione.org
Tue Jan 6 08:41:26 PST 2009


---
 tests/twisted/tubes/test-si-socks5-tubes.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/twisted/tubes/test-si-socks5-tubes.py b/tests/twisted/tubes/test-si-socks5-tubes.py
index 58f12b0..c3aa713 100644
--- a/tests/twisted/tubes/test-si-socks5-tubes.py
+++ b/tests/twisted/tubes/test-si-socks5-tubes.py
@@ -731,8 +731,14 @@ def test(q, bus, conn, stream):
     event = q.expect('s5b-data-received')
     event.properties['data'] == '\x05\x00' # version 5, no auth
 
-    # FIXME: send the correct data
-    transport.write('X' * 47)
+    # version 5, connect, reserved, domain type
+    connect = '\x05\x01\x00\x03'
+    connect += chr(40) # len (SHA-1)
+    # sha-1(sid + initiator + target)
+    unhashed_domain = query['sid'] + 'test at localhost/Resource' + 'bob at localhost/Bob'
+    connect += sha.new(unhashed_domain).hexdigest()
+    connect += '\x00\x00' # port
+    transport.write(connect)
 
     event = q.expect('s5b-data-received')
     event.properties['data'] == '\x05\x00' # version 5, ok
-- 
1.5.6.5




More information about the Telepathy-commits mailing list