[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[minion-cvs] minor patches after looking at the code



Update of /home/minion/cvsroot/src/minion/lib/mixminion
In directory moria.seul.org:/home/arma/work/minion/src/minion/lib/mixminion

Modified Files:
	BuildMessage.py HashLog.py MMTPServer.py Packet.py 
	PacketHandler.py 
Log Message:
minor patches after looking at the code


Index: BuildMessage.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/BuildMessage.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- BuildMessage.py	25 Jun 2002 11:41:07 -0000	1.7
+++ BuildMessage.py	27 Jun 2002 23:32:24 -0000	1.8
@@ -18,9 +18,9 @@
     """Construct a forward message.
             payload: The payload to deliver.
             exitType: The routing type for the final node
-            exitType: The routing info for the final node
+            exitInfo: The routing info for the final node
             path1: Sequence of ServerInfo objects for the first leg of the path
-            path1: Sequence of ServerInfo objects for the 2nd leg of the path
+            path2: Sequence of ServerInfo objects for the 2nd leg of the path
     """
     return _buildMessage(payload, exitType, exitInfo, path1, path2)
 
@@ -38,7 +38,7 @@
               path: A list of ServerInfo
               exitType: Routing type to use for the final node
               exitInfo: Routing info for the final node
-              expiryTime: The time at which this block should expirt.
+              expiryTime: The time at which this block should expire.
               secretPRNG: A PRNG to use for generating secrets.  If not
                  provided, uses an AES counter-mode stream seeded from our
                  entropy source.
@@ -68,7 +68,7 @@
        their anonymity can be completely broken.
 
                   path: a list of ServerInfo objects
-                  user: the users username/email address
+                  user: the user's username/email address
                   userKey: an AES key to encrypt the seed, or None.
                   email: If true, delivers via SMTP; else delivers via LOCAL.
        """
@@ -136,7 +136,7 @@
     else:
         secretRNG = paddingPRNG
 
-    # Determine exit routing for path1 and path2.
+    # Determine exit routing for path1.
     if reply:
         path1exittype = reply.routingType
         path1exitinfo = reply.routingInfo
@@ -153,7 +153,7 @@
     secrets1 = [ secretRNG.getBytes(SECRET_LEN) for _ in path1 ]
     
     if path2:
-        # Make secrets for header 2, and construct header 2.  We do the before
+        # Make secrets for header 2, and construct header 2.  We do this before
         # making header1 so that our rng won't be used for padding yet.
         secrets2 = [ secretRNG.getBytes(SECRET_LEN) for _ in range(len(path2))]
         header2 = _buildHeader(path2,secrets2,exitType,exitInfo,paddingPRNG)
@@ -171,8 +171,8 @@
     """Helper method to construct a single header.
            path: A sequence of serverinfo objects.
            secrets: A list of 16-byte strings to use as master-secrets for
-               each of the subeaders.
-           exitType: The routing for the last node in the header
+               each of the subheaders.
+           exitType: The routing type for the last node in the header
            exitInfo: The routing info for the last node in the header
            paddingPRNG: A pseudo-random number generator to generate padding
     """
@@ -189,9 +189,9 @@
     # sizes[i] is size, in blocks, of subheaders for i.
     sizes =[ getTotalBlocksForRoutingInfoLen(len(ri)) for _, ri in routing]
     
-    # totalSize is number total number of blocks.
+    # totalSize is the total number of blocks.
     totalSize = reduce(operator.add, sizes)
-    if totalSize * ENC_SUBHEADER_LEN >  HEADER_LEN:
+    if totalSize * ENC_SUBHEADER_LEN > HEADER_LEN:
         raise MixError("Routing info won't fit in header")
 
     # headerKey[i]==the AES key object node i will use to decrypt the header

Index: HashLog.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/HashLog.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- HashLog.py	25 Jun 2002 11:41:08 -0000	1.5
+++ HashLog.py	27 Jun 2002 23:32:24 -0000	1.6
@@ -17,7 +17,7 @@
        already processed.
 
        Each HashLog corresponds to a single public key (whose hash is the
-       log's keyid.  A HashLog must persist for as long as the key does.
+       log's keyid).  A HashLog must persist for as long as the key does.
 
        It is not necessary to sync the HashLog to the disk every time a new
        message is seen; rather, the HashLog must be synced before any messages

Index: MMTPServer.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/MMTPServer.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- MMTPServer.py	25 Jun 2002 11:41:08 -0000	1.2
+++ MMTPServer.py	27 Jun 2002 23:32:24 -0000	1.3
@@ -4,7 +4,7 @@
 
    This package implements the Mixminion Transfer Protocol as described
    in the Mixminion specification.  It uses a select loop to provide
-   an nonblocking implementation of *both* the client and the server sides
+   a nonblocking implementation of *both* the client and the server sides
    of the protocol.
 
    If you just want to send messages into the system, use MMTPClient.
@@ -163,7 +163,7 @@
        a buffer is exhausted.
 
        After leaving states 1,2,3,or 4, the connection's "finished" method
-       is called.  After leaving state 5, the connection's "shutdownFinishied"
+       is called.  After leaving state 5, the connection's "shutdownFinished"
        method is called.
     """
     # Fields:
@@ -172,7 +172,7 @@
     #           throw _ml.TLSWantRead or _ml.TLSWantWrite.
     #    __server: an AsyncServer.
     #    __inbuf: A list of strings that we've read since the last expectRead. 
-    #    __inbuflen: The total length of alll the strings in __inbuf
+    #    __inbuflen: The total length of all the strings in __inbuf
     #    __expectReadLen: None, or the number of bytes to read before
     #           the current read succeeds.
     #    __maxReadLen: None, or a number of bytes above which the current

Index: Packet.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/Packet.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Packet.py	25 Jun 2002 11:41:08 -0000	1.3
+++ Packet.py	27 Jun 2002 23:32:24 -0000	1.4
@@ -310,7 +310,7 @@
 class IPV4Info:
     """An IPV4Info object represents the routinginfo for a FWD or SWAP_FWD hop.
 
-       Fields: ip (a dotted quad), port (an int from 0..65535), and keyinfo
+       Fields: ip (a dotted quad string), port (an int from 0..65535), and keyinfo
        (a digest)."""
     def __init__(self, ip, port, keyinfo):
         """Construct a new IPV4Info"""

Index: PacketHandler.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/PacketHandler.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- PacketHandler.py	25 Jun 2002 11:41:08 -0000	1.3
+++ PacketHandler.py	27 Jun 2002 23:32:24 -0000	1.4
@@ -19,7 +19,7 @@
        it removes one layer of encryption, does all necessary integrity
        checks, swaps headers if necessary, re-pads, and decides whether
        to drop the message, relay the message, or send the message to
-       an exist handler."""
+       an exit handler."""
     
     def __init__(self, privatekey, hashlog):
         """Constructs a new packet handler, given a private key object for
@@ -43,7 +43,7 @@
         """Given a 32K mixminion message, processes it completely.
 
            Returns one of:
-                    None [if the mesesage should be dropped.
+                    None [if the mesesage should be dropped.]
                     ("EXIT",
                        (routing_type, routing_info, application_key,
                         payload)) [if this is the exit node]
@@ -55,7 +55,7 @@
            unhandleable.
 
            WARNING: This implementation does nothing to prevent timing
-           attacks: dropped messages, messages with digests, replayed
+           attacks: dropped messages, messages with bad digests, replayed
            messages, and exit messages are all processed faster than
            forwarded messages.  You must prevent timing attacks elsewhere."""