X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/blobdiff_plain/088f80a16f384041909c6df6c5fbc98c0d76427f..9c6af4eca6bfb7bed6f86b1f32479f933979c080:/dh.c diff --git a/dh.c b/dh.c index 11f1d35..0b5e4d2 100644 --- a/dh.c +++ b/dh.c @@ -32,6 +32,7 @@ #include #include "secnet.h" +#include "magic.h" #include "util.h" struct dh { @@ -169,6 +170,15 @@ static list_t *dh_apply(closure_t *self, struct cloc loc, dict_t *context, /* According to the docs, mpz_sizeinbase(,256) is allowed to return * an answer which is 1 too large. But mpz_sizeinbase(,2) isn't. */ + if (!dict) + st->ops.capab_bit = CAPAB_BIT_TRADZP; + else + st->ops.capab_bit = dict_read_number(dict, "capab-num", False, + "dh", loc, CAPAB_BIT_TRADZP); + if (st->ops.capab_bit > CAPAB_BIT_MAX) + cfgfatal(loc,"dh","capab-num out of range 0..%d\n", + CAPAB_BIT_MAX); + return new_closure(&st->cl); }