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

[minion-cvs] Directories implemented for client and server, but not ...



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

Modified Files:
	Modules.py ServerConfig.py ServerKeys.py 
Log Message:
Directories implemented for client and server, but not doc'd or tested.

TODO:
- Reflect state of directory work.

setup.py:
- Run python as python -O from the default-installed script.

ClientMain.py:
- Reimplement keystore to know about directories and select paths.  The new
  one also caches parsed values to run a bit faster.
- Make the path interface a little more complicated.
- Simplify 'main' a bit by refactoring out the configfile and usage logic.

Config, ServerInfo:
- Builtin gzip support

Config, ServerInfo, server/ServerConfig:
- Restrict nicknames to reasonable characters

Crypto:
- Add 'fingerprint' function
- Document more.
- Add rng.pick(lst) as a shortcut for lst[rng.getInt(len(lst))]

Main, directory/DirMain:
- Add CLI for directory generation:

ServerInfo:
- Add numerous helper functions to ServerInfo
- Add ServerDirectory class to parse server directories.

test:
- Add tests for nickname validation
- Tests for pk_same_public_key and pk_fingerprint
- Tests for directory generation and parsing.

directory/ServerList:
- Debug, document, refactor

server/Modules:
- Use balanced 'banners' around email-quoted messages (Suggested by Lucky)

server/ServerKeys:
- Add 'now' argument to generateServerDescriptorAndKeys for testing


Index: Modules.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/Modules.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Modules.py	20 Dec 2002 23:51:23 -0000	1.7
+++ Modules.py	3 Jan 2003 05:14:47 -0000	1.8
@@ -684,8 +684,9 @@
         tag = ""
 
     return """\
-%s============ ANONYMOUS MESSAGE BEGINS
-%s%s============ ANONYMOUS MESSAGE ENDS\n""" %(junk_msg, tag, msg)
+%s============ ANONYMOUS MESSAGE BEGINS ============
+%s%s============= ANONYMOUS MESSAGE ENDS =============
+""" %(junk_msg, tag, msg)
 
 def _escapeMessage(message, tag, text=0):
     """Helper: given a decoded message (and possibly its tag), determine

Index: ServerConfig.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/ServerConfig.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- ServerConfig.py	31 Dec 2002 04:36:35 -0000	1.6
+++ ServerConfig.py	3 Jan 2003 05:14:47 -0000	1.7
@@ -156,7 +156,7 @@
                                              "5 minutes"),
                      'EncryptPrivateKey' : ('REQUIRE', C._parseBoolean, "no"),
                      'Mode' : ('REQUIRE', C._parseServerMode, "local"),
-                     'Nickname': ('ALLOW', None, None),
+                     'Nickname': ('ALLOW', C._parseNickname, None),
                      'Contact-Email': ('ALLOW', None, None),
                      'Comments': ('ALLOW', None, None),
                      'ModulePath': ('ALLOW', None, None),

Index: ServerKeys.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/ServerKeys.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ServerKeys.py	29 Dec 2002 20:28:39 -0000	1.4
+++ ServerKeys.py	3 Jan 2003 05:14:47 -0000	1.5
@@ -381,7 +381,7 @@
 CERTIFICATE_EXPIRY_SLOPPINESS = 5*60
 
 def generateServerDescriptorAndKeys(config, identityKey, keydir, keyname,
-                                    hashdir, validAt=None):
+                                    hashdir, validAt=None, now=None):
     """Generate and sign a new server descriptor, and generate all the keys to
        go with it.
 
@@ -415,8 +415,10 @@
         LOG.warn("No nickname given: defaulting to %r", nickname)
     contact = config['Server']['Contact-Email']
     comments = config['Server']['Comments']
+    if not now:
+        now = time.time()
     if not validAt:
-        validAt = time.time()
+        validAt = now
 
     # Calculate descriptor and X509 certificate lifetimes.
     # (Round validAt to previous mignight.)
@@ -438,7 +440,7 @@
         "Nickname": nickname,
         "Identity":
            formatBase64(mixminion.Crypto.pk_encode_public_key(identityKey)),
-        "Published": formatTime(time.time()),
+        "Published": formatTime(now),
         "ValidAfter": formatDate(validAt),
         "ValidUntil": formatDate(validUntil),
         "PacketKey":