chiark / gitweb /
ec-field-test.c: Make the field-element type use internal format.
[secnet.git] / make-secnet-sites
index 4fa29b0c75dab21a4e41d9ec77733fcabbf5b09e..ad96560001ce6f6c1ac4e1e0b803e18bf0f94789 100755 (executable)
@@ -499,13 +499,16 @@ class networks (basetype):
        def __str__(self):
                return ",".join(map((lambda n: '"%s"'%n), self.set.networks()))
 
-class dhgroup (basetype):
+class trad_dhgroup (basetype):
        "A Diffie-Hellman group"
        def __init__(self,w):
                self.mod=w[1].bignum_16('dh','dh mod')
                self.gen=w[2].bignum_16('dh','dh gen')
        def __str__(self):
                return 'diffie-hellman("%s","%s")'%(self.mod,self.gen)
+def dhgroup(w):
+       if w[1] in ('x25519', 'x448'): return w[1]
+       else: return trad_dhgroup(w)
 
 class hash (basetype):
        "A choice of hash function"
@@ -657,7 +660,7 @@ def somepubkey(w):
 # Possible properties of configuration nodes
 keywords={
  'contact':(email,"Contact address"),
- 'dh':(dhgroup,"Diffie-Hellman group"),
+ 'dh':(listof(dhgroup),"Diffie-Hellman group"),
  'hash':(hash,"Hash function"),
  'key-lifetime':(num,"Maximum key lifetime (ms)"),
  'setup-timeout':(num,"Key setup timeout (ms)"),