diff --git a/src/tools/cardos-info.c b/src/tools/cardos-info.c index e1ce9f03..5bbcf062 100644 --- a/src/tools/cardos-info.c +++ b/src/tools/cardos-info.c @@ -34,12 +34,12 @@ #include #include "util.h" -const char *app_name = "cardos-info"; +static const char *app_name = "cardos-info"; static int opt_reader = -1, opt_debug = 0, opt_wait = 0; static int verbose = 0; -const struct option options[] = { +static const struct option options[] = { {"reader", 1, NULL, 'r'}, {"card-driver", 1, NULL, 'c'}, {"wait", 0, NULL, 'w'}, @@ -47,7 +47,7 @@ const struct option options[] = { {NULL, 0, NULL, 0} }; -const char *option_help[] = { +static const char *option_help[] = { "Uses reader number [0]", "Forces the use of driver [auto-detect]", "Wait for a card to be inserted", diff --git a/src/tools/cryptoflex-tool.c b/src/tools/cryptoflex-tool.c index c1fc5233..f08134e9 100644 --- a/src/tools/cryptoflex-tool.c +++ b/src/tools/cryptoflex-tool.c @@ -30,7 +30,7 @@ #include "util.h" #include "strlcpy.h" -const char *app_name = "cryptoflex-tool"; +static const char *app_name = "cryptoflex-tool"; static int opt_reader = 0; static int opt_key_num = 1, opt_pin_num = -1; @@ -44,7 +44,7 @@ static int opt_puk_attempts = 10; static const char *opt_appdf = NULL, *opt_prkeyf = NULL, *opt_pubkeyf = NULL; static u8 *pincode = NULL; -const struct option options[] = { +static const struct option options[] = { { "list-keys", 0, NULL, 'l' }, { "create-key-files", 1, NULL, 'c' }, { "create-pin-file", 1, NULL, 'P' }, @@ -62,7 +62,7 @@ const struct option options[] = { { NULL, 0, NULL, 0 } }; -const char *option_help[] = { +static const char *option_help[] = { "Lists all keys in a public key file", "Creates new RSA key files for keys", "Creates a new CHV file", diff --git a/src/tools/eidenv.c b/src/tools/eidenv.c index ca210d41..8c7e9281 100644 --- a/src/tools/eidenv.c +++ b/src/tools/eidenv.c @@ -40,7 +40,7 @@ static int stats = 0; static char *exec_program = NULL; static int exit_status = EXIT_FAILURE; -const struct option options[] = { +static const struct option options[] = { {"reader", required_argument, NULL, 'r'}, {"print", no_argument, NULL, 'n'}, {"exec", required_argument, NULL, 'x'}, @@ -51,8 +51,8 @@ const struct option options[] = { }; /* Probably not used, but needed to build on Windows */ -const char *app_name = "eidenv"; -const char *option_help[] = {NULL}; +static const char *app_name = "eidenv"; +static const char *option_help[] = {NULL}; static struct { const char *name; diff --git a/src/tools/opensc-explorer.c b/src/tools/opensc-explorer.c index 0273b936..78b6bfbe 100644 --- a/src/tools/opensc-explorer.c +++ b/src/tools/opensc-explorer.c @@ -35,7 +35,7 @@ #define DIM(v) (sizeof(v)/sizeof((v)[0])) -const char *app_name = "opensc-explorer"; +static const char *app_name = "opensc-explorer"; static int opt_reader = -1, opt_wait = 0, verbose = 0; static const char *opt_driver = NULL; @@ -45,14 +45,14 @@ static sc_path_t current_path; static sc_context_t *ctx = NULL; static sc_card_t *card = NULL; -const struct option options[] = { +static const struct option options[] = { { "reader", 1, NULL, 'r' }, { "card-driver", 1, NULL, 'c' }, { "wait", 1, NULL, 'w' }, { "verbose", 0, NULL, 'v' }, { NULL, 0, NULL, 0 } }; -const char *option_help[] = { +static const char *option_help[] = { "Uses reader number [0]", "Forces the use of driver [auto-detect]", "Wait for card insertion", diff --git a/src/tools/opensc-tool.c b/src/tools/opensc-tool.c index 81445fde..6f2684b5 100644 --- a/src/tools/opensc-tool.c +++ b/src/tools/opensc-tool.c @@ -34,7 +34,7 @@ #include #include "util.h" -const char *app_name = "opensc-tool"; +static const char *app_name = "opensc-tool"; static int opt_reader = -1, opt_wait = 0; @@ -46,7 +46,7 @@ enum { OPT_SERIAL = 0x100, }; -const struct option options[] = { +static const struct option options[] = { { "atr", 0, NULL, 'a' }, { "serial", 0, NULL, OPT_SERIAL }, { "name", 0, NULL, 'n' }, @@ -62,7 +62,7 @@ const struct option options[] = { { NULL, 0, NULL, 0 } }; -const char *option_help[] = { +static static const char *option_help[] = { "Prints the ATR bytes of the card", "Prints the card serial number", "Identify the card and print its name", diff --git a/src/tools/piv-tool.c b/src/tools/piv-tool.c index 236158ee..b568ae86 100644 --- a/src/tools/piv-tool.c +++ b/src/tools/piv-tool.c @@ -41,7 +41,7 @@ #include #include -const char *app_name = "piv-tool"; +static const char *app_name = "piv-tool"; static int opt_reader = -1, opt_wait = 0; @@ -53,7 +53,7 @@ enum { OPT_SERIAL = 0x100, }; -const struct option options[] = { +static const struct option options[] = { { "serial", 0, NULL, OPT_SERIAL }, { "name", 0, NULL, 'n' }, { "admin", 0, NULL, 'A' }, @@ -72,7 +72,7 @@ const struct option options[] = { { NULL, 0, NULL, 0 } }; -const char *option_help[] = { +static const char *option_help[] = { "Prints the card serial number", "Identify the card and print its name", "authenticate using default 3des key", diff --git a/src/tools/pkcs11-tool.c b/src/tools/pkcs11-tool.c index 8f82ee37..0450e9dc 100644 --- a/src/tools/pkcs11-tool.c +++ b/src/tools/pkcs11-tool.c @@ -56,7 +56,7 @@ enum { OPT_PRIVATE }; -const struct option options[] = { +static const struct option options[] = { { "show-info", 0, NULL, 'I' }, { "list-slots", 0, NULL, 'L' }, { "list-mechanisms", 0, NULL, 'M' }, @@ -97,7 +97,7 @@ const struct option options[] = { { NULL, 0, NULL, 0 } }; -const char *option_help[] = { +static const char *option_help[] = { "Show global token information", "List slots available on the token", "List mechanisms supported by the token", @@ -136,7 +136,7 @@ const char *option_help[] = { "Set the CKA_PRIVATE attribute (object is only viewable after a login)" }; -const char * app_name = "pkcs11-tool"; /* for utils.c */ +static const char * app_name = "pkcs11-tool"; /* for utils.c */ static int verbose = 0; static const char * opt_input = NULL; diff --git a/src/tools/pkcs15-crypt.c b/src/tools/pkcs15-crypt.c index ea57532d..3e315360 100644 --- a/src/tools/pkcs15-crypt.c +++ b/src/tools/pkcs15-crypt.c @@ -37,7 +37,7 @@ #endif #include "util.h" -const char *app_name = "pkcs15-crypt"; +static const char *app_name = "pkcs15-crypt"; static int opt_reader = -1, verbose = 0, opt_wait = 0, opt_raw = 0; static char * opt_pincode = NULL, * opt_key_id = NULL; @@ -54,7 +54,7 @@ enum { OPT_PKCS1, }; -const struct option options[] = { +static const struct option options[] = { { "sign", 0, NULL, 's' }, { "decipher", 0, NULL, 'c' }, { "key", 1, NULL, 'k' }, @@ -75,7 +75,7 @@ const struct option options[] = { { NULL, 0, NULL, 0 } }; -const char *option_help[] = { +static const char *option_help[] = { "Performs digital signature operation", "Decipher operation", "Selects the private key ID to use", diff --git a/src/tools/pkcs15-init.c b/src/tools/pkcs15-init.c index aa0f3415..4ead75df 100644 --- a/src/tools/pkcs15-init.c +++ b/src/tools/pkcs15-init.c @@ -58,7 +58,7 @@ #undef GET_KEY_ECHO_OFF -const char *app_name = "pkcs15-init"; +static const char *app_name = "pkcs15-init"; /* Handle encoding of PKCS15 on the card */ typedef int (*pkcs15_encoder)(sc_context_t *, @@ -186,7 +186,7 @@ const struct option options[] = { { "secret", required_argument, NULL, OPT_SECRET }, { NULL, 0, NULL, 0 } }; -const char * option_help[] = { +static const char * option_help[] = { "Erase the smart card (can be used with --create-pkcs15)", "Creates a new PKCS #15 structure", "Store a new PIN/PUK on the card", diff --git a/src/tools/pkcs15-tool.c b/src/tools/pkcs15-tool.c index 7288c18e..0d38ce29 100644 --- a/src/tools/pkcs15-tool.c +++ b/src/tools/pkcs15-tool.c @@ -38,7 +38,7 @@ typedef unsigned __int32 uint32_t; #include #include "util.h" -const char *app_name = "pkcs15-tool"; +static const char *app_name = "pkcs15-tool"; static int opt_reader = -1, opt_wait = 0; static int opt_no_cache = 0; @@ -74,7 +74,7 @@ enum { static int authenticate(sc_pkcs15_object_t *obj); static int pem_encode(int, sc_pkcs15_der_t *, sc_pkcs15_der_t *); -const struct option options[] = { +static const struct option options[] = { { "learn-card", no_argument, NULL, 'L' }, { "read-certificate", required_argument, NULL, 'r' }, { "list-certificates", no_argument, NULL, 'c' }, @@ -102,7 +102,7 @@ const struct option options[] = { { NULL, 0, NULL, 0 } }; -const char *option_help[] = { +static const char *option_help[] = { "Stores card info to cache", "Reads certificate with ID ", "Lists certificates",