chiark / gitweb /
make-secnet-sites: Prepare for multiple public key types
[secnet.git] / make-secnet-sites
index 0f1e8bab8b7d99fc58788e833841a6d0f33a1286..b7720d2f1ece0a14b0f119fc5a3be73803095b4a 100755 (executable)
@@ -413,7 +413,10 @@ class address (basetype):
        def __str__(self):
                return '"%s"; port %d'%(self.adr,self.port)
 
-class rsakey (basetype):
+class pubkey (basetype):
+       "Some kind of publie key"
+
+class rsakey (pubkey):
        "An RSA public key"
        def __init__(self,w):
                self.l=w[1].number(0,max['rsa_bits'],'rsa len')
@@ -423,6 +426,12 @@ class rsakey (basetype):
        def __str__(self):
                return 'rsa-public("%s","%s")'%(self.e,self.n)
 
+def somepubkey(w):
+       if w[0]=='pubkey':
+               return rsakey(w)
+       else:
+               assert(False)
+
 # Possible properties of configuration nodes
 keywords={
  'contact':(email,"Contact address"),
@@ -435,7 +444,7 @@ keywords={
  'renegotiate-time':(num,"Time after key setup to begin renegotiation (ms)"),
  'restrict-nets':(networks,"Allowable networks"),
  'networks':(networks,"Claimed networks"),
- 'pubkey':(listof(rsakey),"RSA public site key"),
+ 'pubkey':(listof(somepubkey),"RSA public site key"),
  'peer':(single_ipaddr,"Tunnel peer IP address"),
  'address':(address,"External contact address and port"),
  'mobile':(boolean,"Site is mobile"),