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

[minion-cvs] Batch of changes for 0.0.3rc1



Update of /home/minion/cvsroot/src/minion/lib/mixminion/directory
In directory moria.mit.edu:/tmp/cvs-serv18039/lib/mixminion/directory

Modified Files:
	ServerList.py 
Log Message:
Batch of changes for 0.0.3rc1

README:
	- Document changes and new features in 0.0.3

setup.py:
	- Bump version number to 0.0.3rc1

ClientMain:
	- Change directory URL, so that 0.0.3 clients will look for a
          directory at a different place.
	- Add support for recommended versions
	- Update directory cache format
	- Finish documentation
	- Notice early if we have no unused SURBs

Main:
	- Fix bug in 'mixminion version'.
Packet:
	- Increment packet version number

ServerInfo, ServerList:
	- Add 'Recommended-Software' section to directories.

test:
	- Temporarily disable testStallingTransmission
	- Add test for counter mode consistency

ServerMain: 
        - documentation

aes_ctr.c:
	- Break backward compatibility by fixing bug in counter mode.



Index: ServerList.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/directory/ServerList.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- ServerList.py	9 Feb 2003 22:30:58 -0000	1.12
+++ ServerList.py	13 Feb 2003 10:56:40 -0000	1.13
@@ -18,14 +18,27 @@
 import os
 import time
 
+import mixminion
+
 from mixminion.Crypto import pk_encode_public_key, pk_same_public_key
-from mixminion.Common import IntervalSet, LOG, MixError, createPrivateDir, \
+from mixminion.Common import IntervalSet, LOG, MixError, UIError, \
+     createPrivateDir, \
      formatBase64, formatDate, formatFnameTime, formatTime, openUnique, \
      previousMidnight, readPossiblyGzippedFile, stringContains
 from mixminion.Config import ConfigError
 from mixminion.ServerInfo import ServerDirectory, ServerInfo, \
      _getDirectoryDigestImpl
 
+ACCEPTABLE_CLIENT_VERSIONS = "0.0.3rc1"
+ACCEPTABLE_SERVER_VERSIONS = "0.0.3rc1"
+
+for vl in (ACCEPTABLE_CLIENT_VERSIONS.split(),
+           ACCEPTABLE_SERVER_VERSIONS.split()):
+    for v in vl:
+        mixminion.parse_version_string(v)
+del v
+del vl
+
 class ServerList:
     """A ServerList holds a set of server descriptors for use in generating
        directories.  It checks new descriptors for consistency with old ones
@@ -97,11 +110,11 @@
         nickname = server.getNickname()
         lcnickname = nickname.lower()
         if knownOnly and not self.serversByNickname.has_key(lcnickname):
-            raise MixError("Unknown server %s: use import-new."%nickname)
+            raise UIError("Unknown server %s: use import-new."%nickname)
 
         # Is the server already invalid?
         if server.isExpiredAt(time.time()):
-            raise MixError("Descriptor has already expired")
+            raise UIError("Descriptor has already expired")
 
         # Is there already a server with the same nickname?
         if self.serversByNickname.has_key(lcnickname):
@@ -110,16 +123,16 @@
             oldIdentity = oldServer.getIdentity()
             newIdentity = server.getIdentity()
             if not pk_same_public_key(newIdentity, oldIdentity):
-                raise MixError("Identity key has changed for %r" % nickname)
+                raise UIError("Identity key has changed for %r" % nickname)
             # Okay -- make sure we don't have this same descriptor.
             for fn in self.serversByNickname[lcnickname]:
                 oldServer = self.servers[fn]
                 if oldServer['Server']['Digest'] == server['Server']['Digest']:
-                    raise MixError("Server descriptor already inserted.")
+                    raise UIError("Server descriptor already inserted.")
             # Okay -- make sure that this server isn't superseded.
             if server.isSupersededBy(
              [ self.servers[fn] for fn in self.serversByNickname[lcnickname]]):
-                raise MixError("Server descriptor is superseded")
+                raise UIError("Server descriptor is superseded")
 
         newFile = nickname+"-"+formatFnameTime()
         f, newFile = openUnique(os.path.join(self.serverDir, newFile))
@@ -186,11 +199,15 @@
         DirectoryIdentity: %s
         DirectoryDigest:
         DirectorySignature:
+        [Recommended-Software]
+        MixminionClient: %s
+        MixminionServer: %s
         """ % (formatTime(publicationTime),
                formatDate(startAt),
                formatDate(endAt),
-               formatBase64(pk_encode_public_key(identityKey)))
-        # XXXX004 add 'Recommended-software: Mixminion 0.0.3"
+               formatBase64(pk_encode_public_key(identityKey)),
+               ACCEPTABLE_CLIENT_VERSIONS,
+               ACCEPTABLE_SERVER_VERSIONS)
 
         directory = header+"".join(contents)
         directory = _getDirectoryDigestImpl(directory, identityKey)