SM4 optimization for ARM by HW instruction
[openssl.git] / apps / info.c
index aa019ad19e0c5a2eee8a0143ee5ce33931ef1439..befc62dac10470e5b53455b494ead25b40c48e4e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
 #include "progs.h"
 
 typedef enum OPTION_choice {
-    OPT_ERR = -1, OPT_EOF = 0, OPT_HELP,
+    OPT_COMMON,
     OPT_CONFIGDIR, OPT_ENGINESDIR, OPT_MODULESDIR, OPT_DSOEXT, OPT_DIRNAMESEP,
-    OPT_LISTSEP
+    OPT_LISTSEP, OPT_SEEDS, OPT_CPUSETTINGS
 } OPTION_CHOICE;
 
 const OPTIONS info_options[] = {
+
+    OPT_SECTION("General"),
     {"help", OPT_HELP, '-', "Display this summary"},
+
+    OPT_SECTION("Output"),
     {"configdir", OPT_CONFIGDIR, '-', "Default configuration file directory"},
-    {"c", OPT_CONFIGDIR, '-', "Default configuration file directory"},
     {"enginesdir", OPT_ENGINESDIR, '-', "Default engine module directory"},
-    {"e", OPT_ENGINESDIR, '-', "Default engine module directory"},
-    {"modulesdir", OPT_ENGINESDIR, '-',
-     "Default module directory (other than engine modules)"},
-    {"m", OPT_ENGINESDIR, '-',
+    {"modulesdir", OPT_MODULESDIR, '-',
      "Default module directory (other than engine modules)"},
     {"dsoext", OPT_DSOEXT, '-', "Configured extension for modules"},
     {"dirnamesep", OPT_DIRNAMESEP, '-', "Directory-filename separator"},
     {"listsep", OPT_LISTSEP, '-', "List separator character"},
+    {"seeds", OPT_SEEDS, '-', "Seed sources"},
+    {"cpusettings", OPT_CPUSETTINGS, '-', "CPU settings info"},
     {NULL}
 };
 
@@ -42,8 +44,7 @@ int info_main(int argc, char **argv)
     prog = opt_init(argc, argv, info_options);
     while ((o = opt_next()) != OPT_EOF) {
         switch (o) {
-        case OPT_EOF:
-        case OPT_ERR:
+        default:
 opthelp:
             BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
             goto end;
@@ -75,12 +76,18 @@ opthelp:
             type = OPENSSL_INFO_LIST_SEPARATOR;
             dirty++;
             break;
+        case OPT_SEEDS:
+            type = OPENSSL_INFO_SEED_SOURCE;
+            dirty++;
+            break;
+        case OPT_CPUSETTINGS:
+            type = OPENSSL_INFO_CPU_SETTINGS;
+            dirty++;
+            break;
         }
     }
-    if (opt_num_rest() != 0) {
-        BIO_printf(bio_err, "%s: Extra parameters given.\n", prog);
+    if (!opt_check_rest_arg(NULL))
         goto opthelp;
-    }
     if (dirty > 1) {
         BIO_printf(bio_err, "%s: Only one item allowed\n", prog);
         goto opthelp;