chiark / gitweb /
keys/tripe-keys.in: Provide `kx-genalg' and `kx-param-genalg' options.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 26 May 2016 08:26:09 +0000 (09:26 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 14 May 2017 17:19:08 +0000 (18:19 +0100)
Not all `tripe' key exchange groups G necessarily have `key'
key-generation algorithms named `G' and `G-param' corresponding to them;
it's just a coincidence that they do at the moment.

keys/tripe-keys.conf.5.in
keys/tripe-keys.in

index 3e5c777bbbc4389eb909871b2cf456625203b9c0..06ba3e49608ba78be8c5d7fc662e1413c6554d10 100644 (file)
@@ -143,6 +143,46 @@ or
 .BR dh .
 .ne 7
 .TP
+.I kx-genalg
+Key generation algorithm name to pass to
+.B "key add"
+when generating keys.
+Default depends on
+.I kx
+as follows.
+.TS
+center;
+| ci | ci |
+| lb | lb |.
+_
+kx     kx-genalg
+_
+dh     dh
+ec     ec
+_
+.TE
+.ne 7
+.TP
+.I kx-param-genalg
+Key generation algorithm name to pass to
+.B "key add"
+when generating the parameters key.
+Default depends on
+.I kx
+as follows.
+.TS
+center;
+| ci | ci |
+| lb | lb |.
+_
+kx     kx-param-genalg
+_
+dh     dh-param
+ec     ec-param
+_
+.TE
+.ne 7
+.TP
 .I kx-param
 Options to pass to
 .B "key add"
index 46e1816a886ad8e46f56caba465ba9498d6fdb0e..ce9f74dc35b171bfb139d83f2c682cb4b7735785 100644 (file)
@@ -238,6 +238,10 @@ def conf_defaults():
                ('conf-file', '${base-dir}tripe-keys.conf'),
                ('upload-hook', ': run upload hook'),
                ('kx', 'dh'),
+               ('kx-genalg', lambda: {'dh': 'dh',
+                                      'ec': 'ec'}[conf['kx']]),
+               ('kx-param-genalg', lambda: {'dh': 'dh-param',
+                                            'ec': 'ec-param'}[conf['kx']]),
                ('kx-param', lambda: {'dh': '-LS -b3072 -B256',
                                      'ec': '-Cnist-p256'}[conf['kx']]),
                ('kx-expire', 'now + 1 year'),
@@ -365,7 +369,7 @@ def cmd_newmaster(args):
 def cmd_setup(args):
   OS.mkdir('repos')
   run('''key -krepos/param add
-    -a${kx}-param !${kx-param}
+    -a${kx-param-genalg} !${kx-param}
     -eforever -tparam tripe-param
     kx-group=${kx} cipher=${cipher} hash=${hash} mac=${mac} mgf=${mgf}''')
   cmd_newmaster(args)
@@ -489,7 +493,7 @@ def cmd_generate(args):
   keyring_pub = 'peer-%s.pub' % tag
   zap('keyring'); zap(keyring_pub)
   run('key -kkeyring merge repos/param')
-  run('key -kkeyring add -a${kx} -pparam -e${kx-expire} -t%s tripe' %
+  run('key -kkeyring add -a${kx-genalg} -pparam -e${kx-expire} -t%s tripe' %
       tag)
   run('key -kkeyring extract -f-secret %s %s' % (keyring_pub, tag))