Do not query for CKA_ALWAYS_AUTHENTICATE if PKCS#11 Cryptoki version < 2.20
[strongswan.git] / src / pki / commands / verify.c
index 6905112..bbcc538 100644 (file)
 /**
  * Verify a certificate signature
  */
-static int verify(int argc, char *argv[])
+static int verify()
 {
        certificate_t *cert, *ca;
        char *file = NULL, *cafile = NULL;
        bool good = FALSE;
+       char *arg;
 
        while (TRUE)
        {
-               switch (getopt_long(argc, argv, "", command_opts, NULL))
+               switch (command_getopt(&arg))
                {
                        case 'h':
-                               return command_usage(CMD_VERIFY, NULL);
+                               return command_usage(NULL);
                        case 'i':
-                               file = optarg;
+                               file = arg;
                                continue;
                        case 'c':
-                               cafile = optarg;
+                               cafile = arg;
                                continue;
                        case EOF:
                                break;
                        default:
-                               return command_usage(CMD_VERIFY, "invalid --verify option");
+                               return command_usage("invalid --verify option");
                }
                break;
        }
@@ -121,13 +122,13 @@ static int verify(int argc, char *argv[])
  */
 static void __attribute__ ((constructor))reg()
 {
-       command_register(CMD_VERIFY, (command_t) {
+       command_register((command_t) {
                verify, 'v', "verify",
                "verify a certificate using the CA certificate",
                {"[--in file] [--ca file]"},
                {
                        {"help",        'h', 0, "show usage information"},
-                       {"in",          'i', 1, "x509 certifcate to verify, default: stdin"},
+                       {"in",          'i', 1, "X.509 certificate to verify, default: stdin"},
                        {"cacert",      'c', 1, "CA certificate, default: verify self signed"},
                }
        });