]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
systemkey: remove unused --inder and --infile options
authorDaiki Ueno <ueno@gnu.org>
Thu, 13 May 2021 06:01:27 +0000 (08:01 +0200)
committerDaiki Ueno <ueno@gnu.org>
Thu, 13 May 2021 07:23:38 +0000 (09:23 +0200)
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>
src/systemkey-args.def
src/systemkey.c

index aca76ee323128a42bcc7c67f23f9561351d56cbf..f13c12704bc74346615b3ceac2bc53d474bea685 100644 (file)
@@ -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 = {
@@ -24,14 +24,6 @@ flag = {
     doc      = "";
 };
 
-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";
index fb19292e544b91e51362c6ccc35b3e67f51ca4a9..248fcbd942c46eb4b9c3327b48adf61f42eb7dd1 100644 (file)
@@ -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)) {