[Nym3-commit] r188 - in trunk/nym3: . Server

laurent at conuropsis.org laurent at conuropsis.org
Mon Apr 11 20:59:13 CEST 2005


Author: laurent
Date: 2005-04-11 20:59:10 +0200 (Mon, 11 Apr 2005)
New Revision: 188

Modified:
   trunk/nym3/Common.py
   trunk/nym3/Message.py
   trunk/nym3/Server/User.py
Log:
The size of a SURB is *not* a constant.


Modified: trunk/nym3/Common.py
===================================================================
--- trunk/nym3/Common.py	2005-04-11 18:54:20 UTC (rev 187)
+++ trunk/nym3/Common.py	2005-04-11 18:59:10 UTC (rev 188)
@@ -25,8 +25,6 @@
 """Stuff used by both the server and our client"""
 
 #constants
-surbLength = 2104
-"""The length of the surbs in bytes"""
 
 sigLength = 256
 """The length of signatures in bytes"""

Modified: trunk/nym3/Message.py
===================================================================
--- trunk/nym3/Message.py	2005-04-11 18:54:20 UTC (rev 187)
+++ trunk/nym3/Message.py	2005-04-11 18:59:10 UTC (rev 188)
@@ -93,9 +93,6 @@
 	lb = map(isMid, l)
 	return (reduce(lambda x, y: x and y, lb))
 
-surbLength = Common.surbLength
-"""The length of surbs in bytes"""
-
 sigLength = Common.sigLength
 """The length of signatures in bytes"""
 
@@ -411,8 +408,6 @@
 
 	def fromData(self, s):
 		"""Fill a Surb Object from a string containing Surbs"""
-		if(len(s) % surbLength != 0):
-			raise BadArgument("Surb.fromData : surbs have not a valid size: " + str(len(s)))
 		if len(s) >= pow(256, 3):
 			raise BadArgument("Surb.fromData : command body too long")
 		self.surbs = s
@@ -420,8 +415,6 @@
 	def fromStrReader(self, sr, cs):
 		"""Fill a Surb Object from a StrReader
 		raise ParseError if it is malformed"""
-		if(cs % surbLength != 0):
-			raise ParseError("Bad Formed Command : Surb")
 		try:
 			self.surbs = sr.next(cs)
 		except IndexError:

Modified: trunk/nym3/Server/User.py
===================================================================
--- trunk/nym3/Server/User.py	2005-04-11 18:54:20 UTC (rev 187)
+++ trunk/nym3/Server/User.py	2005-04-11 18:59:10 UTC (rev 188)
@@ -38,9 +38,6 @@
 from nym3.Message import intToStrBE
 import mixminion.Crypto as _cr
 
-surb_len = Common.surbLength
-"""The length of a surb"""
-
 lifeCycle = Common.lifeCycle
 """The life cycle of a mail received by a nym"""
 



More information about the Nym3-commit mailing list