summaryrefslogtreecommitdiff
path: root/apps/mac.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/mac.c')
-rw-r--r--apps/mac.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/apps/mac.c b/apps/mac.c
index a9b6a265f49a..7eb404c83629 100644
--- a/apps/mac.c
+++ b/apps/mac.c
@@ -18,42 +18,46 @@
#include <openssl/core_names.h>
#undef BUFSIZE
-#define BUFSIZE 1024*8
+#define BUFSIZE 1024 * 8
typedef enum OPTION_choice {
OPT_COMMON,
- OPT_MACOPT, OPT_BIN, OPT_IN, OPT_OUT,
- OPT_CIPHER, OPT_DIGEST,
+ OPT_MACOPT,
+ OPT_BIN,
+ OPT_IN,
+ OPT_OUT,
+ OPT_CIPHER,
+ OPT_DIGEST,
OPT_PROV_ENUM
} OPTION_CHOICE;
const OPTIONS mac_options[] = {
- {OPT_HELP_STR, 1, '-', "Usage: %s [options] mac_name\n"},
+ { OPT_HELP_STR, 1, '-', "Usage: %s [options] mac_name\n" },
OPT_SECTION("General"),
- {"help", OPT_HELP, '-', "Display this summary"},
- {"macopt", OPT_MACOPT, 's', "MAC algorithm parameters in n:v form"},
- {"cipher", OPT_CIPHER, 's', "Cipher"},
- {"digest", OPT_DIGEST, 's', "Digest"},
- {OPT_MORE_STR, 1, '-', "See 'PARAMETER NAMES' in the EVP_MAC_ docs"},
+ { "help", OPT_HELP, '-', "Display this summary" },
+ { "macopt", OPT_MACOPT, 's', "MAC algorithm parameters in n:v form" },
+ { "cipher", OPT_CIPHER, 's', "Cipher" },
+ { "digest", OPT_DIGEST, 's', "Digest" },
+ { OPT_MORE_STR, 1, '-', "See 'PARAMETER NAMES' in the EVP_MAC_ docs" },
OPT_SECTION("Input"),
- {"in", OPT_IN, '<', "Input file to MAC (default is stdin)"},
+ { "in", OPT_IN, '<', "Input file to MAC (default is stdin)" },
OPT_SECTION("Output"),
- {"out", OPT_OUT, '>', "Output to filename rather than stdout"},
- {"binary", OPT_BIN, '-',
- "Output in binary format (default is hexadecimal)"},
+ { "out", OPT_OUT, '>', "Output to filename rather than stdout" },
+ { "binary", OPT_BIN, '-',
+ "Output in binary format (default is hexadecimal)" },
OPT_PROV_OPTIONS,
OPT_PARAMETERS(),
- {"mac_name", 0, 0, "MAC algorithm"},
- {NULL}
+ { "mac_name", 0, 0, "MAC algorithm" },
+ { NULL }
};
static char *alloc_mac_algorithm_name(STACK_OF(OPENSSL_STRING) **optp,
- const char *name, const char *arg)
+ const char *name, const char *arg)
{
size_t len = strlen(name) + strlen(arg) + 2;
char *res;
@@ -95,7 +99,7 @@ int mac_main(int argc, char **argv)
while ((o = opt_next()) != OPT_EOF) {
switch (o) {
default:
-opthelp:
+ opthelp:
BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
goto err;
case OPT_HELP:
@@ -156,7 +160,7 @@ opthelp:
int ok = 1;
params = app_params_new_from_opts(opts,
- EVP_MAC_settable_ctx_params(mac));
+ EVP_MAC_settable_ctx_params(mac));
if (params == NULL)
goto err;
@@ -218,7 +222,7 @@ opthelp:
for (i = 0; i < (int)len; ++i)
BIO_printf(out, "%02X", buf[i]);
if (outfile == NULL)
- BIO_printf(out,"\n");
+ BIO_printf(out, "\n");
}
ret = 0;