diff options
author | Daiki Ueno <ueno@gnu.org> | 2021-05-13 08:01:27 +0200 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2021-05-13 09:23:38 +0200 |
commit | 42d10e2980a190118eb87cce536af07673ae952a (patch) | |
tree | 06914a5bbbf8d2756294de55a69f929cd4ddb302 /src | |
parent | f5a47e6d27bf0b0948ac9344110517a36005f6b0 (diff) | |
download | gnutls-42d10e2980a190118eb87cce536af07673ae952a.tar.gz |
systemkey: remove unused --inder and --infile options
While those options have no effect, the command previously tried to
open a file for reading and leaked file descriptor.
Signed-off-by: Daiki Ueno <ueno@gnu.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/systemkey-args.def | 10 | ||||
-rw-r--r-- | src/systemkey.c | 22 |
2 files changed, 3 insertions, 29 deletions
diff --git a/src/systemkey-args.def b/src/systemkey-args.def index aca76ee323..f13c12704b 100644 --- a/src/systemkey-args.def +++ b/src/systemkey-args.def @@ -7,7 +7,7 @@ short-usage = "systemkey-tool [options]\nsystemkey-tool --help for usage instr explain = ""; #define OUTFILE_OPT 1 -#define INFILE_OPT 1 +#define INFILE_OPT 0 #include args-std.def flag = { @@ -25,14 +25,6 @@ flag = { }; flag = { - name = inder; - descrip = "Use the DER format for keys."; - disabled; - disable = "no"; - doc = "The input files will be assumed to be in DER format."; -}; - -flag = { name = outder; descrip = "Use DER format for output keys"; disabled; diff --git a/src/systemkey.c b/src/systemkey.c index fb19292e54..248fcbd942 100644 --- a/src/systemkey.c +++ b/src/systemkey.c @@ -50,12 +50,11 @@ static void cmd_parser(int argc, char **argv); static void systemkey_delete(const char *url, FILE * outfile); static void systemkey_list(FILE * outfile); -static gnutls_x509_crt_fmt_t incert_format, outcert_format; -static gnutls_x509_crt_fmt_t inkey_format, outkey_format; +static gnutls_x509_crt_fmt_t outcert_format; +static gnutls_x509_crt_fmt_t outkey_format; static FILE *outfile; static const char *outfile_name = NULL; -static FILE *infile; int batch = 0; int ask_pass = 0; @@ -95,14 +94,6 @@ static void cmd_parser(int argc, char **argv) printf("Setting log level to %d\n", (int) OPT_VALUE_DEBUG); } - if (HAVE_OPT(INDER)) { - incert_format = GNUTLS_X509_FMT_DER; - inkey_format = GNUTLS_X509_FMT_DER; - } else { - incert_format = GNUTLS_X509_FMT_PEM; - inkey_format = GNUTLS_X509_FMT_PEM; - } - if (HAVE_OPT(OUTDER)) { outcert_format = GNUTLS_X509_FMT_DER; outkey_format = GNUTLS_X509_FMT_DER; @@ -121,15 +112,6 @@ static void cmd_parser(int argc, char **argv) } else outfile = stdout; - if (HAVE_OPT(INFILE)) { - infile = fopen(OPT_ARG(INFILE), "rb"); - if (infile == NULL) { - fprintf(stderr, "%s", OPT_ARG(INFILE)); - app_exit(1); - } - } else - infile = stdin; - if (HAVE_OPT(DELETE)) { systemkey_delete(OPT_ARG(DELETE), outfile); } else if (HAVE_OPT(LIST)) { |