[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Replacing runner authenticate with shiny new auth



commit 22481b03901f84e9bc9d1951cc0f7343fbc6eb84
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Wed Dec 21 09:00:58 2011 -0800

    Replacing runner authenticate with shiny new auth
    
    The test runner authenticated tor sockets manually for our integ tests.
    Replacing that with our nice, new general auth function.
---
 test/runner.py |   18 +-----------------
 1 files changed, 1 insertions(+), 17 deletions(-)

diff --git a/test/runner.py b/test/runner.py
index 566644b..6b5f6ea 100644
--- a/test/runner.py
+++ b/test/runner.py
@@ -345,24 +345,8 @@ class Runner:
       control_socket = stem.socket.ControlSocketFile(CONTROL_SOCKET_PATH)
     else: return None
     
-    # TODO: replace with higher level authentication functions when we have them
     if authenticate:
-      if OPT_COOKIE in conn_opts:
-        auth_cookie = open(cookie_path, "r")
-        auth_cookie_contents = auth_cookie.read()
-        auth_cookie.close()
-        
-        control_socket.send("AUTHENTICATE %s" % binascii.b2a_hex(auth_cookie_contents))
-      elif OPT_PASSWORD in conn_opts:
-        control_socket.send("AUTHENTICATE \"%s\"" % CONTROL_PASSWORD)
-      else:
-        control_socket.send("AUTHENTICATE")
-      
-      authenticate_response = control_socket.recv()
-      
-      if str(authenticate_response) != "OK":
-        # authentication was rejected
-        logging.error("AUTHENTICATE returned a failure response: %s" % authenticate_response)
+      stem.connection.authenticate(control_socket, CONTROL_PASSWORD)
     
     return control_socket
   



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits