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

[minion-cvs] Advertise MMTP protocols in server descriptors



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

Modified Files:
	ServerKeys.py 
Log Message:
Advertise MMTP protocols in server descriptors

Index: ServerKeys.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/ServerKeys.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- ServerKeys.py	8 Jan 2003 08:00:40 -0000	1.8
+++ ServerKeys.py	13 Jan 2003 06:18:55 -0000	1.9
@@ -19,6 +19,7 @@
 import mixminion.Crypto
 import mixminion.server.HashLog
 import mixminion.server.PacketHandler
+import mixminion.server.MMTPServer
 
 from mixminion.ServerInfo import ServerInfo, PACKET_KEY_BYTES, signServerInfo
 from mixminion.Common import LOG, MixError, MixFatalError, createPrivateDir, \
@@ -447,6 +448,15 @@
                                        "MMTP certificate for %s" %nickname,
                                        certStarts, certEnds)
 
+    mmtpProtocolsIn = mixminion.server.MMTPServer.MMTPServerConnection \
+                      .PROTOCOL_VERSIONS[:]
+    mmtpProtocolsOut = mixminion.server.MMTPServer.MMTPClientConnection \
+                       .PROTOCOL_VERSIONS[:]
+    mmtpProtocolsIn.sort()
+    mmtpProtocolsOut.sort()
+    mmtpProtocolsIn = ",".join(mmtpProtocolsIn)
+    mmtpProtocolsOut = ",".join(mmtpProtocolsOut)
+
     fields = {
         "IP": config['Incoming/MMTP'].get('IP', "0.0.0.0"),
         "Port": config['Incoming/MMTP'].get('Port', 0),
@@ -460,6 +470,8 @@
            formatBase64(mixminion.Crypto.pk_encode_public_key(packetKey)),
         "KeyID":
            formatBase64(serverKeys.getMMTPKeyID()),
+        "MMTPProtocolsIn" : mmtpProtocolsIn,
+        "MMTPProtocolsOut" : mmtpProtocolsOut,        
         }
 
     # If we don't know our IP address, try to guess
@@ -498,7 +510,7 @@
             Version: 0.1
             Port: %(Port)s
             Key-Digest: %(KeyID)s
-            Protocols: 0.1
+            Protocols: %(MMTPProtocolsIn)s
             """ % fields
         for k,v in config.getSectionItems("Incoming/MMTP"):
             if k not in ("Allow", "Deny"):
@@ -510,8 +522,8 @@
         info += """\
             [Outgoing/MMTP]
             Version: 0.1
-            Protocols: 0.1
-            """
+            Protocols: %(MMTPProtocolsOut)s
+            """ % fields
         for k,v in config.getSectionItems("Outgoing/MMTP"):
             if k not in ("Allow", "Deny"):
                 continue