提交 44c83ebd 编写于 作者: F FdaSilvaYY

Constify command options

Reviewed-by: NKurt Roeckx <kurt@openssl.org>
Reviewed-by: NRichard Levitte <levitte@openssl.org>
Reviewed-by: NRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1694)
上级 83bd048e
...@@ -30,7 +30,7 @@ typedef enum OPTION_choice { ...@@ -30,7 +30,7 @@ typedef enum OPTION_choice {
OPT_ITEM OPT_ITEM
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS asn1parse_options[] = { const OPTIONS asn1parse_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"inform", OPT_INFORM, 'F', "input format - one of DER PEM"}, {"inform", OPT_INFORM, 'F', "input format - one of DER PEM"},
{"in", OPT_IN, '<', "input file"}, {"in", OPT_IN, '<', "input file"},
......
...@@ -155,7 +155,7 @@ typedef enum OPTION_choice { ...@@ -155,7 +155,7 @@ typedef enum OPTION_choice {
OPT_CRL_REASON, OPT_CRL_HOLD, OPT_CRL_COMPROMISE, OPT_CRL_CA_COMPROMISE OPT_CRL_REASON, OPT_CRL_HOLD, OPT_CRL_COMPROMISE, OPT_CRL_CA_COMPROMISE
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS ca_options[] = { const OPTIONS ca_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"verbose", OPT_VERBOSE, '-', "Verbose output during processing"}, {"verbose", OPT_VERBOSE, '-', "Verbose output during processing"},
{"config", OPT_CONFIG, 's', "A config file"}, {"config", OPT_CONFIG, 's', "A config file"},
......
...@@ -26,7 +26,7 @@ typedef enum OPTION_choice { ...@@ -26,7 +26,7 @@ typedef enum OPTION_choice {
OPT_V, OPT_UPPER_V, OPT_S OPT_V, OPT_UPPER_V, OPT_S
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS ciphers_options[] = { const OPTIONS ciphers_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"v", OPT_V, '-', "Verbose listing of the SSL/TLS ciphers"}, {"v", OPT_V, '-', "Verbose listing of the SSL/TLS ciphers"},
{"V", OPT_UPPER_V, '-', "Even more verbose"}, {"V", OPT_UPPER_V, '-', "Even more verbose"},
......
...@@ -84,7 +84,7 @@ typedef enum OPTION_choice { ...@@ -84,7 +84,7 @@ typedef enum OPTION_choice {
OPT_CIPHER OPT_CIPHER
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS cms_options[] = { const OPTIONS cms_options[] = {
{OPT_HELP_STR, 1, '-', "Usage: %s [options] cert.pem...\n"}, {OPT_HELP_STR, 1, '-', "Usage: %s [options] cert.pem...\n"},
{OPT_HELP_STR, 1, '-', {OPT_HELP_STR, 1, '-',
" cert.pem... recipient certs for encryption\n"}, " cert.pem... recipient certs for encryption\n"},
......
...@@ -26,7 +26,7 @@ typedef enum OPTION_choice { ...@@ -26,7 +26,7 @@ typedef enum OPTION_choice {
OPT_NOOUT, OPT_NAMEOPT, OPT_MD OPT_NOOUT, OPT_NAMEOPT, OPT_MD
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS crl_options[] = { const OPTIONS crl_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"inform", OPT_INFORM, 'F', "Input format; default PEM"}, {"inform", OPT_INFORM, 'F', "Input format; default PEM"},
{"in", OPT_IN, '<', "Input file - default stdin"}, {"in", OPT_IN, '<', "Input file - default stdin"},
......
...@@ -25,7 +25,7 @@ typedef enum OPTION_choice { ...@@ -25,7 +25,7 @@ typedef enum OPTION_choice {
OPT_INFORM, OPT_OUTFORM, OPT_IN, OPT_OUT, OPT_NOCRL, OPT_CERTFILE OPT_INFORM, OPT_OUTFORM, OPT_IN, OPT_OUT, OPT_NOCRL, OPT_CERTFILE
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS crl2pkcs7_options[] = { const OPTIONS crl2pkcs7_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"inform", OPT_INFORM, 'F', "Input format - DER or PEM"}, {"inform", OPT_INFORM, 'F', "Input format - DER or PEM"},
{"outform", OPT_OUTFORM, 'F', "Output format - DER or PEM"}, {"outform", OPT_OUTFORM, 'F', "Output format - DER or PEM"},
......
...@@ -36,7 +36,7 @@ typedef enum OPTION_choice { ...@@ -36,7 +36,7 @@ typedef enum OPTION_choice {
OPT_DIGEST OPT_DIGEST
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS dgst_options[] = { const OPTIONS dgst_options[] = {
{OPT_HELP_STR, 1, '-', "Usage: %s [options] [file...]\n"}, {OPT_HELP_STR, 1, '-', "Usage: %s [options] [file...]\n"},
{OPT_HELP_STR, 1, '-', {OPT_HELP_STR, 1, '-',
" file... files to digest (default is stdin)\n"}, " file... files to digest (default is stdin)\n"},
......
...@@ -39,7 +39,7 @@ typedef enum OPTION_choice { ...@@ -39,7 +39,7 @@ typedef enum OPTION_choice {
OPT_RAND, OPT_DSAPARAM, OPT_C, OPT_2, OPT_5 OPT_RAND, OPT_DSAPARAM, OPT_C, OPT_2, OPT_5
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS dhparam_options[] = { const OPTIONS dhparam_options[] = {
{OPT_HELP_STR, 1, '-', "Usage: %s [flags] [numbits]\n"}, {OPT_HELP_STR, 1, '-', "Usage: %s [flags] [numbits]\n"},
{OPT_HELP_STR, 1, '-', "Valid options are:\n"}, {OPT_HELP_STR, 1, '-', "Valid options are:\n"},
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
......
...@@ -34,7 +34,7 @@ typedef enum OPTION_choice { ...@@ -34,7 +34,7 @@ typedef enum OPTION_choice {
OPT_PUBOUT, OPT_CIPHER, OPT_PASSIN, OPT_PASSOUT OPT_PUBOUT, OPT_CIPHER, OPT_PASSIN, OPT_PASSOUT
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS dsa_options[] = { const OPTIONS dsa_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"inform", OPT_INFORM, 'f', "Input format, DER PEM PVK"}, {"inform", OPT_INFORM, 'f', "Input format, DER PEM PVK"},
{"outform", OPT_OUTFORM, 'F', "Output format, DER PEM PVK"}, {"outform", OPT_OUTFORM, 'F', "Output format, DER PEM PVK"},
......
...@@ -44,7 +44,7 @@ typedef enum OPTION_choice { ...@@ -44,7 +44,7 @@ typedef enum OPTION_choice {
OPT_TIMEBOMB OPT_TIMEBOMB
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS dsaparam_options[] = { const OPTIONS dsaparam_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"inform", OPT_INFORM, 'F', "Input format - DER or PEM"}, {"inform", OPT_INFORM, 'F', "Input format - DER or PEM"},
{"in", OPT_IN, '<', "Input file"}, {"in", OPT_IN, '<', "Input file"},
......
...@@ -42,7 +42,7 @@ typedef enum OPTION_choice { ...@@ -42,7 +42,7 @@ typedef enum OPTION_choice {
OPT_NO_PUBLIC, OPT_CHECK OPT_NO_PUBLIC, OPT_CHECK
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS ec_options[] = { const OPTIONS ec_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"in", OPT_IN, 's', "Input file"}, {"in", OPT_IN, 's', "Input file"},
{"inform", OPT_INFORM, 'f', "Input format - DER or PEM"}, {"inform", OPT_INFORM, 'f', "Input format - DER or PEM"},
......
...@@ -45,7 +45,7 @@ typedef enum OPTION_choice { ...@@ -45,7 +45,7 @@ typedef enum OPTION_choice {
OPT_CONV_FORM, OPT_PARAM_ENC, OPT_GENKEY, OPT_RAND, OPT_ENGINE OPT_CONV_FORM, OPT_PARAM_ENC, OPT_GENKEY, OPT_RAND, OPT_ENGINE
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS ecparam_options[] = { const OPTIONS ecparam_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"inform", OPT_INFORM, 'F', "Input format - default PEM (DER or PEM)"}, {"inform", OPT_INFORM, 'F', "Input format - default PEM (DER or PEM)"},
{"outform", OPT_OUTFORM, 'F', "Output format - default PEM"}, {"outform", OPT_OUTFORM, 'F', "Output format - default PEM"},
......
...@@ -41,7 +41,7 @@ typedef enum OPTION_choice { ...@@ -41,7 +41,7 @@ typedef enum OPTION_choice {
OPT_UPPER_S, OPT_IV, OPT_MD, OPT_CIPHER OPT_UPPER_S, OPT_IV, OPT_MD, OPT_CIPHER
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS enc_options[] = { const OPTIONS enc_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"ciphers", OPT_LIST, '-', "List ciphers"}, {"ciphers", OPT_LIST, '-', "List ciphers"},
{"in", OPT_IN, '<', "Input file"}, {"in", OPT_IN, '<', "Input file"},
......
...@@ -26,7 +26,7 @@ typedef enum OPTION_choice { ...@@ -26,7 +26,7 @@ typedef enum OPTION_choice {
OPT_V = 100, OPT_VV, OPT_VVV, OPT_VVVV OPT_V = 100, OPT_VV, OPT_VVV, OPT_VVVV
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS engine_options[] = { const OPTIONS engine_options[] = {
{OPT_HELP_STR, 1, '-', "Usage: %s [options] engine...\n"}, {OPT_HELP_STR, 1, '-', "Usage: %s [options] engine...\n"},
{OPT_HELP_STR, 1, '-', {OPT_HELP_STR, 1, '-',
" engine... Engines to load\n"}, " engine... Engines to load\n"},
......
...@@ -20,7 +20,7 @@ typedef enum OPTION_choice { ...@@ -20,7 +20,7 @@ typedef enum OPTION_choice {
OPT_ERR = -1, OPT_EOF = 0, OPT_HELP OPT_ERR = -1, OPT_EOF = 0, OPT_HELP
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS errstr_options[] = { const OPTIONS errstr_options[] = {
{OPT_HELP_STR, 1, '-', "Usage: %s [options] errnum...\n"}, {OPT_HELP_STR, 1, '-', "Usage: %s [options] errnum...\n"},
{OPT_HELP_STR, 1, '-', " errnum Error number\n"}, {OPT_HELP_STR, 1, '-', " errnum Error number\n"},
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
......
...@@ -29,7 +29,7 @@ typedef enum OPTION_choice { ...@@ -29,7 +29,7 @@ typedef enum OPTION_choice {
OPT_OUT, OPT_PASSOUT, OPT_ENGINE, OPT_RAND, OPT_CIPHER OPT_OUT, OPT_PASSOUT, OPT_ENGINE, OPT_RAND, OPT_CIPHER
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS gendsa_options[] = { const OPTIONS gendsa_options[] = {
{OPT_HELP_STR, 1, '-', "Usage: %s [args] dsaparam-file\n"}, {OPT_HELP_STR, 1, '-', "Usage: %s [args] dsaparam-file\n"},
{OPT_HELP_STR, 1, '-', "Valid options are:\n"}, {OPT_HELP_STR, 1, '-', "Valid options are:\n"},
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
......
...@@ -26,7 +26,7 @@ typedef enum OPTION_choice { ...@@ -26,7 +26,7 @@ typedef enum OPTION_choice {
OPT_ALGORITHM, OPT_PKEYOPT, OPT_GENPARAM, OPT_TEXT, OPT_CIPHER OPT_ALGORITHM, OPT_PKEYOPT, OPT_GENPARAM, OPT_TEXT, OPT_CIPHER
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS genpkey_options[] = { const OPTIONS genpkey_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"out", OPT_OUT, '>', "Output file"}, {"out", OPT_OUT, '>', "Output file"},
{"outform", OPT_OUTFORM, 'F', "output format (DER or PEM)"}, {"outform", OPT_OUTFORM, 'F', "output format (DER or PEM)"},
......
...@@ -36,7 +36,7 @@ typedef enum OPTION_choice { ...@@ -36,7 +36,7 @@ typedef enum OPTION_choice {
OPT_OUT, OPT_RAND, OPT_PASSOUT, OPT_CIPHER OPT_OUT, OPT_RAND, OPT_PASSOUT, OPT_CIPHER
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS genrsa_options[] = { const OPTIONS genrsa_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"3", OPT_3, '-', "Use 3 for the E value"}, {"3", OPT_3, '-', "Use 3 for the E value"},
{"F4", OPT_F4, '-', "Use F4 (0x10001) for the E value"}, {"F4", OPT_F4, '-', "Use F4 (0x10001) for the E value"},
......
...@@ -18,7 +18,7 @@ typedef enum OPTION_choice { ...@@ -18,7 +18,7 @@ typedef enum OPTION_choice {
OPT_TOSEQ, OPT_IN, OPT_OUT OPT_TOSEQ, OPT_IN, OPT_OUT
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS nseq_options[] = { const OPTIONS nseq_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"toseq", OPT_TOSEQ, '-', "Output NS Sequence file"}, {"toseq", OPT_TOSEQ, '-', "Output NS Sequence file"},
{"in", OPT_IN, '<', "Input file"}, {"in", OPT_IN, '<', "Input file"},
......
...@@ -99,7 +99,7 @@ typedef enum OPTION_choice { ...@@ -99,7 +99,7 @@ typedef enum OPTION_choice {
OPT_MD OPT_MD
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS ocsp_options[] = { const OPTIONS ocsp_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"out", OPT_OUTFILE, '>', "Output filename"}, {"out", OPT_OUTFILE, '>', "Output filename"},
{"timeout", OPT_TIMEOUT, 'p', {"timeout", OPT_TIMEOUT, 'p',
......
...@@ -264,7 +264,7 @@ int main(int argc, char *argv[]) ...@@ -264,7 +264,7 @@ int main(int argc, char *argv[])
EXIT(ret); EXIT(ret);
} }
OPTIONS exit_options[] = { const OPTIONS exit_options[] = {
{NULL} {NULL}
}; };
...@@ -322,7 +322,7 @@ typedef enum HELPLIST_CHOICE { ...@@ -322,7 +322,7 @@ typedef enum HELPLIST_CHOICE {
OPT_PK_ALGORITHMS, OPT_DISABLED, OPT_MISSING_HELP OPT_PK_ALGORITHMS, OPT_DISABLED, OPT_MISSING_HELP
} HELPLIST_CHOICE; } HELPLIST_CHOICE;
OPTIONS list_options[] = { const OPTIONS list_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"commands", OPT_COMMANDS, '-', "List of standard commands"}, {"commands", OPT_COMMANDS, '-', "List of standard commands"},
{"digest-commands", OPT_DIGEST_COMMANDS, '-', {"digest-commands", OPT_DIGEST_COMMANDS, '-',
...@@ -397,7 +397,7 @@ typedef enum HELP_CHOICE { ...@@ -397,7 +397,7 @@ typedef enum HELP_CHOICE {
OPT_hERR = -1, OPT_hEOF = 0, OPT_hHELP OPT_hERR = -1, OPT_hEOF = 0, OPT_hHELP
} HELP_CHOICE; } HELP_CHOICE;
OPTIONS help_options[] = { const OPTIONS help_options[] = {
{"help", OPT_hHELP, '-', "Display this summary"}, {"help", OPT_hHELP, '-', "Display this summary"},
{NULL} {NULL}
}; };
......
...@@ -67,7 +67,7 @@ typedef enum OPTION_choice { ...@@ -67,7 +67,7 @@ typedef enum OPTION_choice {
OPT_1, OPT_5, OPT_6, OPT_CRYPT, OPT_SALT, OPT_STDIN OPT_1, OPT_5, OPT_6, OPT_CRYPT, OPT_SALT, OPT_STDIN
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS passwd_options[] = { const OPTIONS passwd_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"in", OPT_IN, '<', "Pead passwords from file"}, {"in", OPT_IN, '<', "Pead passwords from file"},
{"noverify", OPT_NOVERIFY, '-', {"noverify", OPT_NOVERIFY, '-',
......
...@@ -56,7 +56,7 @@ typedef enum OPTION_choice { ...@@ -56,7 +56,7 @@ typedef enum OPTION_choice {
OPT_CAFILE, OPT_NOCAPATH, OPT_NOCAFILE, OPT_ENGINE OPT_CAFILE, OPT_NOCAPATH, OPT_NOCAFILE, OPT_ENGINE
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS pkcs12_options[] = { const OPTIONS pkcs12_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"nokeys", OPT_NOKEYS, '-', "Don't output private keys"}, {"nokeys", OPT_NOKEYS, '-', "Don't output private keys"},
{"keyex", OPT_KEYEX, '-', "Set MS key exchange type"}, {"keyex", OPT_KEYEX, '-', "Set MS key exchange type"},
......
...@@ -25,7 +25,7 @@ typedef enum OPTION_choice { ...@@ -25,7 +25,7 @@ typedef enum OPTION_choice {
OPT_TEXT, OPT_PRINT, OPT_PRINT_CERTS, OPT_ENGINE OPT_TEXT, OPT_PRINT, OPT_PRINT_CERTS, OPT_ENGINE
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS pkcs7_options[] = { const OPTIONS pkcs7_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"inform", OPT_INFORM, 'F', "Input format - DER or PEM"}, {"inform", OPT_INFORM, 'F', "Input format - DER or PEM"},
{"in", OPT_IN, '<', "Input file"}, {"in", OPT_IN, '<', "Input file"},
......
...@@ -27,7 +27,7 @@ typedef enum OPTION_choice { ...@@ -27,7 +27,7 @@ typedef enum OPTION_choice {
OPT_TRADITIONAL OPT_TRADITIONAL
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS pkcs8_options[] = { const OPTIONS pkcs8_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"inform", OPT_INFORM, 'F', "Input format (DER or PEM)"}, {"inform", OPT_INFORM, 'F', "Input format (DER or PEM)"},
{"outform", OPT_OUTFORM, 'F', "Output format (DER or PEM)"}, {"outform", OPT_OUTFORM, 'F', "Output format (DER or PEM)"},
......
...@@ -21,7 +21,7 @@ typedef enum OPTION_choice { ...@@ -21,7 +21,7 @@ typedef enum OPTION_choice {
OPT_TEXT, OPT_NOOUT, OPT_MD, OPT_TRADITIONAL OPT_TEXT, OPT_NOOUT, OPT_MD, OPT_TRADITIONAL
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS pkey_options[] = { const OPTIONS pkey_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"inform", OPT_INFORM, 'f', "Input format (DER or PEM)"}, {"inform", OPT_INFORM, 'f', "Input format (DER or PEM)"},
{"outform", OPT_OUTFORM, 'F', "Output format (DER or PEM)"}, {"outform", OPT_OUTFORM, 'F', "Output format (DER or PEM)"},
......
...@@ -19,7 +19,7 @@ typedef enum OPTION_choice { ...@@ -19,7 +19,7 @@ typedef enum OPTION_choice {
OPT_IN, OPT_OUT, OPT_TEXT, OPT_NOOUT, OPT_ENGINE OPT_IN, OPT_OUT, OPT_TEXT, OPT_NOOUT, OPT_ENGINE
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS pkeyparam_options[] = { const OPTIONS pkeyparam_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"in", OPT_IN, '<', "Input file"}, {"in", OPT_IN, '<', "Input file"},
{"out", OPT_OUT, '>', "Output file"}, {"out", OPT_OUT, '>', "Output file"},
......
...@@ -39,7 +39,7 @@ typedef enum OPTION_choice { ...@@ -39,7 +39,7 @@ typedef enum OPTION_choice {
OPT_PEERFORM, OPT_KEYFORM, OPT_PKEYOPT, OPT_KDF, OPT_KDFLEN OPT_PEERFORM, OPT_KEYFORM, OPT_PKEYOPT, OPT_KDF, OPT_KDFLEN
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS pkeyutl_options[] = { const OPTIONS pkeyutl_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"in", OPT_IN, '<', "Input file - default stdin"}, {"in", OPT_IN, '<', "Input file - default stdin"},
{"out", OPT_OUT, '>', "Output file - default stdout"}, {"out", OPT_OUT, '>', "Output file - default stdout"},
......
...@@ -17,7 +17,7 @@ typedef enum OPTION_choice { ...@@ -17,7 +17,7 @@ typedef enum OPTION_choice {
OPT_HEX, OPT_GENERATE, OPT_BITS, OPT_SAFE, OPT_CHECKS OPT_HEX, OPT_GENERATE, OPT_BITS, OPT_SAFE, OPT_CHECKS
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS prime_options[] = { const OPTIONS prime_options[] = {
{OPT_HELP_STR, 1, '-', "Usage: %s [options] [number...]\n"}, {OPT_HELP_STR, 1, '-', "Usage: %s [options] [number...]\n"},
{OPT_HELP_STR, 1, '-', {OPT_HELP_STR, 1, '-',
" number Number to check for primality\n"}, " number Number to check for primality\n"},
......
...@@ -73,54 +73,54 @@ extern int verify_main(int argc, char *argv[]); ...@@ -73,54 +73,54 @@ extern int verify_main(int argc, char *argv[]);
extern int version_main(int argc, char *argv[]); extern int version_main(int argc, char *argv[]);
extern int x509_main(int argc, char *argv[]); extern int x509_main(int argc, char *argv[]);
extern OPTIONS asn1parse_options[]; extern const OPTIONS asn1parse_options[];
extern OPTIONS ca_options[]; extern const OPTIONS ca_options[];
extern OPTIONS ciphers_options[]; extern const OPTIONS ciphers_options[];
extern OPTIONS cms_options[]; extern const OPTIONS cms_options[];
extern OPTIONS crl_options[]; extern const OPTIONS crl_options[];
extern OPTIONS crl2pkcs7_options[]; extern const OPTIONS crl2pkcs7_options[];
extern OPTIONS dgst_options[]; extern const OPTIONS dgst_options[];
extern OPTIONS dhparam_options[]; extern const OPTIONS dhparam_options[];
extern OPTIONS dsa_options[]; extern const OPTIONS dsa_options[];
extern OPTIONS dsaparam_options[]; extern const OPTIONS dsaparam_options[];
extern OPTIONS ec_options[]; extern const OPTIONS ec_options[];
extern OPTIONS ecparam_options[]; extern const OPTIONS ecparam_options[];
extern OPTIONS enc_options[]; extern const OPTIONS enc_options[];
extern OPTIONS engine_options[]; extern const OPTIONS engine_options[];
extern OPTIONS errstr_options[]; extern const OPTIONS errstr_options[];
extern OPTIONS exit_options[]; extern const OPTIONS exit_options[];
extern OPTIONS gendsa_options[]; extern const OPTIONS gendsa_options[];
extern OPTIONS genpkey_options[]; extern const OPTIONS genpkey_options[];
extern OPTIONS genrsa_options[]; extern const OPTIONS genrsa_options[];
extern OPTIONS help_options[]; extern const OPTIONS help_options[];
extern OPTIONS list_options[]; extern const OPTIONS list_options[];
extern OPTIONS nseq_options[]; extern const OPTIONS nseq_options[];
extern OPTIONS ocsp_options[]; extern const OPTIONS ocsp_options[];
extern OPTIONS passwd_options[]; extern const OPTIONS passwd_options[];
extern OPTIONS pkcs12_options[]; extern const OPTIONS pkcs12_options[];
extern OPTIONS pkcs7_options[]; extern const OPTIONS pkcs7_options[];
extern OPTIONS pkcs8_options[]; extern const OPTIONS pkcs8_options[];
extern OPTIONS pkey_options[]; extern const OPTIONS pkey_options[];
extern OPTIONS pkeyparam_options[]; extern const OPTIONS pkeyparam_options[];
extern OPTIONS pkeyutl_options[]; extern const OPTIONS pkeyutl_options[];
extern OPTIONS prime_options[]; extern const OPTIONS prime_options[];
extern OPTIONS rand_options[]; extern const OPTIONS rand_options[];
extern OPTIONS rehash_options[]; extern const OPTIONS rehash_options[];
extern OPTIONS req_options[]; extern const OPTIONS req_options[];
extern OPTIONS rsa_options[]; extern const OPTIONS rsa_options[];
extern OPTIONS rsautl_options[]; extern const OPTIONS rsautl_options[];
extern OPTIONS s_client_options[]; extern const OPTIONS s_client_options[];
extern OPTIONS s_server_options[]; extern const OPTIONS s_server_options[];
extern OPTIONS s_time_options[]; extern const OPTIONS s_time_options[];
extern OPTIONS sess_id_options[]; extern const OPTIONS sess_id_options[];
extern OPTIONS smime_options[]; extern const OPTIONS smime_options[];
extern OPTIONS speed_options[]; extern const OPTIONS speed_options[];
extern OPTIONS spkac_options[]; extern const OPTIONS spkac_options[];
extern OPTIONS srp_options[]; extern const OPTIONS srp_options[];
extern OPTIONS ts_options[]; extern const OPTIONS ts_options[];
extern OPTIONS verify_options[]; extern const OPTIONS verify_options[];
extern OPTIONS version_options[]; extern const OPTIONS version_options[];
extern OPTIONS x509_options[]; extern const OPTIONS x509_options[];
#ifdef INCLUDE_FUNCTION_TABLE #ifdef INCLUDE_FUNCTION_TABLE
static FUNCTION functions[] = { static FUNCTION functions[] = {
...@@ -209,31 +209,31 @@ static FUNCTION functions[] = { ...@@ -209,31 +209,31 @@ static FUNCTION functions[] = {
{ FT_general, "version", version_main, version_options }, { FT_general, "version", version_main, version_options },
{ FT_general, "x509", x509_main, x509_options }, { FT_general, "x509", x509_main, x509_options },
#ifndef OPENSSL_NO_MD2 #ifndef OPENSSL_NO_MD2
{ FT_md, "md2", dgst_main}, { FT_md, "md2", dgst_main },
#endif #endif
#ifndef OPENSSL_NO_MD4 #ifndef OPENSSL_NO_MD4
{ FT_md, "md4", dgst_main}, { FT_md, "md4", dgst_main },
#endif #endif
{ FT_md, "md5", dgst_main}, { FT_md, "md5", dgst_main },
#ifndef OPENSSL_NO_GOST #ifndef OPENSSL_NO_GOST
{ FT_md, "gost", dgst_main}, { FT_md, "gost", dgst_main },
#endif #endif
{ FT_md, "sha1", dgst_main}, { FT_md, "sha1", dgst_main },
{ FT_md, "sha224", dgst_main}, { FT_md, "sha224", dgst_main },
{ FT_md, "sha256", dgst_main}, { FT_md, "sha256", dgst_main },
{ FT_md, "sha384", dgst_main}, { FT_md, "sha384", dgst_main },
{ FT_md, "sha512", dgst_main}, { FT_md, "sha512", dgst_main },
#ifndef OPENSSL_NO_MDC2 #ifndef OPENSSL_NO_MDC2
{ FT_md, "mdc2", dgst_main}, { FT_md, "mdc2", dgst_main },
#endif #endif
#ifndef OPENSSL_NO_RMD160 #ifndef OPENSSL_NO_RMD160
{ FT_md, "rmd160", dgst_main}, { FT_md, "rmd160", dgst_main },
#endif #endif
#ifndef OPENSSL_NO_BLAKE2 #ifndef OPENSSL_NO_BLAKE2
{ FT_md, "blake2b512", dgst_main}, { FT_md, "blake2b512", dgst_main },
#endif #endif
#ifndef OPENSSL_NO_BLAKE2 #ifndef OPENSSL_NO_BLAKE2
{ FT_md, "blake2s256", dgst_main}, { FT_md, "blake2s256", dgst_main },
#endif #endif
{ FT_cipher, "aes-128-cbc", enc_main, enc_options }, { FT_cipher, "aes-128-cbc", enc_main, enc_options },
{ FT_cipher, "aes-128-ecb", enc_main, enc_options }, { FT_cipher, "aes-128-ecb", enc_main, enc_options },
......
...@@ -63,7 +63,7 @@ foreach (@ARGV) { ...@@ -63,7 +63,7 @@ foreach (@ARGV) {
print "\n"; print "\n";
foreach (@ARGV) { foreach (@ARGV) {
printf "extern OPTIONS %s_options[];\n", $_; printf "extern const OPTIONS %s_options[];\n", $_;
} }
print "\n#ifdef INCLUDE_FUNCTION_TABLE\n"; print "\n#ifdef INCLUDE_FUNCTION_TABLE\n";
...@@ -102,7 +102,7 @@ foreach my $cmd ( ...@@ -102,7 +102,7 @@ foreach my $cmd (
"sha1", "sha224", "sha256", "sha384", "sha512", "sha1", "sha224", "sha256", "sha384", "sha512",
"mdc2", "rmd160", "blake2b512", "blake2s256" "mdc2", "rmd160", "blake2b512", "blake2s256"
) { ) {
my $str = " { FT_md, \"".$cmd."\", dgst_main},\n"; my $str = " { FT_md, \"".$cmd."\", dgst_main },\n";
if (grep { $cmd eq $_ } @disablables) { if (grep { $cmd eq $_ } @disablables) {
print "#ifndef OPENSSL_NO_".uc($cmd)."\n${str}#endif\n"; print "#ifndef OPENSSL_NO_".uc($cmd)."\n${str}#endif\n";
} elsif (my $disabler = $md_disabler{$cmd}) { } elsif (my $disabler = $md_disabler{$cmd}) {
......
...@@ -22,7 +22,7 @@ typedef enum OPTION_choice { ...@@ -22,7 +22,7 @@ typedef enum OPTION_choice {
OPT_OUT, OPT_ENGINE, OPT_RAND, OPT_BASE64, OPT_HEX OPT_OUT, OPT_ENGINE, OPT_RAND, OPT_BASE64, OPT_HEX
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS rand_options[] = { const OPTIONS rand_options[] = {
{OPT_HELP_STR, 1, '-', "Usage: %s [flags] num\n"}, {OPT_HELP_STR, 1, '-', "Usage: %s [flags] num\n"},
{OPT_HELP_STR, 1, '-', "Valid options are:\n"}, {OPT_HELP_STR, 1, '-', "Valid options are:\n"},
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
......
...@@ -399,7 +399,7 @@ typedef enum OPTION_choice { ...@@ -399,7 +399,7 @@ typedef enum OPTION_choice {
OPT_COMPAT, OPT_OLD, OPT_N, OPT_VERBOSE OPT_COMPAT, OPT_OLD, OPT_N, OPT_VERBOSE
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS rehash_options[] = { const OPTIONS rehash_options[] = {
{OPT_HELP_STR, 1, '-', "Usage: %s [options] [cert-directory...]\n"}, {OPT_HELP_STR, 1, '-', "Usage: %s [options] [cert-directory...]\n"},
{OPT_HELP_STR, 1, '-', "Valid options are:\n"}, {OPT_HELP_STR, 1, '-', "Valid options are:\n"},
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
...@@ -467,7 +467,7 @@ int rehash_main(int argc, char **argv) ...@@ -467,7 +467,7 @@ int rehash_main(int argc, char **argv)
} }
#else #else
OPTIONS rehash_options[] = { const OPTIONS rehash_options[] = {
{NULL} {NULL}
}; };
......
...@@ -82,7 +82,7 @@ typedef enum OPTION_choice { ...@@ -82,7 +82,7 @@ typedef enum OPTION_choice {
OPT_REQEXTS, OPT_MD OPT_REQEXTS, OPT_MD
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS req_options[] = { const OPTIONS req_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"inform", OPT_INFORM, 'F', "Input format - DER or PEM"}, {"inform", OPT_INFORM, 'F', "Input format - DER or PEM"},
{"outform", OPT_OUTFORM, 'F', "Output format - DER or PEM"}, {"outform", OPT_OUTFORM, 'F', "Output format - DER or PEM"},
......
...@@ -35,7 +35,7 @@ typedef enum OPTION_choice { ...@@ -35,7 +35,7 @@ typedef enum OPTION_choice {
OPT_NOOUT, OPT_TEXT, OPT_MODULUS, OPT_CHECK, OPT_CIPHER OPT_NOOUT, OPT_TEXT, OPT_MODULUS, OPT_CHECK, OPT_CIPHER
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS rsa_options[] = { const OPTIONS rsa_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"inform", OPT_INFORM, 'f', "Input format, one of DER NET PEM"}, {"inform", OPT_INFORM, 'f', "Input format, one of DER NET PEM"},
{"outform", OPT_OUTFORM, 'f', "Output format, one of DER NET PEM PVK"}, {"outform", OPT_OUTFORM, 'f', "Output format, one of DER NET PEM PVK"},
......
...@@ -35,7 +35,7 @@ typedef enum OPTION_choice { ...@@ -35,7 +35,7 @@ typedef enum OPTION_choice {
OPT_PUBIN, OPT_CERTIN, OPT_INKEY, OPT_PASSIN, OPT_KEYFORM OPT_PUBIN, OPT_CERTIN, OPT_INKEY, OPT_PASSIN, OPT_KEYFORM
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS rsautl_options[] = { const OPTIONS rsautl_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"in", OPT_IN, '<', "Input file"}, {"in", OPT_IN, '<', "Input file"},
{"out", OPT_OUT, '>', "Output file"}, {"out", OPT_OUT, '>', "Output file"},
......
...@@ -558,7 +558,7 @@ typedef enum OPTION_choice { ...@@ -558,7 +558,7 @@ typedef enum OPTION_choice {
OPT_DANE_TLSA_RRDATA, OPT_DANE_EE_NO_NAME OPT_DANE_TLSA_RRDATA, OPT_DANE_EE_NO_NAME
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS s_client_options[] = { const OPTIONS s_client_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"host", OPT_HOST, 's', "Use -connect instead"}, {"host", OPT_HOST, 's', "Use -connect instead"},
{"port", OPT_PORT, 'p', "Use -connect instead"}, {"port", OPT_PORT, 'p', "Use -connect instead"},
......
...@@ -679,7 +679,7 @@ typedef enum OPTION_choice { ...@@ -679,7 +679,7 @@ typedef enum OPTION_choice {
OPT_X_ENUM OPT_X_ENUM
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS s_server_options[] = { const OPTIONS s_server_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"port", OPT_PORT, 'p', {"port", OPT_PORT, 'p',
"TCP/IP port to listen on for connections (default is " PORT ")"}, "TCP/IP port to listen on for connections (default is " PORT ")"},
......
...@@ -59,7 +59,7 @@ typedef enum OPTION_choice { ...@@ -59,7 +59,7 @@ typedef enum OPTION_choice {
OPT_WWW OPT_WWW
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS s_time_options[] = { const OPTIONS s_time_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"connect", OPT_CONNECT, 's', {"connect", OPT_CONNECT, 's',
"Where to connect as post:port (default is " SSL_CONNECT_NAME ")"}, "Where to connect as post:port (default is " SSL_CONNECT_NAME ")"},
......
...@@ -23,7 +23,7 @@ typedef enum OPTION_choice { ...@@ -23,7 +23,7 @@ typedef enum OPTION_choice {
OPT_TEXT, OPT_CERT, OPT_NOOUT, OPT_CONTEXT OPT_TEXT, OPT_CERT, OPT_NOOUT, OPT_CONTEXT
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS sess_id_options[] = { const OPTIONS sess_id_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"inform", OPT_INFORM, 'F', "Input format - default PEM (DER or PEM)"}, {"inform", OPT_INFORM, 'F', "Input format - default PEM (DER or PEM)"},
{"outform", OPT_OUTFORM, 'f', {"outform", OPT_OUTFORM, 'f',
......
...@@ -45,7 +45,7 @@ typedef enum OPTION_choice { ...@@ -45,7 +45,7 @@ typedef enum OPTION_choice {
OPT_OUTFORM, OPT_CONTENT OPT_OUTFORM, OPT_CONTENT
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS smime_options[] = { const OPTIONS smime_options[] = {
{OPT_HELP_STR, 1, '-', "Usage: %s [options] cert.pem...\n"}, {OPT_HELP_STR, 1, '-', "Usage: %s [options] cert.pem...\n"},
{OPT_HELP_STR, 1, '-', {OPT_HELP_STR, 1, '-',
" cert.pem... recipient certs for encryption\n"}, " cert.pem... recipient certs for encryption\n"},
......
...@@ -363,7 +363,7 @@ typedef enum OPTION_choice { ...@@ -363,7 +363,7 @@ typedef enum OPTION_choice {
OPT_MR, OPT_MB, OPT_MISALIGN, OPT_ASYNCJOBS OPT_MR, OPT_MB, OPT_MISALIGN, OPT_ASYNCJOBS
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS speed_options[] = { const OPTIONS speed_options[] = {
{OPT_HELP_STR, 1, '-', "Usage: %s [options] ciphers...\n"}, {OPT_HELP_STR, 1, '-', "Usage: %s [options] ciphers...\n"},
{OPT_HELP_STR, 1, '-', "Valid options are:\n"}, {OPT_HELP_STR, 1, '-', "Valid options are:\n"},
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
......
...@@ -27,7 +27,7 @@ typedef enum OPTION_choice { ...@@ -27,7 +27,7 @@ typedef enum OPTION_choice {
OPT_SPKSECT OPT_SPKSECT
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS spkac_options[] = { const OPTIONS spkac_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"in", OPT_IN, '<', "Input file"}, {"in", OPT_IN, '<', "Input file"},
{"out", OPT_OUT, '>', "Output file"}, {"out", OPT_OUT, '>', "Output file"},
......
...@@ -186,7 +186,7 @@ typedef enum OPTION_choice { ...@@ -186,7 +186,7 @@ typedef enum OPTION_choice {
OPT_PASSIN, OPT_PASSOUT, OPT_ENGINE OPT_PASSIN, OPT_PASSOUT, OPT_ENGINE
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS srp_options[] = { const OPTIONS srp_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"verbose", OPT_VERBOSE, '-', "Talk a lot while doing things"}, {"verbose", OPT_VERBOSE, '-', "Talk a lot while doing things"},
{"config", OPT_CONFIG, '<', "A config file"}, {"config", OPT_CONFIG, '<', "A config file"},
......
...@@ -86,7 +86,7 @@ typedef enum OPTION_choice { ...@@ -86,7 +86,7 @@ typedef enum OPTION_choice {
OPT_MD, OPT_V_ENUM OPT_MD, OPT_V_ENUM
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS ts_options[] = { const OPTIONS ts_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"config", OPT_CONFIG, '<', "Configuration file"}, {"config", OPT_CONFIG, '<', "Configuration file"},
{"section", OPT_SECTION, 's', "Section to use within config file"}, {"section", OPT_SECTION, 's', "Section to use within config file"},
......
...@@ -31,7 +31,7 @@ typedef enum OPTION_choice { ...@@ -31,7 +31,7 @@ typedef enum OPTION_choice {
OPT_VERBOSE OPT_VERBOSE
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS verify_options[] = { const OPTIONS verify_options[] = {
{OPT_HELP_STR, 1, '-', "Usage: %s [options] cert.pem...\n"}, {OPT_HELP_STR, 1, '-', "Usage: %s [options] cert.pem...\n"},
{OPT_HELP_STR, 1, '-', "Valid options are:\n"}, {OPT_HELP_STR, 1, '-', "Valid options are:\n"},
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
......
...@@ -35,7 +35,7 @@ typedef enum OPTION_choice { ...@@ -35,7 +35,7 @@ typedef enum OPTION_choice {
OPT_B, OPT_D, OPT_E, OPT_F, OPT_O, OPT_P, OPT_V, OPT_A OPT_B, OPT_D, OPT_E, OPT_F, OPT_O, OPT_P, OPT_V, OPT_A
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS version_options[] = { const OPTIONS version_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"a", OPT_A, '-', "Show all data"}, {"a", OPT_A, '-', "Show all data"},
{"b", OPT_B, '-', "Show build date"}, {"b", OPT_B, '-', "Show build date"},
......
...@@ -59,7 +59,7 @@ typedef enum OPTION_choice { ...@@ -59,7 +59,7 @@ typedef enum OPTION_choice {
OPT_BADSIG, OPT_MD, OPT_ENGINE, OPT_NOCERT OPT_BADSIG, OPT_MD, OPT_ENGINE, OPT_NOCERT
} OPTION_CHOICE; } OPTION_CHOICE;
OPTIONS x509_options[] = { const OPTIONS x509_options[] = {
{"help", OPT_HELP, '-', "Display this summary"}, {"help", OPT_HELP, '-', "Display this summary"},
{"inform", OPT_INFORM, 'f', {"inform", OPT_INFORM, 'f',
"Input format - default PEM (one of DER, NET or PEM)"}, "Input format - default PEM (one of DER, NET or PEM)"},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册