[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[minion-cvs] Add assertion to catch getBytes(negative) before stuff ...
Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.mit.edu:/tmp/cvs-serv22594/lib/mixminion
Modified Files:
Crypto.py
Log Message:
Add assertion to catch getBytes(negative) before stuff gets out of hand
Index: Crypto.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Crypto.py,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- Crypto.py 12 Nov 2003 04:35:14 -0000 1.55
+++ Crypto.py 20 Nov 2003 08:47:24 -0000 1.56
@@ -509,6 +509,7 @@
def getBytes(self, n):
"""Returns a string of 'n' random bytes."""
+ assert n >= 0
if n > len(self.bytes):
# If we don't have enough bytes, fetch enough so that we'll have