[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] fix most torctl issues; move rest into TODO
Update of /home/or/cvsroot/control/python
In directory moria:/tmp/cvs-serv6984/python
Modified Files:
TorCtl.py TorCtl1.py
Log Message:
fix most torctl issues; move rest into TODO
Index: TorCtl.py
===================================================================
RCS file: /home/or/cvsroot/control/python/TorCtl.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- TorCtl.py 13 Jul 2005 05:15:36 -0000 1.6
+++ TorCtl.py 14 Jul 2005 20:26:11 -0000 1.7
@@ -7,6 +7,7 @@
TorCtl -- Library to control Tor processes. See TorCtlDemo.py for example use.
"""
+import os
import struct
import sys
@@ -294,8 +295,13 @@
finally:
f.close()
-def s2k_gen(secret, rng):
+def s2k_gen(secret, rng=None):
"""DOCDOC"""
+ if rng is None:
+ if hasattr(os, "urandom"):
+ rng = os.urandom
+ else:
+ rng = urandom_rng
spec = "%s%s"%(rng(8), chr(96))
return "16:%s"%(
binascii.b2a_hex(spec + secret_to_key(secret, spec)))
Index: TorCtl1.py
===================================================================
RCS file: /home/or/cvsroot/control/python/TorCtl1.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- TorCtl1.py 13 Jul 2005 06:12:12 -0000 1.4
+++ TorCtl1.py 14 Jul 2005 20:26:11 -0000 1.5
@@ -229,8 +229,9 @@
self._sendAndRecv("AUTHENTICATE %s\r\n"%hexstr)
def get_option(self, name):
- """Return the value of the configuration option named 'name'.
- DOCDOC
+ """Get the value of the configuration option named 'name'. To
+ retrieve multiple values, pass a list for 'name' instead of
+ a string. Returns a list of (key,value) pairs.
"""
if not isinstance(name, str):
name = " ".join(name)