aboutsummaryrefslogtreecommitdiffstats
path: root/src/pki/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/pki/commands')
-rw-r--r--src/pki/commands/gen.c12
-rw-r--r--src/pki/commands/issue.c4
-rw-r--r--src/pki/commands/keyid.c8
-rw-r--r--src/pki/commands/pub.c10
-rw-r--r--src/pki/commands/self.c4
-rw-r--r--src/pki/commands/verify.c6
6 files changed, 22 insertions, 22 deletions
diff --git a/src/pki/commands/gen.c b/src/pki/commands/gen.c
index 4bc8f8c2d..791c1353e 100644
--- a/src/pki/commands/gen.c
+++ b/src/pki/commands/gen.c
@@ -31,7 +31,7 @@ static int gen(int argc, char *argv[])
switch (getopt_long(argc, argv, "", command_opts, NULL))
{
case 'h':
- return command_usage(CMD_GEN, NULL);
+ return command_usage(NULL);
case 't':
if (streq(optarg, "rsa"))
{
@@ -43,26 +43,26 @@ static int gen(int argc, char *argv[])
}
else
{
- return command_usage(CMD_GEN, "invalid key type");
+ return command_usage("invalid key type");
}
continue;
case 'o':
if (!get_form(optarg, &form, FALSE))
{
- return command_usage(CMD_GEN, "invalid key output format");
+ return command_usage("invalid key output format");
}
continue;
case 's':
size = atoi(optarg);
if (!size)
{
- return command_usage(CMD_GEN, "invalid key size");
+ return command_usage("invalid key size");
}
continue;
case EOF:
break;
default:
- return command_usage(CMD_GEN, "invalid --gen option");
+ return command_usage("invalid --gen option");
}
break;
}
@@ -110,7 +110,7 @@ static int gen(int argc, char *argv[])
*/
static void __attribute__ ((constructor))reg()
{
- command_register(CMD_GEN, (command_t) {
+ command_register((command_t) {
gen, 'g', "gen", "generate a new private key",
{"[--type rsa|ecdsa] [--size bits] [--outform der|pem|pgp]"},
{
diff --git a/src/pki/commands/issue.c b/src/pki/commands/issue.c
index 097d7d22f..c141827fa 100644
--- a/src/pki/commands/issue.c
+++ b/src/pki/commands/issue.c
@@ -247,7 +247,7 @@ end:
usage:
san->destroy_offset(san, offsetof(identification_t, destroy));
options->destroy(options);
- return command_usage(CMD_ISSUE, error);
+ return command_usage(error);
}
/**
@@ -255,7 +255,7 @@ usage:
*/
static void __attribute__ ((constructor))reg()
{
- command_register(CMD_ISSUE, (command_t) {
+ command_register((command_t) {
issue, 'i', "issue",
"issue a certificate using a CA certificate and key",
{"[--in file] [--type pub|pkcs10]",
diff --git a/src/pki/commands/keyid.c b/src/pki/commands/keyid.c
index e270c9460..128645ee0 100644
--- a/src/pki/commands/keyid.c
+++ b/src/pki/commands/keyid.c
@@ -37,7 +37,7 @@ static int keyid(int argc, char *argv[])
switch (getopt_long(argc, argv, "", command_opts, NULL))
{
case 'h':
- return command_usage(CMD_KEYID, NULL);
+ return command_usage(NULL);
case 't':
if (streq(optarg, "rsa-priv"))
{
@@ -61,7 +61,7 @@ static int keyid(int argc, char *argv[])
}
else
{
- return command_usage(CMD_KEYID, "invalid input type");
+ return command_usage( "invalid input type");
}
continue;
case 'i':
@@ -70,7 +70,7 @@ static int keyid(int argc, char *argv[])
case EOF:
break;
default:
- return command_usage(CMD_KEYID, "invalid --keyid option");
+ return command_usage("invalid --keyid option");
}
break;
}
@@ -144,7 +144,7 @@ static int keyid(int argc, char *argv[])
*/
static void __attribute__ ((constructor))reg()
{
- command_register(CMD_KEYID, (command_t)
+ command_register((command_t)
{ keyid, 'k', "keyid",
"calculate key identifiers of a key/certificate",
{"[--in file] [--type rsa-priv|ecdsa-priv|pub|x509]"},
diff --git a/src/pki/commands/pub.c b/src/pki/commands/pub.c
index 5e7839fd6..16bd0b049 100644
--- a/src/pki/commands/pub.c
+++ b/src/pki/commands/pub.c
@@ -38,7 +38,7 @@ static int pub(int argc, char *argv[])
switch (getopt_long(argc, argv, "", command_opts, NULL))
{
case 'h':
- return command_usage(CMD_PUB, NULL);
+ return command_usage(NULL);
case 't':
if (streq(optarg, "rsa"))
{
@@ -57,13 +57,13 @@ static int pub(int argc, char *argv[])
}
else
{
- return command_usage(CMD_PUB, "invalid input type");
+ return command_usage("invalid input type");
}
continue;
case 'f':
if (!get_form(optarg, &form, TRUE))
{
- return command_usage(CMD_PUB, "invalid output format");
+ return command_usage("invalid output format");
}
continue;
case 'i':
@@ -72,7 +72,7 @@ static int pub(int argc, char *argv[])
case EOF:
break;
default:
- return command_usage(CMD_PUB, "invalid --pub option");
+ return command_usage("invalid --pub option");
}
break;
}
@@ -136,7 +136,7 @@ static int pub(int argc, char *argv[])
*/
static void __attribute__ ((constructor))reg()
{
- command_register(CMD_PUB, (command_t) {
+ command_register((command_t) {
pub, 'p', "pub",
"extract the public key from a private key/certificate",
{"[--in file] [--type rsa|ecdsa|x509] [--outform der|pem|pgp]"},
diff --git a/src/pki/commands/self.c b/src/pki/commands/self.c
index 1f1138e9c..de1761c9c 100644
--- a/src/pki/commands/self.c
+++ b/src/pki/commands/self.c
@@ -206,7 +206,7 @@ end:
usage:
san->destroy_offset(san, offsetof(identification_t, destroy));
options->destroy(options);
- return command_usage(CMD_SELF, error);
+ return command_usage(error);
}
/**
@@ -214,7 +214,7 @@ usage:
*/
static void __attribute__ ((constructor))reg()
{
- command_register(CMD_SELF, (command_t) {
+ command_register((command_t) {
self, 's', "self",
"create a self signed certificate",
{"[--in file] [--type rsa|ecdsa]",
diff --git a/src/pki/commands/verify.c b/src/pki/commands/verify.c
index 6905112fb..d089d3384 100644
--- a/src/pki/commands/verify.c
+++ b/src/pki/commands/verify.c
@@ -32,7 +32,7 @@ static int verify(int argc, char *argv[])
switch (getopt_long(argc, argv, "", command_opts, NULL))
{
case 'h':
- return command_usage(CMD_VERIFY, NULL);
+ return command_usage(NULL);
case 'i':
file = optarg;
continue;
@@ -42,7 +42,7 @@ static int verify(int argc, char *argv[])
case EOF:
break;
default:
- return command_usage(CMD_VERIFY, "invalid --verify option");
+ return command_usage("invalid --verify option");
}
break;
}
@@ -121,7 +121,7 @@ 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]"},