diff options
| author | J08nY | 2017-09-13 00:40:13 +0200 |
|---|---|---|
| committer | J08nY | 2017-09-13 00:40:13 +0200 |
| commit | 607fe7b39f4e2ea579c935509c6e4dc68b43c457 (patch) | |
| tree | a27bf266515b6495c836de9a1ccb1f6398b1ecde /src/io/cli.c | |
| parent | cceec4063e74bb29c79500f38aa40fc466180a0b (diff) | |
| download | ecgen-607fe7b39f4e2ea579c935509c6e4dc68b43c457.tar.gz ecgen-607fe7b39f4e2ea579c935509c6e4dc68b43c457.tar.zst ecgen-607fe7b39f4e2ea579c935509c6e4dc68b43c457.zip | |
Diffstat (limited to 'src/io/cli.c')
| -rw-r--r-- | src/io/cli.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/io/cli.c b/src/io/cli.c index c37652c..dbffd89 100644 --- a/src/io/cli.c +++ b/src/io/cli.c @@ -6,6 +6,7 @@ #include <string.h> #include <unistd.h> #include "config.h" +#include "gen/seed.h" char cli_doc[] = "ecgen, tool for generating Elliptic curve domain parameters.\v(C) 2017 " @@ -200,10 +201,7 @@ error_t cli_parse(int key, char *arg, struct argp_state *state) { case OPT_SEED: cfg->from_seed = true; if (arg) { - // ANSI X9.62 specifies seed as at least 160 bits in length. - // TODO: validate that it is a hex string, or what actually? It - // can be any PARI int. so 123465689 or 0xab45 or 0b1101100100 - if (strlen(arg) < 40) { + if (!seed_valid(arg)) { argp_failure( state, 1, 0, "SEED must be at least 160 bits (40 characters)."); |
