diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-12-02 09:22:38 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2016-12-08 17:13:56 +0100 |
commit | d403a41f8e0d6c67a746bd6a1e42fb14de17d352 (patch) | |
tree | 79c878e4395ff303785609e9a6e4aa02035827e9 | |
parent | 1a6c720d44cc97a6c6920df073f1110b993c8461 (diff) | |
download | gnutls-d403a41f8e0d6c67a746bd6a1e42fb14de17d352.tar.gz |
Added autogen pre-generated files into repository
This allows building gnutls from git in systems without using
autogen.
-rw-r--r-- | src/certtool-args.c.bak | 3433 | ||||
-rw-r--r-- | src/certtool-args.h.bak | 379 | ||||
-rw-r--r-- | src/cli-args.c.bak | 2737 | ||||
-rw-r--r-- | src/cli-args.h.bak | 327 | ||||
-rw-r--r-- | src/cli-debug-args.c.bak | 1023 | ||||
-rw-r--r-- | src/cli-debug-args.h.bak | 223 | ||||
-rw-r--r-- | src/danetool-args.c.bak | 1723 | ||||
-rw-r--r-- | src/danetool-args.h.bak | 265 | ||||
-rw-r--r-- | src/ocsptool-args.c.bak | 1553 | ||||
-rw-r--r-- | src/ocsptool-args.h.bak | 247 | ||||
-rw-r--r-- | src/p11tool-args.c.bak | 3160 | ||||
-rw-r--r-- | src/p11tool-args.h.bak | 341 | ||||
-rw-r--r-- | src/psktool-args.c.bak | 969 | ||||
-rw-r--r-- | src/psktool-args.h.bak | 221 | ||||
-rw-r--r-- | src/serv-args.c.bak | 2280 | ||||
-rw-r--r-- | src/serv-args.h.bak | 293 | ||||
-rw-r--r-- | src/srptool-args.c.bak | 1067 | ||||
-rw-r--r-- | src/srptool-args.h.bak | 231 | ||||
-rw-r--r-- | src/systemkey-args.c.bak | 1058 | ||||
-rw-r--r-- | src/systemkey-args.h.bak | 225 | ||||
-rw-r--r-- | src/tpmtool-args.c.bak | 1392 | ||||
-rw-r--r-- | src/tpmtool-args.h.bak | 247 |
22 files changed, 23394 insertions, 0 deletions
diff --git a/src/certtool-args.c.bak b/src/certtool-args.c.bak new file mode 100644 index 0000000000..c92cd375b4 --- /dev/null +++ b/src/certtool-args.c.bak @@ -0,0 +1,3433 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (certtool-args.c) + * + * It has been AutoGen-ed + * From the definitions certtool-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the certtool author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The certtool program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * certtool is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * certtool is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "certtool-args.h" +#include <sys/types.h> + +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> + +#ifdef __cplusplus +extern "C" { +#endif +extern FILE * option_usage_fp; +#define zCopyright (certtool_opt_strs+0) +#define zLicenseDescrip (certtool_opt_strs+289) + + +#ifndef NULL +# define NULL 0 +#endif + +/** + * static const strings for certtool options + */ +static char const certtool_opt_strs[6849] = +/* 0 */ "certtool @VERSION@\n" + "Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n" + "This is free software. It is licensed for use, modification and\n" + "redistribution under the terms of the GNU General Public License,\n" + "version 3 or later <http://gnu.org/licenses/gpl.html>\n\0" +/* 289 */ "certtool is free software: you can redistribute it and/or modify it under\n" + "the terms of the GNU General Public License as published by the Free\n" + "Software Foundation, either version 3 of the License, or (at your option)\n" + "any later version.\n\n" + "certtool is distributed in the hope that it will be useful, but WITHOUT ANY\n" + "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n" + "FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n" + "details.\n\n" + "You should have received a copy of the GNU General Public License along\n" + "with this program. If not, see <http://www.gnu.org/licenses/>.\n\0" +/* 894 */ "Enable debugging\0" +/* 911 */ "DEBUG\0" +/* 917 */ "debug\0" +/* 923 */ "More verbose output\0" +/* 943 */ "VERBOSE\0" +/* 951 */ "verbose\0" +/* 959 */ "Input file\0" +/* 970 */ "INFILE\0" +/* 977 */ "infile\0" +/* 984 */ "Output file\0" +/* 996 */ "OUTFILE\0" +/* 1004 */ "outfile\0" +/* 1012 */ "Generate a self-signed certificate\0" +/* 1047 */ "GENERATE_SELF_SIGNED\0" +/* 1068 */ "generate-self-signed\0" +/* 1089 */ "Generate a signed certificate\0" +/* 1119 */ "GENERATE_CERTIFICATE\0" +/* 1140 */ "generate-certificate\0" +/* 1161 */ "Generates a proxy certificate\0" +/* 1191 */ "GENERATE_PROXY\0" +/* 1206 */ "generate-proxy\0" +/* 1221 */ "Generate a CRL\0" +/* 1236 */ "GENERATE_CRL\0" +/* 1249 */ "generate-crl\0" +/* 1262 */ "Update a signed certificate\0" +/* 1290 */ "UPDATE_CERTIFICATE\0" +/* 1309 */ "update-certificate\0" +/* 1328 */ "Generate a private key\0" +/* 1351 */ "GENERATE_PRIVKEY\0" +/* 1368 */ "generate-privkey\0" +/* 1385 */ "Generate a private key or parameters from a seed using a provable method\0" +/* 1458 */ "PROVABLE\0" +/* 1467 */ "provable\0" +/* 1476 */ "Verify a private key generated from a seed using a provable method\0" +/* 1543 */ "VERIFY_PROVABLE_PRIVKEY\0" +/* 1567 */ "verify-provable-privkey\0" +/* 1591 */ "When generating a private key use the given hex-encoded seed\0" +/* 1652 */ "SEED\0" +/* 1657 */ "seed\0" +/* 1662 */ "Generate a PKCS #10 certificate request\0" +/* 1702 */ "GENERATE_REQUEST\0" +/* 1719 */ "generate-request\0" +/* 1736 */ "Verify a PEM encoded certificate chain\0" +/* 1775 */ "VERIFY_CHAIN\0" +/* 1788 */ "verify-chain\0" +/* 1801 */ "Verify a PEM encoded certificate chain using a trusted list\0" +/* 1861 */ "VERIFY\0" +/* 1868 */ "verify\0" +/* 1875 */ "Verify a CRL using a trusted list\0" +/* 1909 */ "VERIFY_CRL\0" +/* 1920 */ "verify-crl\0" +/* 1931 */ "Specify a hostname to be used for certificate chain verification\0" +/* 1996 */ "VERIFY_HOSTNAME\0" +/* 2012 */ "verify-hostname\0" +/* 2028 */ "Specify a email to be used for certificate chain verification\0" +/* 2090 */ "VERIFY_EMAIL\0" +/* 2103 */ "verify-email\0" +/* 2116 */ "Specify a purpose OID to be used for certificate chain verification\0" +/* 2184 */ "VERIFY_PURPOSE\0" +/* 2199 */ "verify-purpose\0" +/* 2214 */ "Allow broken algorithms, such as MD5 for verification\0" +/* 2268 */ "VERIFY_ALLOW_BROKEN\0" +/* 2288 */ "verify-allow-broken\0" +/* 2308 */ "Generate PKCS #3 encoded Diffie-Hellman parameters\0" +/* 2359 */ "GENERATE_DH_PARAMS\0" +/* 2378 */ "generate-dh-params\0" +/* 2397 */ "Get the included PKCS #3 encoded Diffie-Hellman parameters\0" +/* 2456 */ "GET_DH_PARAMS\0" +/* 2470 */ "get-dh-params\0" +/* 2484 */ "Print information PKCS #3 encoded Diffie-Hellman parameters\0" +/* 2544 */ "DH_INFO\0" +/* 2552 */ "dh-info\0" +/* 2560 */ "Loads a private key file\0" +/* 2585 */ "LOAD_PRIVKEY\0" +/* 2598 */ "load-privkey\0" +/* 2611 */ "Loads a public key file\0" +/* 2635 */ "LOAD_PUBKEY\0" +/* 2647 */ "load-pubkey\0" +/* 2659 */ "Loads a certificate request file\0" +/* 2692 */ "LOAD_REQUEST\0" +/* 2705 */ "load-request\0" +/* 2718 */ "Loads a certificate file\0" +/* 2743 */ "LOAD_CERTIFICATE\0" +/* 2760 */ "load-certificate\0" +/* 2777 */ "Loads the certificate authority's private key file\0" +/* 2828 */ "LOAD_CA_PRIVKEY\0" +/* 2844 */ "load-ca-privkey\0" +/* 2860 */ "Loads the certificate authority's certificate file\0" +/* 2911 */ "LOAD_CA_CERTIFICATE\0" +/* 2931 */ "load-ca-certificate\0" +/* 2951 */ "Loads the provided CRL\0" +/* 2974 */ "LOAD_CRL\0" +/* 2983 */ "load-crl\0" +/* 2992 */ "Loads auxiliary data\0" +/* 3013 */ "LOAD_DATA\0" +/* 3023 */ "load-data\0" +/* 3033 */ "Password to use\0" +/* 3049 */ "PASSWORD\0" +/* 3058 */ "password\0" +/* 3067 */ "Enforce a NULL password\0" +/* 3091 */ "NULL_PASSWORD\0" +/* 3105 */ "null-password\0" +/* 3119 */ "Enforce an empty password\0" +/* 3145 */ "EMPTY_PASSWORD\0" +/* 3160 */ "empty-password\0" +/* 3175 */ "Print big number in an easier format to parse\0" +/* 3221 */ "HEX_NUMBERS\0" +/* 3233 */ "hex-numbers\0" +/* 3245 */ "In certain operations it prints the information in C-friendly format\0" +/* 3314 */ "CPRINT\0" +/* 3321 */ "cprint\0" +/* 3328 */ "Print information on the given certificate\0" +/* 3371 */ "CERTIFICATE_INFO\0" +/* 3388 */ "certificate-info\0" +/* 3405 */ "Print the fingerprint of the given certificate\0" +/* 3452 */ "FINGERPRINT\0" +/* 3464 */ "fingerprint\0" +/* 3476 */ "Print the key ID of the given certificate\0" +/* 3518 */ "KEY_ID\0" +/* 3525 */ "key-id\0" +/* 3532 */ "Print certificate's public key\0" +/* 3563 */ "CERTIFICATE_PUBKEY\0" +/* 3582 */ "certificate-pubkey\0" +/* 3601 */ "Print information on the given OpenPGP certificate\0" +/* 3652 */ "PGP_CERTIFICATE_INFO\0" +/* 3673 */ "pgp-certificate-info\0" +/* 3694 */ "Print information on the given OpenPGP keyring structure\0" +/* 3751 */ "PGP_RING_INFO\0" +/* 3765 */ "pgp-ring-info\0" +/* 3779 */ "Print information on the given CRL structure\0" +/* 3824 */ "CRL_INFO\0" +/* 3833 */ "crl-info\0" +/* 3842 */ "Print information on the given certificate request\0" +/* 3893 */ "CRQ_INFO\0" +/* 3902 */ "crq-info\0" +/* 3911 */ "Do not use extensions in certificate requests\0" +/* 3957 */ "NO_CRQ_EXTENSIONS\0" +/* 3975 */ "no-crq-extensions\0" +/* 3993 */ "Print information on a PKCS #12 structure\0" +/* 4035 */ "P12_INFO\0" +/* 4044 */ "p12-info\0" +/* 4053 */ "The PKCS #12 friendly name to use\0" +/* 4087 */ "P12_NAME\0" +/* 4096 */ "p12-name\0" +/* 4105 */ "Generate a PKCS #7 structure\0" +/* 4134 */ "P7_GENERATE\0" +/* 4146 */ "p7-generate\0" +/* 4158 */ "Signs using a PKCS #7 structure\0" +/* 4190 */ "P7_SIGN\0" +/* 4198 */ "p7-sign\0" +/* 4206 */ "Signs using a detached PKCS #7 structure\0" +/* 4247 */ "P7_DETACHED_SIGN\0" +/* 4264 */ "p7-detached-sign\0" +/* 4281 */ "The signer's certificate will be included in the cert list.\0" +/* 4341 */ "P7_INCLUDE_CERT\0" +/* 4357 */ "no-p7-include-cert\0" +/* 4376 */ "no\0" +/* 4379 */ "Will include a timestamp in the PKCS #7 structure\0" +/* 4429 */ "P7_TIME\0" +/* 4437 */ "no-p7-time\0" +/* 4448 */ "Will show the embedded data in the PKCS #7 structure\0" +/* 4501 */ "P7_SHOW_DATA\0" +/* 4514 */ "no-p7-show-data\0" +/* 4530 */ "Print information on a PKCS #7 structure\0" +/* 4571 */ "P7_INFO\0" +/* 4579 */ "p7-info\0" +/* 4587 */ "Verify the provided PKCS #7 structure\0" +/* 4625 */ "P7_VERIFY\0" +/* 4635 */ "p7-verify\0" +/* 4645 */ "Print information on a PKCS #8 structure\0" +/* 4686 */ "P8_INFO\0" +/* 4694 */ "p8-info\0" +/* 4702 */ "Convert S/MIME to PKCS #7 structure\0" +/* 4738 */ "SMIME_TO_P7\0" +/* 4750 */ "smime-to-p7\0" +/* 4762 */ "Print information on a private key\0" +/* 4797 */ "KEY_INFO\0" +/* 4806 */ "key-info\0" +/* 4815 */ "Print information on an OpenPGP private key\0" +/* 4859 */ "PGP_KEY_INFO\0" +/* 4872 */ "pgp-key-info\0" +/* 4885 */ "Print information on a public key\0" +/* 4919 */ "PUBKEY_INFO\0" +/* 4931 */ "pubkey-info\0" +/* 4943 */ "Generate an X.509 version 1 certificate (with no extensions)\0" +/* 5004 */ "V1\0" +/* 5007 */ "v1\0" +/* 5010 */ "Generate a PKCS #12 structure\0" +/* 5040 */ "TO_P12\0" +/* 5047 */ "to-p12\0" +/* 5054 */ "Generate a PKCS #8 structure\0" +/* 5083 */ "TO_P8\0" +/* 5089 */ "to-p8\0" +/* 5095 */ "Use PKCS #8 format for private keys\0" +/* 5131 */ "PKCS8\0" +/* 5137 */ "pkcs8\0" +/* 5143 */ "Generate RSA key\0" +/* 5160 */ "RSA\0" +/* 5164 */ "rsa\0" +/* 5168 */ "Generate DSA key\0" +/* 5185 */ "DSA\0" +/* 5189 */ "dsa\0" +/* 5193 */ "Generate ECC (ECDSA) key\0" +/* 5218 */ "ECC\0" +/* 5222 */ "ecc\0" +/* 5226 */ "an alias for the 'ecc' option\0" +/* 5256 */ "ecdsa\0" +/* 5262 */ "Hash algorithm to use for signing\0" +/* 5296 */ "HASH\0" +/* 5301 */ "hash\0" +/* 5306 */ "Use DER format for input certificates, private keys, and DH parameters\0" +/* 5377 */ "INDER\0" +/* 5383 */ "no-inder\0" +/* 5392 */ "an alias for the 'inder' option\0" +/* 5424 */ "inraw\0" +/* 5430 */ "Use DER format for output certificates, private keys, and DH parameters\0" +/* 5502 */ "OUTDER\0" +/* 5509 */ "no-outder\0" +/* 5519 */ "an alias for the 'outder' option\0" +/* 5552 */ "outraw\0" +/* 5559 */ "Specify the number of bits for key generate\0" +/* 5603 */ "BITS\0" +/* 5608 */ "bits\0" +/* 5613 */ "Specify the curve used for EC key generation\0" +/* 5658 */ "CURVE\0" +/* 5664 */ "curve\0" +/* 5670 */ "Specify the security level [low, legacy, medium, high, ultra]\0" +/* 5732 */ "SEC_PARAM\0" +/* 5742 */ "sec-param\0" +/* 5752 */ "No effect\0" +/* 5762 */ "DISABLE_QUICK_RANDOM\0" +/* 5783 */ "disable-quick-random\0" +/* 5804 */ "Template file to use for non-interactive operation\0" +/* 5855 */ "TEMPLATE\0" +/* 5864 */ "template\0" +/* 5873 */ "Print information to stdout instead of stderr\0" +/* 5919 */ "STDOUT_INFO\0" +/* 5931 */ "stdout-info\0" +/* 5943 */ "Enable interaction for entering password when in batch mode.\0" +/* 6004 */ "ASK_PASS\0" +/* 6013 */ "ask-pass\0" +/* 6022 */ "Cipher to use for PKCS #8 and #12 operations\0" +/* 6067 */ "PKCS_CIPHER\0" +/* 6079 */ "pkcs-cipher\0" +/* 6091 */ "Specify the PKCS #11 provider library\0" +/* 6129 */ "PROVIDER\0" +/* 6138 */ "provider\0" +/* 6147 */ "display extended usage information and exit\0" +/* 6191 */ "help\0" +/* 6196 */ "extended usage information passed thru pager\0" +/* 6241 */ "more-help\0" +/* 6251 */ "output version information and exit\0" +/* 6287 */ "version\0" +/* 6295 */ "CERTTOOL\0" +/* 6304 */ "certtool - GnuTLS certificate tool\n" + "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0" +/* 6397 */ "@PACKAGE_BUGREPORT@\0" +/* 6417 */ "\n\0" +/* 6419 */ "Tool to parse and generate X.509 certificates, requests and private keys.\n" + "It can be used interactively or non interactively by specifying the\n" + "template command line option.\n\n" + "The tool accepts files or URLs supported by GnuTLS. In case PIN is\n" + "required for the URL access you can provide it using the environment\n" + "variables GNUTLS_PIN and GNUTLS_SO_PIN.\n\0" +/* 6770 */ "certtool @VERSION@\0" +/* 6789 */ "certtool [options]\n" + "certtool --help for usage instructions.\n"; + +/** + * debug option description: + */ +/** Descriptive text for the debug option */ +#define DEBUG_DESC (certtool_opt_strs+894) +/** Upper-cased name for the debug option */ +#define DEBUG_NAME (certtool_opt_strs+911) +/** Name string for the debug option */ +#define DEBUG_name (certtool_opt_strs+917) +/** Compiled in flag settings for the debug option */ +#define DEBUG_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * verbose option description: + */ +/** Descriptive text for the verbose option */ +#define VERBOSE_DESC (certtool_opt_strs+923) +/** Upper-cased name for the verbose option */ +#define VERBOSE_NAME (certtool_opt_strs+943) +/** Name string for the verbose option */ +#define VERBOSE_name (certtool_opt_strs+951) +/** Compiled in flag settings for the verbose option */ +#define VERBOSE_FLAGS (OPTST_DISABLED) + +/** + * infile option description: + */ +/** Descriptive text for the infile option */ +#define INFILE_DESC (certtool_opt_strs+959) +/** Upper-cased name for the infile option */ +#define INFILE_NAME (certtool_opt_strs+970) +/** Name string for the infile option */ +#define INFILE_name (certtool_opt_strs+977) +/** Compiled in flag settings for the infile option */ +#define INFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * outfile option description: + */ +/** Descriptive text for the outfile option */ +#define OUTFILE_DESC (certtool_opt_strs+984) +/** Upper-cased name for the outfile option */ +#define OUTFILE_NAME (certtool_opt_strs+996) +/** Name string for the outfile option */ +#define OUTFILE_name (certtool_opt_strs+1004) +/** Compiled in flag settings for the outfile option */ +#define OUTFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * generate-self-signed option description: + */ +/** Descriptive text for the generate-self-signed option */ +#define GENERATE_SELF_SIGNED_DESC (certtool_opt_strs+1012) +/** Upper-cased name for the generate-self-signed option */ +#define GENERATE_SELF_SIGNED_NAME (certtool_opt_strs+1047) +/** Name string for the generate-self-signed option */ +#define GENERATE_SELF_SIGNED_name (certtool_opt_strs+1068) +/** Compiled in flag settings for the generate-self-signed option */ +#define GENERATE_SELF_SIGNED_FLAGS (OPTST_DISABLED) + +/** + * generate-certificate option description: + */ +/** Descriptive text for the generate-certificate option */ +#define GENERATE_CERTIFICATE_DESC (certtool_opt_strs+1089) +/** Upper-cased name for the generate-certificate option */ +#define GENERATE_CERTIFICATE_NAME (certtool_opt_strs+1119) +/** Name string for the generate-certificate option */ +#define GENERATE_CERTIFICATE_name (certtool_opt_strs+1140) +/** Compiled in flag settings for the generate-certificate option */ +#define GENERATE_CERTIFICATE_FLAGS (OPTST_DISABLED) + +/** + * generate-proxy option description: + */ +/** Descriptive text for the generate-proxy option */ +#define GENERATE_PROXY_DESC (certtool_opt_strs+1161) +/** Upper-cased name for the generate-proxy option */ +#define GENERATE_PROXY_NAME (certtool_opt_strs+1191) +/** Name string for the generate-proxy option */ +#define GENERATE_PROXY_name (certtool_opt_strs+1206) +/** Compiled in flag settings for the generate-proxy option */ +#define GENERATE_PROXY_FLAGS (OPTST_DISABLED) + +/** + * generate-crl option description: + */ +/** Descriptive text for the generate-crl option */ +#define GENERATE_CRL_DESC (certtool_opt_strs+1221) +/** Upper-cased name for the generate-crl option */ +#define GENERATE_CRL_NAME (certtool_opt_strs+1236) +/** Name string for the generate-crl option */ +#define GENERATE_CRL_name (certtool_opt_strs+1249) +/** Compiled in flag settings for the generate-crl option */ +#define GENERATE_CRL_FLAGS (OPTST_DISABLED) + +/** + * update-certificate option description: + */ +/** Descriptive text for the update-certificate option */ +#define UPDATE_CERTIFICATE_DESC (certtool_opt_strs+1262) +/** Upper-cased name for the update-certificate option */ +#define UPDATE_CERTIFICATE_NAME (certtool_opt_strs+1290) +/** Name string for the update-certificate option */ +#define UPDATE_CERTIFICATE_name (certtool_opt_strs+1309) +/** Compiled in flag settings for the update-certificate option */ +#define UPDATE_CERTIFICATE_FLAGS (OPTST_DISABLED) + +/** + * generate-privkey option description: + */ +/** Descriptive text for the generate-privkey option */ +#define GENERATE_PRIVKEY_DESC (certtool_opt_strs+1328) +/** Upper-cased name for the generate-privkey option */ +#define GENERATE_PRIVKEY_NAME (certtool_opt_strs+1351) +/** Name string for the generate-privkey option */ +#define GENERATE_PRIVKEY_name (certtool_opt_strs+1368) +/** Compiled in flag settings for the generate-privkey option */ +#define GENERATE_PRIVKEY_FLAGS (OPTST_DISABLED) + +/** + * provable option description: + */ +/** Descriptive text for the provable option */ +#define PROVABLE_DESC (certtool_opt_strs+1385) +/** Upper-cased name for the provable option */ +#define PROVABLE_NAME (certtool_opt_strs+1458) +/** Name string for the provable option */ +#define PROVABLE_name (certtool_opt_strs+1467) +/** Compiled in flag settings for the provable option */ +#define PROVABLE_FLAGS (OPTST_DISABLED) + +/** + * verify-provable-privkey option description: + */ +/** Descriptive text for the verify-provable-privkey option */ +#define VERIFY_PROVABLE_PRIVKEY_DESC (certtool_opt_strs+1476) +/** Upper-cased name for the verify-provable-privkey option */ +#define VERIFY_PROVABLE_PRIVKEY_NAME (certtool_opt_strs+1543) +/** Name string for the verify-provable-privkey option */ +#define VERIFY_PROVABLE_PRIVKEY_name (certtool_opt_strs+1567) +/** Compiled in flag settings for the verify-provable-privkey option */ +#define VERIFY_PROVABLE_PRIVKEY_FLAGS (OPTST_DISABLED) + +/** + * seed option description: + */ +/** Descriptive text for the seed option */ +#define SEED_DESC (certtool_opt_strs+1591) +/** Upper-cased name for the seed option */ +#define SEED_NAME (certtool_opt_strs+1652) +/** Name string for the seed option */ +#define SEED_name (certtool_opt_strs+1657) +/** Compiled in flag settings for the seed option */ +#define SEED_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * generate-request option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the generate-request option */ +#define GENERATE_REQUEST_DESC (certtool_opt_strs+1662) +/** Upper-cased name for the generate-request option */ +#define GENERATE_REQUEST_NAME (certtool_opt_strs+1702) +/** Name string for the generate-request option */ +#define GENERATE_REQUEST_name (certtool_opt_strs+1719) +/** Other options that appear in conjunction with the generate-request option */ +static int const aGenerate_RequestCantList[] = { + INDEX_OPT_INFILE, NO_EQUIVALENT }; +/** Compiled in flag settings for the generate-request option */ +#define GENERATE_REQUEST_FLAGS (OPTST_DISABLED) + +/** + * verify-chain option description: + */ +/** Descriptive text for the verify-chain option */ +#define VERIFY_CHAIN_DESC (certtool_opt_strs+1736) +/** Upper-cased name for the verify-chain option */ +#define VERIFY_CHAIN_NAME (certtool_opt_strs+1775) +/** Name string for the verify-chain option */ +#define VERIFY_CHAIN_name (certtool_opt_strs+1788) +/** Compiled in flag settings for the verify-chain option */ +#define VERIFY_CHAIN_FLAGS (OPTST_DISABLED) + +/** + * verify option description: + */ +/** Descriptive text for the verify option */ +#define VERIFY_DESC (certtool_opt_strs+1801) +/** Upper-cased name for the verify option */ +#define VERIFY_NAME (certtool_opt_strs+1861) +/** Name string for the verify option */ +#define VERIFY_name (certtool_opt_strs+1868) +/** Compiled in flag settings for the verify option */ +#define VERIFY_FLAGS (OPTST_DISABLED) + +/** + * verify-crl option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the verify-crl option */ +#define VERIFY_CRL_DESC (certtool_opt_strs+1875) +/** Upper-cased name for the verify-crl option */ +#define VERIFY_CRL_NAME (certtool_opt_strs+1909) +/** Name string for the verify-crl option */ +#define VERIFY_CRL_name (certtool_opt_strs+1920) +/** Other options that are required by the verify-crl option */ +static int const aVerify_CrlMustList[] = { + INDEX_OPT_LOAD_CA_CERTIFICATE, NO_EQUIVALENT }; +/** Compiled in flag settings for the verify-crl option */ +#define VERIFY_CRL_FLAGS (OPTST_DISABLED) + +/** + * verify-hostname option description: + */ +/** Descriptive text for the verify-hostname option */ +#define VERIFY_HOSTNAME_DESC (certtool_opt_strs+1931) +/** Upper-cased name for the verify-hostname option */ +#define VERIFY_HOSTNAME_NAME (certtool_opt_strs+1996) +/** Name string for the verify-hostname option */ +#define VERIFY_HOSTNAME_name (certtool_opt_strs+2012) +/** Compiled in flag settings for the verify-hostname option */ +#define VERIFY_HOSTNAME_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * verify-email option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the verify-email option */ +#define VERIFY_EMAIL_DESC (certtool_opt_strs+2028) +/** Upper-cased name for the verify-email option */ +#define VERIFY_EMAIL_NAME (certtool_opt_strs+2090) +/** Name string for the verify-email option */ +#define VERIFY_EMAIL_name (certtool_opt_strs+2103) +/** Other options that appear in conjunction with the verify-email option */ +static int const aVerify_EmailCantList[] = { + INDEX_OPT_VERIFY_HOSTNAME, NO_EQUIVALENT }; +/** Compiled in flag settings for the verify-email option */ +#define VERIFY_EMAIL_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * verify-purpose option description: + */ +/** Descriptive text for the verify-purpose option */ +#define VERIFY_PURPOSE_DESC (certtool_opt_strs+2116) +/** Upper-cased name for the verify-purpose option */ +#define VERIFY_PURPOSE_NAME (certtool_opt_strs+2184) +/** Name string for the verify-purpose option */ +#define VERIFY_PURPOSE_name (certtool_opt_strs+2199) +/** Compiled in flag settings for the verify-purpose option */ +#define VERIFY_PURPOSE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * verify-allow-broken option description: + */ +/** Descriptive text for the verify-allow-broken option */ +#define VERIFY_ALLOW_BROKEN_DESC (certtool_opt_strs+2214) +/** Upper-cased name for the verify-allow-broken option */ +#define VERIFY_ALLOW_BROKEN_NAME (certtool_opt_strs+2268) +/** Name string for the verify-allow-broken option */ +#define VERIFY_ALLOW_BROKEN_name (certtool_opt_strs+2288) +/** Compiled in flag settings for the verify-allow-broken option */ +#define VERIFY_ALLOW_BROKEN_FLAGS (OPTST_DISABLED) + +/** + * generate-dh-params option description: + */ +/** Descriptive text for the generate-dh-params option */ +#define GENERATE_DH_PARAMS_DESC (certtool_opt_strs+2308) +/** Upper-cased name for the generate-dh-params option */ +#define GENERATE_DH_PARAMS_NAME (certtool_opt_strs+2359) +/** Name string for the generate-dh-params option */ +#define GENERATE_DH_PARAMS_name (certtool_opt_strs+2378) +/** Compiled in flag settings for the generate-dh-params option */ +#define GENERATE_DH_PARAMS_FLAGS (OPTST_DISABLED) + +/** + * get-dh-params option description: + */ +/** Descriptive text for the get-dh-params option */ +#define GET_DH_PARAMS_DESC (certtool_opt_strs+2397) +/** Upper-cased name for the get-dh-params option */ +#define GET_DH_PARAMS_NAME (certtool_opt_strs+2456) +/** Name string for the get-dh-params option */ +#define GET_DH_PARAMS_name (certtool_opt_strs+2470) +/** Compiled in flag settings for the get-dh-params option */ +#define GET_DH_PARAMS_FLAGS (OPTST_DISABLED) + +/** + * dh-info option description: + */ +/** Descriptive text for the dh-info option */ +#define DH_INFO_DESC (certtool_opt_strs+2484) +/** Upper-cased name for the dh-info option */ +#define DH_INFO_NAME (certtool_opt_strs+2544) +/** Name string for the dh-info option */ +#define DH_INFO_name (certtool_opt_strs+2552) +/** Compiled in flag settings for the dh-info option */ +#define DH_INFO_FLAGS (OPTST_DISABLED) + +/** + * load-privkey option description: + */ +/** Descriptive text for the load-privkey option */ +#define LOAD_PRIVKEY_DESC (certtool_opt_strs+2560) +/** Upper-cased name for the load-privkey option */ +#define LOAD_PRIVKEY_NAME (certtool_opt_strs+2585) +/** Name string for the load-privkey option */ +#define LOAD_PRIVKEY_name (certtool_opt_strs+2598) +/** Compiled in flag settings for the load-privkey option */ +#define LOAD_PRIVKEY_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * load-pubkey option description: + */ +/** Descriptive text for the load-pubkey option */ +#define LOAD_PUBKEY_DESC (certtool_opt_strs+2611) +/** Upper-cased name for the load-pubkey option */ +#define LOAD_PUBKEY_NAME (certtool_opt_strs+2635) +/** Name string for the load-pubkey option */ +#define LOAD_PUBKEY_name (certtool_opt_strs+2647) +/** Compiled in flag settings for the load-pubkey option */ +#define LOAD_PUBKEY_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * load-request option description: + */ +/** Descriptive text for the load-request option */ +#define LOAD_REQUEST_DESC (certtool_opt_strs+2659) +/** Upper-cased name for the load-request option */ +#define LOAD_REQUEST_NAME (certtool_opt_strs+2692) +/** Name string for the load-request option */ +#define LOAD_REQUEST_name (certtool_opt_strs+2705) +/** Compiled in flag settings for the load-request option */ +#define LOAD_REQUEST_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * load-certificate option description: + */ +/** Descriptive text for the load-certificate option */ +#define LOAD_CERTIFICATE_DESC (certtool_opt_strs+2718) +/** Upper-cased name for the load-certificate option */ +#define LOAD_CERTIFICATE_NAME (certtool_opt_strs+2743) +/** Name string for the load-certificate option */ +#define LOAD_CERTIFICATE_name (certtool_opt_strs+2760) +/** Compiled in flag settings for the load-certificate option */ +#define LOAD_CERTIFICATE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * load-ca-privkey option description: + */ +/** Descriptive text for the load-ca-privkey option */ +#define LOAD_CA_PRIVKEY_DESC (certtool_opt_strs+2777) +/** Upper-cased name for the load-ca-privkey option */ +#define LOAD_CA_PRIVKEY_NAME (certtool_opt_strs+2828) +/** Name string for the load-ca-privkey option */ +#define LOAD_CA_PRIVKEY_name (certtool_opt_strs+2844) +/** Compiled in flag settings for the load-ca-privkey option */ +#define LOAD_CA_PRIVKEY_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * load-ca-certificate option description: + */ +/** Descriptive text for the load-ca-certificate option */ +#define LOAD_CA_CERTIFICATE_DESC (certtool_opt_strs+2860) +/** Upper-cased name for the load-ca-certificate option */ +#define LOAD_CA_CERTIFICATE_NAME (certtool_opt_strs+2911) +/** Name string for the load-ca-certificate option */ +#define LOAD_CA_CERTIFICATE_name (certtool_opt_strs+2931) +/** Compiled in flag settings for the load-ca-certificate option */ +#define LOAD_CA_CERTIFICATE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * load-crl option description: + */ +/** Descriptive text for the load-crl option */ +#define LOAD_CRL_DESC (certtool_opt_strs+2951) +/** Upper-cased name for the load-crl option */ +#define LOAD_CRL_NAME (certtool_opt_strs+2974) +/** Name string for the load-crl option */ +#define LOAD_CRL_name (certtool_opt_strs+2983) +/** Compiled in flag settings for the load-crl option */ +#define LOAD_CRL_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * load-data option description: + */ +/** Descriptive text for the load-data option */ +#define LOAD_DATA_DESC (certtool_opt_strs+2992) +/** Upper-cased name for the load-data option */ +#define LOAD_DATA_NAME (certtool_opt_strs+3013) +/** Name string for the load-data option */ +#define LOAD_DATA_name (certtool_opt_strs+3023) +/** Compiled in flag settings for the load-data option */ +#define LOAD_DATA_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * password option description: + */ +/** Descriptive text for the password option */ +#define PASSWORD_DESC (certtool_opt_strs+3033) +/** Upper-cased name for the password option */ +#define PASSWORD_NAME (certtool_opt_strs+3049) +/** Name string for the password option */ +#define PASSWORD_name (certtool_opt_strs+3058) +/** Compiled in flag settings for the password option */ +#define PASSWORD_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * null-password option description: + */ +/** Descriptive text for the null-password option */ +#define NULL_PASSWORD_DESC (certtool_opt_strs+3067) +/** Upper-cased name for the null-password option */ +#define NULL_PASSWORD_NAME (certtool_opt_strs+3091) +/** Name string for the null-password option */ +#define NULL_PASSWORD_name (certtool_opt_strs+3105) +/** Compiled in flag settings for the null-password option */ +#define NULL_PASSWORD_FLAGS (OPTST_DISABLED) + +/** + * empty-password option description: + */ +/** Descriptive text for the empty-password option */ +#define EMPTY_PASSWORD_DESC (certtool_opt_strs+3119) +/** Upper-cased name for the empty-password option */ +#define EMPTY_PASSWORD_NAME (certtool_opt_strs+3145) +/** Name string for the empty-password option */ +#define EMPTY_PASSWORD_name (certtool_opt_strs+3160) +/** Compiled in flag settings for the empty-password option */ +#define EMPTY_PASSWORD_FLAGS (OPTST_DISABLED) + +/** + * hex-numbers option description: + */ +/** Descriptive text for the hex-numbers option */ +#define HEX_NUMBERS_DESC (certtool_opt_strs+3175) +/** Upper-cased name for the hex-numbers option */ +#define HEX_NUMBERS_NAME (certtool_opt_strs+3221) +/** Name string for the hex-numbers option */ +#define HEX_NUMBERS_name (certtool_opt_strs+3233) +/** Compiled in flag settings for the hex-numbers option */ +#define HEX_NUMBERS_FLAGS (OPTST_DISABLED) + +/** + * cprint option description: + */ +/** Descriptive text for the cprint option */ +#define CPRINT_DESC (certtool_opt_strs+3245) +/** Upper-cased name for the cprint option */ +#define CPRINT_NAME (certtool_opt_strs+3314) +/** Name string for the cprint option */ +#define CPRINT_name (certtool_opt_strs+3321) +/** Compiled in flag settings for the cprint option */ +#define CPRINT_FLAGS (OPTST_DISABLED) + +/** + * certificate-info option description: + */ +/** Descriptive text for the certificate-info option */ +#define CERTIFICATE_INFO_DESC (certtool_opt_strs+3328) +/** Upper-cased name for the certificate-info option */ +#define CERTIFICATE_INFO_NAME (certtool_opt_strs+3371) +/** Name string for the certificate-info option */ +#define CERTIFICATE_INFO_name (certtool_opt_strs+3388) +/** Compiled in flag settings for the certificate-info option */ +#define CERTIFICATE_INFO_FLAGS (OPTST_DISABLED) + +/** + * fingerprint option description: + */ +/** Descriptive text for the fingerprint option */ +#define FINGERPRINT_DESC (certtool_opt_strs+3405) +/** Upper-cased name for the fingerprint option */ +#define FINGERPRINT_NAME (certtool_opt_strs+3452) +/** Name string for the fingerprint option */ +#define FINGERPRINT_name (certtool_opt_strs+3464) +/** Compiled in flag settings for the fingerprint option */ +#define FINGERPRINT_FLAGS (OPTST_DISABLED) + +/** + * key-id option description: + */ +/** Descriptive text for the key-id option */ +#define KEY_ID_DESC (certtool_opt_strs+3476) +/** Upper-cased name for the key-id option */ +#define KEY_ID_NAME (certtool_opt_strs+3518) +/** Name string for the key-id option */ +#define KEY_ID_name (certtool_opt_strs+3525) +/** Compiled in flag settings for the key-id option */ +#define KEY_ID_FLAGS (OPTST_DISABLED) + +/** + * certificate-pubkey option description: + */ +/** Descriptive text for the certificate-pubkey option */ +#define CERTIFICATE_PUBKEY_DESC (certtool_opt_strs+3532) +/** Upper-cased name for the certificate-pubkey option */ +#define CERTIFICATE_PUBKEY_NAME (certtool_opt_strs+3563) +/** Name string for the certificate-pubkey option */ +#define CERTIFICATE_PUBKEY_name (certtool_opt_strs+3582) +/** Compiled in flag settings for the certificate-pubkey option */ +#define CERTIFICATE_PUBKEY_FLAGS (OPTST_DISABLED) + +/** + * pgp-certificate-info option description: + */ +/** Descriptive text for the pgp-certificate-info option */ +#define PGP_CERTIFICATE_INFO_DESC (certtool_opt_strs+3601) +/** Upper-cased name for the pgp-certificate-info option */ +#define PGP_CERTIFICATE_INFO_NAME (certtool_opt_strs+3652) +/** Name string for the pgp-certificate-info option */ +#define PGP_CERTIFICATE_INFO_name (certtool_opt_strs+3673) +/** Compiled in flag settings for the pgp-certificate-info option */ +#define PGP_CERTIFICATE_INFO_FLAGS (OPTST_DISABLED) + +/** + * pgp-ring-info option description: + */ +/** Descriptive text for the pgp-ring-info option */ +#define PGP_RING_INFO_DESC (certtool_opt_strs+3694) +/** Upper-cased name for the pgp-ring-info option */ +#define PGP_RING_INFO_NAME (certtool_opt_strs+3751) +/** Name string for the pgp-ring-info option */ +#define PGP_RING_INFO_name (certtool_opt_strs+3765) +/** Compiled in flag settings for the pgp-ring-info option */ +#define PGP_RING_INFO_FLAGS (OPTST_DISABLED) + +/** + * crl-info option description: + */ +/** Descriptive text for the crl-info option */ +#define CRL_INFO_DESC (certtool_opt_strs+3779) +/** Upper-cased name for the crl-info option */ +#define CRL_INFO_NAME (certtool_opt_strs+3824) +/** Name string for the crl-info option */ +#define CRL_INFO_name (certtool_opt_strs+3833) +/** Compiled in flag settings for the crl-info option */ +#define CRL_INFO_FLAGS (OPTST_DISABLED) + +/** + * crq-info option description: + */ +/** Descriptive text for the crq-info option */ +#define CRQ_INFO_DESC (certtool_opt_strs+3842) +/** Upper-cased name for the crq-info option */ +#define CRQ_INFO_NAME (certtool_opt_strs+3893) +/** Name string for the crq-info option */ +#define CRQ_INFO_name (certtool_opt_strs+3902) +/** Compiled in flag settings for the crq-info option */ +#define CRQ_INFO_FLAGS (OPTST_DISABLED) + +/** + * no-crq-extensions option description: + */ +/** Descriptive text for the no-crq-extensions option */ +#define NO_CRQ_EXTENSIONS_DESC (certtool_opt_strs+3911) +/** Upper-cased name for the no-crq-extensions option */ +#define NO_CRQ_EXTENSIONS_NAME (certtool_opt_strs+3957) +/** Name string for the no-crq-extensions option */ +#define NO_CRQ_EXTENSIONS_name (certtool_opt_strs+3975) +/** Compiled in flag settings for the no-crq-extensions option */ +#define NO_CRQ_EXTENSIONS_FLAGS (OPTST_DISABLED) + +/** + * p12-info option description: + */ +/** Descriptive text for the p12-info option */ +#define P12_INFO_DESC (certtool_opt_strs+3993) +/** Upper-cased name for the p12-info option */ +#define P12_INFO_NAME (certtool_opt_strs+4035) +/** Name string for the p12-info option */ +#define P12_INFO_name (certtool_opt_strs+4044) +/** Compiled in flag settings for the p12-info option */ +#define P12_INFO_FLAGS (OPTST_DISABLED) + +/** + * p12-name option description: + */ +/** Descriptive text for the p12-name option */ +#define P12_NAME_DESC (certtool_opt_strs+4053) +/** Upper-cased name for the p12-name option */ +#define P12_NAME_NAME (certtool_opt_strs+4087) +/** Name string for the p12-name option */ +#define P12_NAME_name (certtool_opt_strs+4096) +/** Compiled in flag settings for the p12-name option */ +#define P12_NAME_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * p7-generate option description: + */ +/** Descriptive text for the p7-generate option */ +#define P7_GENERATE_DESC (certtool_opt_strs+4105) +/** Upper-cased name for the p7-generate option */ +#define P7_GENERATE_NAME (certtool_opt_strs+4134) +/** Name string for the p7-generate option */ +#define P7_GENERATE_name (certtool_opt_strs+4146) +/** Compiled in flag settings for the p7-generate option */ +#define P7_GENERATE_FLAGS (OPTST_DISABLED) + +/** + * p7-sign option description: + */ +/** Descriptive text for the p7-sign option */ +#define P7_SIGN_DESC (certtool_opt_strs+4158) +/** Upper-cased name for the p7-sign option */ +#define P7_SIGN_NAME (certtool_opt_strs+4190) +/** Name string for the p7-sign option */ +#define P7_SIGN_name (certtool_opt_strs+4198) +/** Compiled in flag settings for the p7-sign option */ +#define P7_SIGN_FLAGS (OPTST_DISABLED) + +/** + * p7-detached-sign option description: + */ +/** Descriptive text for the p7-detached-sign option */ +#define P7_DETACHED_SIGN_DESC (certtool_opt_strs+4206) +/** Upper-cased name for the p7-detached-sign option */ +#define P7_DETACHED_SIGN_NAME (certtool_opt_strs+4247) +/** Name string for the p7-detached-sign option */ +#define P7_DETACHED_SIGN_name (certtool_opt_strs+4264) +/** Compiled in flag settings for the p7-detached-sign option */ +#define P7_DETACHED_SIGN_FLAGS (OPTST_DISABLED) + +/** + * p7-include-cert option description: + */ +/** Descriptive text for the p7-include-cert option */ +#define P7_INCLUDE_CERT_DESC (certtool_opt_strs+4281) +/** Upper-cased name for the p7-include-cert option */ +#define P7_INCLUDE_CERT_NAME (certtool_opt_strs+4341) +/** disablement name for the p7-include-cert option */ +#define NOT_P7_INCLUDE_CERT_name (certtool_opt_strs+4357) +/** disablement prefix for the p7-include-cert option */ +#define NOT_P7_INCLUDE_CERT_PFX (certtool_opt_strs+4376) +/** Name string for the p7-include-cert option */ +#define P7_INCLUDE_CERT_name (NOT_P7_INCLUDE_CERT_name + 3) +/** Compiled in flag settings for the p7-include-cert option */ +#define P7_INCLUDE_CERT_FLAGS (OPTST_INITENABLED) + +/** + * p7-time option description: + */ +/** Descriptive text for the p7-time option */ +#define P7_TIME_DESC (certtool_opt_strs+4379) +/** Upper-cased name for the p7-time option */ +#define P7_TIME_NAME (certtool_opt_strs+4429) +/** disablement name for the p7-time option */ +#define NOT_P7_TIME_name (certtool_opt_strs+4437) +/** disablement prefix for the p7-time option */ +#define NOT_P7_TIME_PFX (certtool_opt_strs+4376) +/** Name string for the p7-time option */ +#define P7_TIME_name (NOT_P7_TIME_name + 3) +/** Compiled in flag settings for the p7-time option */ +#define P7_TIME_FLAGS (OPTST_DISABLED) + +/** + * p7-show-data option description: + */ +/** Descriptive text for the p7-show-data option */ +#define P7_SHOW_DATA_DESC (certtool_opt_strs+4448) +/** Upper-cased name for the p7-show-data option */ +#define P7_SHOW_DATA_NAME (certtool_opt_strs+4501) +/** disablement name for the p7-show-data option */ +#define NOT_P7_SHOW_DATA_name (certtool_opt_strs+4514) +/** disablement prefix for the p7-show-data option */ +#define NOT_P7_SHOW_DATA_PFX (certtool_opt_strs+4376) +/** Name string for the p7-show-data option */ +#define P7_SHOW_DATA_name (NOT_P7_SHOW_DATA_name + 3) +/** Compiled in flag settings for the p7-show-data option */ +#define P7_SHOW_DATA_FLAGS (OPTST_DISABLED) + +/** + * p7-info option description: + */ +/** Descriptive text for the p7-info option */ +#define P7_INFO_DESC (certtool_opt_strs+4530) +/** Upper-cased name for the p7-info option */ +#define P7_INFO_NAME (certtool_opt_strs+4571) +/** Name string for the p7-info option */ +#define P7_INFO_name (certtool_opt_strs+4579) +/** Compiled in flag settings for the p7-info option */ +#define P7_INFO_FLAGS (OPTST_DISABLED) + +/** + * p7-verify option description: + */ +/** Descriptive text for the p7-verify option */ +#define P7_VERIFY_DESC (certtool_opt_strs+4587) +/** Upper-cased name for the p7-verify option */ +#define P7_VERIFY_NAME (certtool_opt_strs+4625) +/** Name string for the p7-verify option */ +#define P7_VERIFY_name (certtool_opt_strs+4635) +/** Compiled in flag settings for the p7-verify option */ +#define P7_VERIFY_FLAGS (OPTST_DISABLED) + +/** + * p8-info option description: + */ +/** Descriptive text for the p8-info option */ +#define P8_INFO_DESC (certtool_opt_strs+4645) +/** Upper-cased name for the p8-info option */ +#define P8_INFO_NAME (certtool_opt_strs+4686) +/** Name string for the p8-info option */ +#define P8_INFO_name (certtool_opt_strs+4694) +/** Compiled in flag settings for the p8-info option */ +#define P8_INFO_FLAGS (OPTST_DISABLED) + +/** + * smime-to-p7 option description: + */ +/** Descriptive text for the smime-to-p7 option */ +#define SMIME_TO_P7_DESC (certtool_opt_strs+4702) +/** Upper-cased name for the smime-to-p7 option */ +#define SMIME_TO_P7_NAME (certtool_opt_strs+4738) +/** Name string for the smime-to-p7 option */ +#define SMIME_TO_P7_name (certtool_opt_strs+4750) +/** Compiled in flag settings for the smime-to-p7 option */ +#define SMIME_TO_P7_FLAGS (OPTST_DISABLED) + +/** + * key-info option description: + */ +/** Descriptive text for the key-info option */ +#define KEY_INFO_DESC (certtool_opt_strs+4762) +/** Upper-cased name for the key-info option */ +#define KEY_INFO_NAME (certtool_opt_strs+4797) +/** Name string for the key-info option */ +#define KEY_INFO_name (certtool_opt_strs+4806) +/** Compiled in flag settings for the key-info option */ +#define KEY_INFO_FLAGS (OPTST_DISABLED) + +/** + * pgp-key-info option description: + */ +/** Descriptive text for the pgp-key-info option */ +#define PGP_KEY_INFO_DESC (certtool_opt_strs+4815) +/** Upper-cased name for the pgp-key-info option */ +#define PGP_KEY_INFO_NAME (certtool_opt_strs+4859) +/** Name string for the pgp-key-info option */ +#define PGP_KEY_INFO_name (certtool_opt_strs+4872) +/** Compiled in flag settings for the pgp-key-info option */ +#define PGP_KEY_INFO_FLAGS (OPTST_DISABLED) + +/** + * pubkey-info option description: + */ +/** Descriptive text for the pubkey-info option */ +#define PUBKEY_INFO_DESC (certtool_opt_strs+4885) +/** Upper-cased name for the pubkey-info option */ +#define PUBKEY_INFO_NAME (certtool_opt_strs+4919) +/** Name string for the pubkey-info option */ +#define PUBKEY_INFO_name (certtool_opt_strs+4931) +/** Compiled in flag settings for the pubkey-info option */ +#define PUBKEY_INFO_FLAGS (OPTST_DISABLED) + +/** + * v1 option description: + */ +/** Descriptive text for the v1 option */ +#define V1_DESC (certtool_opt_strs+4943) +/** Upper-cased name for the v1 option */ +#define V1_NAME (certtool_opt_strs+5004) +/** Name string for the v1 option */ +#define V1_name (certtool_opt_strs+5007) +/** Compiled in flag settings for the v1 option */ +#define V1_FLAGS (OPTST_DISABLED) + +/** + * to-p12 option description: + */ +/** Descriptive text for the to-p12 option */ +#define TO_P12_DESC (certtool_opt_strs+5010) +/** Upper-cased name for the to-p12 option */ +#define TO_P12_NAME (certtool_opt_strs+5040) +/** Name string for the to-p12 option */ +#define TO_P12_name (certtool_opt_strs+5047) +/** Compiled in flag settings for the to-p12 option */ +#define TO_P12_FLAGS (OPTST_DISABLED) + +/** + * to-p8 option description: + */ +/** Descriptive text for the to-p8 option */ +#define TO_P8_DESC (certtool_opt_strs+5054) +/** Upper-cased name for the to-p8 option */ +#define TO_P8_NAME (certtool_opt_strs+5083) +/** Name string for the to-p8 option */ +#define TO_P8_name (certtool_opt_strs+5089) +/** Compiled in flag settings for the to-p8 option */ +#define TO_P8_FLAGS (OPTST_DISABLED) + +/** + * pkcs8 option description: + */ +/** Descriptive text for the pkcs8 option */ +#define PKCS8_DESC (certtool_opt_strs+5095) +/** Upper-cased name for the pkcs8 option */ +#define PKCS8_NAME (certtool_opt_strs+5131) +/** Name string for the pkcs8 option */ +#define PKCS8_name (certtool_opt_strs+5137) +/** Compiled in flag settings for the pkcs8 option */ +#define PKCS8_FLAGS (OPTST_DISABLED) + +/** + * rsa option description: + */ +/** Descriptive text for the rsa option */ +#define RSA_DESC (certtool_opt_strs+5143) +/** Upper-cased name for the rsa option */ +#define RSA_NAME (certtool_opt_strs+5160) +/** Name string for the rsa option */ +#define RSA_name (certtool_opt_strs+5164) +/** Compiled in flag settings for the rsa option */ +#define RSA_FLAGS (OPTST_DISABLED) + +/** + * dsa option description: + */ +/** Descriptive text for the dsa option */ +#define DSA_DESC (certtool_opt_strs+5168) +/** Upper-cased name for the dsa option */ +#define DSA_NAME (certtool_opt_strs+5185) +/** Name string for the dsa option */ +#define DSA_name (certtool_opt_strs+5189) +/** Compiled in flag settings for the dsa option */ +#define DSA_FLAGS (OPTST_DISABLED) + +/** + * ecc option description: + */ +/** Descriptive text for the ecc option */ +#define ECC_DESC (certtool_opt_strs+5193) +/** Upper-cased name for the ecc option */ +#define ECC_NAME (certtool_opt_strs+5218) +/** Name string for the ecc option */ +#define ECC_name (certtool_opt_strs+5222) +/** Compiled in flag settings for the ecc option */ +#define ECC_FLAGS (OPTST_DISABLED) + +/** + * ecdsa option description: + */ +/** Descriptive text for the ecdsa option */ +#define ECDSA_DESC (certtool_opt_strs+5226) +#define ECDSA_NAME NULL +/** Unmodified name string for the ecdsa option */ +#define ECDSA_name (certtool_opt_strs+5256) +/** Compiled in flag settings for the ecdsa option */ +#define ECDSA_FLAGS (ECC_FLAGS | OPTST_ALIAS) + +/** + * hash option description: + */ +/** Descriptive text for the hash option */ +#define HASH_DESC (certtool_opt_strs+5262) +/** Upper-cased name for the hash option */ +#define HASH_NAME (certtool_opt_strs+5296) +/** Name string for the hash option */ +#define HASH_name (certtool_opt_strs+5301) +/** Compiled in flag settings for the hash option */ +#define HASH_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * inder option description: + */ +/** Descriptive text for the inder option */ +#define INDER_DESC (certtool_opt_strs+5306) +/** Upper-cased name for the inder option */ +#define INDER_NAME (certtool_opt_strs+5377) +/** disablement name for the inder option */ +#define NOT_INDER_name (certtool_opt_strs+5383) +/** disablement prefix for the inder option */ +#define NOT_INDER_PFX (certtool_opt_strs+4376) +/** Name string for the inder option */ +#define INDER_name (NOT_INDER_name + 3) +/** Compiled in flag settings for the inder option */ +#define INDER_FLAGS (OPTST_DISABLED) + +/** + * inraw option description: + */ +/** Descriptive text for the inraw option */ +#define INRAW_DESC (certtool_opt_strs+5392) +#define INRAW_NAME NULL +/** Unmodified name string for the inraw option */ +#define INRAW_name (certtool_opt_strs+5424) +/** Compiled in flag settings for the inraw option */ +#define INRAW_FLAGS (INDER_FLAGS | OPTST_ALIAS) + +/** + * outder option description: + */ +/** Descriptive text for the outder option */ +#define OUTDER_DESC (certtool_opt_strs+5430) +/** Upper-cased name for the outder option */ +#define OUTDER_NAME (certtool_opt_strs+5502) +/** disablement name for the outder option */ +#define NOT_OUTDER_name (certtool_opt_strs+5509) +/** disablement prefix for the outder option */ +#define NOT_OUTDER_PFX (certtool_opt_strs+4376) +/** Name string for the outder option */ +#define OUTDER_name (NOT_OUTDER_name + 3) +/** Compiled in flag settings for the outder option */ +#define OUTDER_FLAGS (OPTST_DISABLED) + +/** + * outraw option description: + */ +/** Descriptive text for the outraw option */ +#define OUTRAW_DESC (certtool_opt_strs+5519) +#define OUTRAW_NAME NULL +/** Unmodified name string for the outraw option */ +#define OUTRAW_name (certtool_opt_strs+5552) +/** Compiled in flag settings for the outraw option */ +#define OUTRAW_FLAGS (OUTDER_FLAGS | OPTST_ALIAS) + +/** + * bits option description: + */ +/** Descriptive text for the bits option */ +#define BITS_DESC (certtool_opt_strs+5559) +/** Upper-cased name for the bits option */ +#define BITS_NAME (certtool_opt_strs+5603) +/** Name string for the bits option */ +#define BITS_name (certtool_opt_strs+5608) +/** Compiled in flag settings for the bits option */ +#define BITS_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * curve option description: + */ +/** Descriptive text for the curve option */ +#define CURVE_DESC (certtool_opt_strs+5613) +/** Upper-cased name for the curve option */ +#define CURVE_NAME (certtool_opt_strs+5658) +/** Name string for the curve option */ +#define CURVE_name (certtool_opt_strs+5664) +/** Compiled in flag settings for the curve option */ +#define CURVE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * sec-param option description: + */ +/** Descriptive text for the sec-param option */ +#define SEC_PARAM_DESC (certtool_opt_strs+5670) +/** Upper-cased name for the sec-param option */ +#define SEC_PARAM_NAME (certtool_opt_strs+5732) +/** Name string for the sec-param option */ +#define SEC_PARAM_name (certtool_opt_strs+5742) +/** Compiled in flag settings for the sec-param option */ +#define SEC_PARAM_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * disable-quick-random option description: + */ +/** Descriptive text for the disable-quick-random option */ +#define DISABLE_QUICK_RANDOM_DESC (certtool_opt_strs+5752) +/** Upper-cased name for the disable-quick-random option */ +#define DISABLE_QUICK_RANDOM_NAME (certtool_opt_strs+5762) +/** Name string for the disable-quick-random option */ +#define DISABLE_QUICK_RANDOM_name (certtool_opt_strs+5783) +/** Compiled in flag settings for the disable-quick-random option */ +#define DISABLE_QUICK_RANDOM_FLAGS (OPTST_DISABLED) + +/** + * template option description: + */ +/** Descriptive text for the template option */ +#define TEMPLATE_DESC (certtool_opt_strs+5804) +/** Upper-cased name for the template option */ +#define TEMPLATE_NAME (certtool_opt_strs+5855) +/** Name string for the template option */ +#define TEMPLATE_name (certtool_opt_strs+5864) +/** Compiled in flag settings for the template option */ +#define TEMPLATE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * stdout-info option description: + */ +/** Descriptive text for the stdout-info option */ +#define STDOUT_INFO_DESC (certtool_opt_strs+5873) +/** Upper-cased name for the stdout-info option */ +#define STDOUT_INFO_NAME (certtool_opt_strs+5919) +/** Name string for the stdout-info option */ +#define STDOUT_INFO_name (certtool_opt_strs+5931) +/** Compiled in flag settings for the stdout-info option */ +#define STDOUT_INFO_FLAGS (OPTST_DISABLED) + +/** + * ask-pass option description: + */ +/** Descriptive text for the ask-pass option */ +#define ASK_PASS_DESC (certtool_opt_strs+5943) +/** Upper-cased name for the ask-pass option */ +#define ASK_PASS_NAME (certtool_opt_strs+6004) +/** Name string for the ask-pass option */ +#define ASK_PASS_name (certtool_opt_strs+6013) +/** Compiled in flag settings for the ask-pass option */ +#define ASK_PASS_FLAGS (OPTST_DISABLED) + +/** + * pkcs-cipher option description: + */ +/** Descriptive text for the pkcs-cipher option */ +#define PKCS_CIPHER_DESC (certtool_opt_strs+6022) +/** Upper-cased name for the pkcs-cipher option */ +#define PKCS_CIPHER_NAME (certtool_opt_strs+6067) +/** Name string for the pkcs-cipher option */ +#define PKCS_CIPHER_name (certtool_opt_strs+6079) +/** Compiled in flag settings for the pkcs-cipher option */ +#define PKCS_CIPHER_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * provider option description: + */ +/** Descriptive text for the provider option */ +#define PROVIDER_DESC (certtool_opt_strs+6091) +/** Upper-cased name for the provider option */ +#define PROVIDER_NAME (certtool_opt_strs+6129) +/** Name string for the provider option */ +#define PROVIDER_name (certtool_opt_strs+6138) +/** Compiled in flag settings for the provider option */ +#define PROVIDER_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/* + * Help/More_Help/Version option descriptions: + */ +#define HELP_DESC (certtool_opt_strs+6147) +#define HELP_name (certtool_opt_strs+6191) +#ifdef HAVE_WORKING_FORK +#define MORE_HELP_DESC (certtool_opt_strs+6196) +#define MORE_HELP_name (certtool_opt_strs+6241) +#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +#define MORE_HELP_DESC HELP_DESC +#define MORE_HELP_name HELP_name +#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#endif +#ifdef NO_OPTIONAL_OPT_ARGS +# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ + OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) +#endif +#define VER_DESC (certtool_opt_strs+6251) +#define VER_name (certtool_opt_strs+6287) +/** + * Declare option callback procedures + */ +extern tOptProc + optionBooleanVal, optionNestedVal, optionNumericVal, + optionPagedUsage, optionPrintVersion, optionResetOpt, + optionStackArg, optionTimeDate, optionTimeVal, + optionUnstackArg, optionVendorOption; +static tOptProc + doOptDebug, doOptEcdsa, doOptInfile, doOptInraw, doOptOutraw, + doUsageOpt; +#define VER_PROC optionPrintVersion + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the certtool Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the certtool program responds to. + */ +static tOptDesc optDesc[OPTION_CT] = { + { /* entry idx, value */ 0, VALUE_OPT_DEBUG, + /* equiv idx, value */ 0, VALUE_OPT_DEBUG, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DEBUG_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --debug */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptDebug, + /* desc, NAME, name */ DEBUG_DESC, DEBUG_NAME, DEBUG_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 1, VALUE_OPT_VERBOSE, + /* equiv idx, value */ 1, VALUE_OPT_VERBOSE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, NOLIMIT, 0, + /* opt state flags */ VERBOSE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --verbose */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ VERBOSE_DESC, VERBOSE_NAME, VERBOSE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 2, VALUE_OPT_INFILE, + /* equiv idx, value */ 2, VALUE_OPT_INFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --infile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptInfile, + /* desc, NAME, name */ INFILE_DESC, INFILE_NAME, INFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 3, VALUE_OPT_OUTFILE, + /* equiv idx, value */ 3, VALUE_OPT_OUTFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OUTFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --outfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ OUTFILE_DESC, OUTFILE_NAME, OUTFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 4, VALUE_OPT_GENERATE_SELF_SIGNED, + /* equiv idx, value */ 4, VALUE_OPT_GENERATE_SELF_SIGNED, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ GENERATE_SELF_SIGNED_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --generate-self-signed */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ GENERATE_SELF_SIGNED_DESC, GENERATE_SELF_SIGNED_NAME, GENERATE_SELF_SIGNED_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 5, VALUE_OPT_GENERATE_CERTIFICATE, + /* equiv idx, value */ 5, VALUE_OPT_GENERATE_CERTIFICATE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ GENERATE_CERTIFICATE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --generate-certificate */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ GENERATE_CERTIFICATE_DESC, GENERATE_CERTIFICATE_NAME, GENERATE_CERTIFICATE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 6, VALUE_OPT_GENERATE_PROXY, + /* equiv idx, value */ 6, VALUE_OPT_GENERATE_PROXY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ GENERATE_PROXY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --generate-proxy */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ GENERATE_PROXY_DESC, GENERATE_PROXY_NAME, GENERATE_PROXY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 7, VALUE_OPT_GENERATE_CRL, + /* equiv idx, value */ 7, VALUE_OPT_GENERATE_CRL, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ GENERATE_CRL_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --generate-crl */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ GENERATE_CRL_DESC, GENERATE_CRL_NAME, GENERATE_CRL_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 8, VALUE_OPT_UPDATE_CERTIFICATE, + /* equiv idx, value */ 8, VALUE_OPT_UPDATE_CERTIFICATE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ UPDATE_CERTIFICATE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --update-certificate */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ UPDATE_CERTIFICATE_DESC, UPDATE_CERTIFICATE_NAME, UPDATE_CERTIFICATE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 9, VALUE_OPT_GENERATE_PRIVKEY, + /* equiv idx, value */ 9, VALUE_OPT_GENERATE_PRIVKEY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ GENERATE_PRIVKEY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --generate-privkey */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ GENERATE_PRIVKEY_DESC, GENERATE_PRIVKEY_NAME, GENERATE_PRIVKEY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 10, VALUE_OPT_PROVABLE, + /* equiv idx, value */ 10, VALUE_OPT_PROVABLE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PROVABLE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --provable */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PROVABLE_DESC, PROVABLE_NAME, PROVABLE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 11, VALUE_OPT_VERIFY_PROVABLE_PRIVKEY, + /* equiv idx, value */ 11, VALUE_OPT_VERIFY_PROVABLE_PRIVKEY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VERIFY_PROVABLE_PRIVKEY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --verify-provable-privkey */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ VERIFY_PROVABLE_PRIVKEY_DESC, VERIFY_PROVABLE_PRIVKEY_NAME, VERIFY_PROVABLE_PRIVKEY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 12, VALUE_OPT_SEED, + /* equiv idx, value */ 12, VALUE_OPT_SEED, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SEED_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --seed */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SEED_DESC, SEED_NAME, SEED_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 13, VALUE_OPT_GENERATE_REQUEST, + /* equiv idx, value */ 13, VALUE_OPT_GENERATE_REQUEST, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ GENERATE_REQUEST_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --generate-request */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, aGenerate_RequestCantList, + /* option proc */ NULL, + /* desc, NAME, name */ GENERATE_REQUEST_DESC, GENERATE_REQUEST_NAME, GENERATE_REQUEST_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 14, VALUE_OPT_VERIFY_CHAIN, + /* equiv idx, value */ 14, VALUE_OPT_VERIFY_CHAIN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VERIFY_CHAIN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --verify-chain */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ VERIFY_CHAIN_DESC, VERIFY_CHAIN_NAME, VERIFY_CHAIN_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 15, VALUE_OPT_VERIFY, + /* equiv idx, value */ 15, VALUE_OPT_VERIFY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VERIFY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --verify */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ VERIFY_DESC, VERIFY_NAME, VERIFY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 16, VALUE_OPT_VERIFY_CRL, + /* equiv idx, value */ 16, VALUE_OPT_VERIFY_CRL, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VERIFY_CRL_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --verify-crl */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ aVerify_CrlMustList, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ VERIFY_CRL_DESC, VERIFY_CRL_NAME, VERIFY_CRL_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 17, VALUE_OPT_VERIFY_HOSTNAME, + /* equiv idx, value */ 17, VALUE_OPT_VERIFY_HOSTNAME, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VERIFY_HOSTNAME_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --verify-hostname */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ VERIFY_HOSTNAME_DESC, VERIFY_HOSTNAME_NAME, VERIFY_HOSTNAME_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 18, VALUE_OPT_VERIFY_EMAIL, + /* equiv idx, value */ 18, VALUE_OPT_VERIFY_EMAIL, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VERIFY_EMAIL_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --verify-email */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, aVerify_EmailCantList, + /* option proc */ NULL, + /* desc, NAME, name */ VERIFY_EMAIL_DESC, VERIFY_EMAIL_NAME, VERIFY_EMAIL_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 19, VALUE_OPT_VERIFY_PURPOSE, + /* equiv idx, value */ 19, VALUE_OPT_VERIFY_PURPOSE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VERIFY_PURPOSE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --verify-purpose */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ VERIFY_PURPOSE_DESC, VERIFY_PURPOSE_NAME, VERIFY_PURPOSE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 20, VALUE_OPT_VERIFY_ALLOW_BROKEN, + /* equiv idx, value */ 20, VALUE_OPT_VERIFY_ALLOW_BROKEN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VERIFY_ALLOW_BROKEN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --verify-allow-broken */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ VERIFY_ALLOW_BROKEN_DESC, VERIFY_ALLOW_BROKEN_NAME, VERIFY_ALLOW_BROKEN_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 21, VALUE_OPT_GENERATE_DH_PARAMS, + /* equiv idx, value */ 21, VALUE_OPT_GENERATE_DH_PARAMS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ GENERATE_DH_PARAMS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --generate-dh-params */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ GENERATE_DH_PARAMS_DESC, GENERATE_DH_PARAMS_NAME, GENERATE_DH_PARAMS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 22, VALUE_OPT_GET_DH_PARAMS, + /* equiv idx, value */ 22, VALUE_OPT_GET_DH_PARAMS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ GET_DH_PARAMS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --get-dh-params */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ GET_DH_PARAMS_DESC, GET_DH_PARAMS_NAME, GET_DH_PARAMS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 23, VALUE_OPT_DH_INFO, + /* equiv idx, value */ 23, VALUE_OPT_DH_INFO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DH_INFO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --dh-info */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ DH_INFO_DESC, DH_INFO_NAME, DH_INFO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 24, VALUE_OPT_LOAD_PRIVKEY, + /* equiv idx, value */ 24, VALUE_OPT_LOAD_PRIVKEY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_PRIVKEY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-privkey */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LOAD_PRIVKEY_DESC, LOAD_PRIVKEY_NAME, LOAD_PRIVKEY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 25, VALUE_OPT_LOAD_PUBKEY, + /* equiv idx, value */ 25, VALUE_OPT_LOAD_PUBKEY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_PUBKEY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-pubkey */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LOAD_PUBKEY_DESC, LOAD_PUBKEY_NAME, LOAD_PUBKEY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 26, VALUE_OPT_LOAD_REQUEST, + /* equiv idx, value */ 26, VALUE_OPT_LOAD_REQUEST, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_REQUEST_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-request */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LOAD_REQUEST_DESC, LOAD_REQUEST_NAME, LOAD_REQUEST_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 27, VALUE_OPT_LOAD_CERTIFICATE, + /* equiv idx, value */ 27, VALUE_OPT_LOAD_CERTIFICATE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_CERTIFICATE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-certificate */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LOAD_CERTIFICATE_DESC, LOAD_CERTIFICATE_NAME, LOAD_CERTIFICATE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 28, VALUE_OPT_LOAD_CA_PRIVKEY, + /* equiv idx, value */ 28, VALUE_OPT_LOAD_CA_PRIVKEY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_CA_PRIVKEY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-ca-privkey */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LOAD_CA_PRIVKEY_DESC, LOAD_CA_PRIVKEY_NAME, LOAD_CA_PRIVKEY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 29, VALUE_OPT_LOAD_CA_CERTIFICATE, + /* equiv idx, value */ 29, VALUE_OPT_LOAD_CA_CERTIFICATE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_CA_CERTIFICATE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-ca-certificate */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LOAD_CA_CERTIFICATE_DESC, LOAD_CA_CERTIFICATE_NAME, LOAD_CA_CERTIFICATE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 30, VALUE_OPT_LOAD_CRL, + /* equiv idx, value */ 30, VALUE_OPT_LOAD_CRL, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_CRL_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-crl */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LOAD_CRL_DESC, LOAD_CRL_NAME, LOAD_CRL_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 31, VALUE_OPT_LOAD_DATA, + /* equiv idx, value */ 31, VALUE_OPT_LOAD_DATA, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_DATA_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-data */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LOAD_DATA_DESC, LOAD_DATA_NAME, LOAD_DATA_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 32, VALUE_OPT_PASSWORD, + /* equiv idx, value */ 32, VALUE_OPT_PASSWORD, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PASSWORD_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --password */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PASSWORD_DESC, PASSWORD_NAME, PASSWORD_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 33, VALUE_OPT_NULL_PASSWORD, + /* equiv idx, value */ 33, VALUE_OPT_NULL_PASSWORD, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ NULL_PASSWORD_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --null-password */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ NULL_PASSWORD_DESC, NULL_PASSWORD_NAME, NULL_PASSWORD_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 34, VALUE_OPT_EMPTY_PASSWORD, + /* equiv idx, value */ 34, VALUE_OPT_EMPTY_PASSWORD, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ EMPTY_PASSWORD_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --empty-password */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ EMPTY_PASSWORD_DESC, EMPTY_PASSWORD_NAME, EMPTY_PASSWORD_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 35, VALUE_OPT_HEX_NUMBERS, + /* equiv idx, value */ 35, VALUE_OPT_HEX_NUMBERS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ HEX_NUMBERS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --hex-numbers */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ HEX_NUMBERS_DESC, HEX_NUMBERS_NAME, HEX_NUMBERS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 36, VALUE_OPT_CPRINT, + /* equiv idx, value */ 36, VALUE_OPT_CPRINT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ CPRINT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --cprint */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ CPRINT_DESC, CPRINT_NAME, CPRINT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 37, VALUE_OPT_CERTIFICATE_INFO, + /* equiv idx, value */ 37, VALUE_OPT_CERTIFICATE_INFO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ CERTIFICATE_INFO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --certificate-info */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ CERTIFICATE_INFO_DESC, CERTIFICATE_INFO_NAME, CERTIFICATE_INFO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 38, VALUE_OPT_FINGERPRINT, + /* equiv idx, value */ 38, VALUE_OPT_FINGERPRINT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ FINGERPRINT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --fingerprint */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ FINGERPRINT_DESC, FINGERPRINT_NAME, FINGERPRINT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 39, VALUE_OPT_KEY_ID, + /* equiv idx, value */ 39, VALUE_OPT_KEY_ID, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ KEY_ID_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --key-id */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ KEY_ID_DESC, KEY_ID_NAME, KEY_ID_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 40, VALUE_OPT_CERTIFICATE_PUBKEY, + /* equiv idx, value */ 40, VALUE_OPT_CERTIFICATE_PUBKEY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ CERTIFICATE_PUBKEY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --certificate-pubkey */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ CERTIFICATE_PUBKEY_DESC, CERTIFICATE_PUBKEY_NAME, CERTIFICATE_PUBKEY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 41, VALUE_OPT_PGP_CERTIFICATE_INFO, + /* equiv idx, value */ 41, VALUE_OPT_PGP_CERTIFICATE_INFO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PGP_CERTIFICATE_INFO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pgp-certificate-info */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PGP_CERTIFICATE_INFO_DESC, PGP_CERTIFICATE_INFO_NAME, PGP_CERTIFICATE_INFO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 42, VALUE_OPT_PGP_RING_INFO, + /* equiv idx, value */ 42, VALUE_OPT_PGP_RING_INFO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PGP_RING_INFO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pgp-ring-info */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PGP_RING_INFO_DESC, PGP_RING_INFO_NAME, PGP_RING_INFO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 43, VALUE_OPT_CRL_INFO, + /* equiv idx, value */ 43, VALUE_OPT_CRL_INFO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ CRL_INFO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --crl-info */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ CRL_INFO_DESC, CRL_INFO_NAME, CRL_INFO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 44, VALUE_OPT_CRQ_INFO, + /* equiv idx, value */ 44, VALUE_OPT_CRQ_INFO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ CRQ_INFO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --crq-info */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ CRQ_INFO_DESC, CRQ_INFO_NAME, CRQ_INFO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 45, VALUE_OPT_NO_CRQ_EXTENSIONS, + /* equiv idx, value */ 45, VALUE_OPT_NO_CRQ_EXTENSIONS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ NO_CRQ_EXTENSIONS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --no-crq-extensions */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ NO_CRQ_EXTENSIONS_DESC, NO_CRQ_EXTENSIONS_NAME, NO_CRQ_EXTENSIONS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 46, VALUE_OPT_P12_INFO, + /* equiv idx, value */ 46, VALUE_OPT_P12_INFO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ P12_INFO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --p12-info */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ P12_INFO_DESC, P12_INFO_NAME, P12_INFO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 47, VALUE_OPT_P12_NAME, + /* equiv idx, value */ 47, VALUE_OPT_P12_NAME, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ P12_NAME_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --p12-name */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ P12_NAME_DESC, P12_NAME_NAME, P12_NAME_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 48, VALUE_OPT_P7_GENERATE, + /* equiv idx, value */ 48, VALUE_OPT_P7_GENERATE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ P7_GENERATE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --p7-generate */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ P7_GENERATE_DESC, P7_GENERATE_NAME, P7_GENERATE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 49, VALUE_OPT_P7_SIGN, + /* equiv idx, value */ 49, VALUE_OPT_P7_SIGN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ P7_SIGN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --p7-sign */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ P7_SIGN_DESC, P7_SIGN_NAME, P7_SIGN_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 50, VALUE_OPT_P7_DETACHED_SIGN, + /* equiv idx, value */ 50, VALUE_OPT_P7_DETACHED_SIGN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ P7_DETACHED_SIGN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --p7-detached-sign */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ P7_DETACHED_SIGN_DESC, P7_DETACHED_SIGN_NAME, P7_DETACHED_SIGN_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 51, VALUE_OPT_P7_INCLUDE_CERT, + /* equiv idx, value */ 51, VALUE_OPT_P7_INCLUDE_CERT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ P7_INCLUDE_CERT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --p7-include-cert */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ P7_INCLUDE_CERT_DESC, P7_INCLUDE_CERT_NAME, P7_INCLUDE_CERT_name, + /* disablement strs */ NOT_P7_INCLUDE_CERT_name, NOT_P7_INCLUDE_CERT_PFX }, + + { /* entry idx, value */ 52, VALUE_OPT_P7_TIME, + /* equiv idx, value */ 52, VALUE_OPT_P7_TIME, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ P7_TIME_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --p7-time */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ P7_TIME_DESC, P7_TIME_NAME, P7_TIME_name, + /* disablement strs */ NOT_P7_TIME_name, NOT_P7_TIME_PFX }, + + { /* entry idx, value */ 53, VALUE_OPT_P7_SHOW_DATA, + /* equiv idx, value */ 53, VALUE_OPT_P7_SHOW_DATA, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ P7_SHOW_DATA_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --p7-show-data */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ P7_SHOW_DATA_DESC, P7_SHOW_DATA_NAME, P7_SHOW_DATA_name, + /* disablement strs */ NOT_P7_SHOW_DATA_name, NOT_P7_SHOW_DATA_PFX }, + + { /* entry idx, value */ 54, VALUE_OPT_P7_INFO, + /* equiv idx, value */ 54, VALUE_OPT_P7_INFO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ P7_INFO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --p7-info */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ P7_INFO_DESC, P7_INFO_NAME, P7_INFO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 55, VALUE_OPT_P7_VERIFY, + /* equiv idx, value */ 55, VALUE_OPT_P7_VERIFY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ P7_VERIFY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --p7-verify */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ P7_VERIFY_DESC, P7_VERIFY_NAME, P7_VERIFY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 56, VALUE_OPT_P8_INFO, + /* equiv idx, value */ 56, VALUE_OPT_P8_INFO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ P8_INFO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --p8-info */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ P8_INFO_DESC, P8_INFO_NAME, P8_INFO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 57, VALUE_OPT_SMIME_TO_P7, + /* equiv idx, value */ 57, VALUE_OPT_SMIME_TO_P7, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SMIME_TO_P7_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --smime-to-p7 */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SMIME_TO_P7_DESC, SMIME_TO_P7_NAME, SMIME_TO_P7_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 58, VALUE_OPT_KEY_INFO, + /* equiv idx, value */ 58, VALUE_OPT_KEY_INFO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ KEY_INFO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --key-info */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ KEY_INFO_DESC, KEY_INFO_NAME, KEY_INFO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 59, VALUE_OPT_PGP_KEY_INFO, + /* equiv idx, value */ 59, VALUE_OPT_PGP_KEY_INFO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PGP_KEY_INFO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pgp-key-info */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PGP_KEY_INFO_DESC, PGP_KEY_INFO_NAME, PGP_KEY_INFO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 60, VALUE_OPT_PUBKEY_INFO, + /* equiv idx, value */ 60, VALUE_OPT_PUBKEY_INFO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PUBKEY_INFO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pubkey-info */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PUBKEY_INFO_DESC, PUBKEY_INFO_NAME, PUBKEY_INFO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 61, VALUE_OPT_V1, + /* equiv idx, value */ 61, VALUE_OPT_V1, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ V1_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --v1 */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ V1_DESC, V1_NAME, V1_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 62, VALUE_OPT_TO_P12, + /* equiv idx, value */ 62, VALUE_OPT_TO_P12, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ TO_P12_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --to-p12 */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ TO_P12_DESC, TO_P12_NAME, TO_P12_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 63, VALUE_OPT_TO_P8, + /* equiv idx, value */ 63, VALUE_OPT_TO_P8, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ TO_P8_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --to-p8 */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ TO_P8_DESC, TO_P8_NAME, TO_P8_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 64, VALUE_OPT_PKCS8, + /* equiv idx, value */ 64, VALUE_OPT_PKCS8, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PKCS8_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pkcs8 */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PKCS8_DESC, PKCS8_NAME, PKCS8_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 65, VALUE_OPT_RSA, + /* equiv idx, value */ 65, VALUE_OPT_RSA, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ RSA_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --rsa */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ RSA_DESC, RSA_NAME, RSA_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 66, VALUE_OPT_DSA, + /* equiv idx, value */ 66, VALUE_OPT_DSA, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DSA_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --dsa */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ DSA_DESC, DSA_NAME, DSA_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 67, VALUE_OPT_ECC, + /* equiv idx, value */ 67, VALUE_OPT_ECC, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ ECC_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --ecc */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ ECC_DESC, ECC_NAME, ECC_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 68, VALUE_OPT_ECDSA, + /* equiv idx, value */ 68, VALUE_OPT_ECDSA, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ ECDSA_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --ecdsa */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptEcdsa, + /* desc, NAME, name */ ECDSA_DESC, ECDSA_NAME, ECDSA_name, + /* disablement strs */ 0, 0 }, + + { /* entry idx, value */ 69, VALUE_OPT_HASH, + /* equiv idx, value */ 69, VALUE_OPT_HASH, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ HASH_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --hash */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ HASH_DESC, HASH_NAME, HASH_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 70, VALUE_OPT_INDER, + /* equiv idx, value */ 70, VALUE_OPT_INDER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INDER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --inder */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ INDER_DESC, INDER_NAME, INDER_name, + /* disablement strs */ NOT_INDER_name, NOT_INDER_PFX }, + + { /* entry idx, value */ 71, VALUE_OPT_INRAW, + /* equiv idx, value */ 71, VALUE_OPT_INRAW, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INRAW_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --inraw */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptInraw, + /* desc, NAME, name */ INRAW_DESC, INRAW_NAME, INRAW_name, + /* disablement strs */ 0, 0 }, + + { /* entry idx, value */ 72, VALUE_OPT_OUTDER, + /* equiv idx, value */ 72, VALUE_OPT_OUTDER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OUTDER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --outder */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ OUTDER_DESC, OUTDER_NAME, OUTDER_name, + /* disablement strs */ NOT_OUTDER_name, NOT_OUTDER_PFX }, + + { /* entry idx, value */ 73, VALUE_OPT_OUTRAW, + /* equiv idx, value */ 73, VALUE_OPT_OUTRAW, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OUTRAW_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --outraw */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptOutraw, + /* desc, NAME, name */ OUTRAW_DESC, OUTRAW_NAME, OUTRAW_name, + /* disablement strs */ 0, 0 }, + + { /* entry idx, value */ 74, VALUE_OPT_BITS, + /* equiv idx, value */ 74, VALUE_OPT_BITS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ BITS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --bits */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionNumericVal, + /* desc, NAME, name */ BITS_DESC, BITS_NAME, BITS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 75, VALUE_OPT_CURVE, + /* equiv idx, value */ 75, VALUE_OPT_CURVE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ CURVE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --curve */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ CURVE_DESC, CURVE_NAME, CURVE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 76, VALUE_OPT_SEC_PARAM, + /* equiv idx, value */ 76, VALUE_OPT_SEC_PARAM, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SEC_PARAM_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --sec-param */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SEC_PARAM_DESC, SEC_PARAM_NAME, SEC_PARAM_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 77, VALUE_OPT_DISABLE_QUICK_RANDOM, + /* equiv idx, value */ 77, VALUE_OPT_DISABLE_QUICK_RANDOM, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DISABLE_QUICK_RANDOM_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --disable-quick-random */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ DISABLE_QUICK_RANDOM_DESC, DISABLE_QUICK_RANDOM_NAME, DISABLE_QUICK_RANDOM_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 78, VALUE_OPT_TEMPLATE, + /* equiv idx, value */ 78, VALUE_OPT_TEMPLATE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ TEMPLATE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --template */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ TEMPLATE_DESC, TEMPLATE_NAME, TEMPLATE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 79, VALUE_OPT_STDOUT_INFO, + /* equiv idx, value */ 79, VALUE_OPT_STDOUT_INFO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ STDOUT_INFO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --stdout-info */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ STDOUT_INFO_DESC, STDOUT_INFO_NAME, STDOUT_INFO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 80, VALUE_OPT_ASK_PASS, + /* equiv idx, value */ 80, VALUE_OPT_ASK_PASS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ ASK_PASS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --ask-pass */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ ASK_PASS_DESC, ASK_PASS_NAME, ASK_PASS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 81, VALUE_OPT_PKCS_CIPHER, + /* equiv idx, value */ 81, VALUE_OPT_PKCS_CIPHER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PKCS_CIPHER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pkcs-cipher */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PKCS_CIPHER_DESC, PKCS_CIPHER_NAME, PKCS_CIPHER_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 82, VALUE_OPT_PROVIDER, + /* equiv idx, value */ 82, VALUE_OPT_PROVIDER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PROVIDER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --provider */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PROVIDER_DESC, PROVIDER_NAME, PROVIDER_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VER_FLAGS, AOUSE_VERSION, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ VER_PROC, + /* desc, NAME, name */ VER_DESC, NULL, VER_name, + /* disablement strs */ NULL, NULL }, + + + + { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doUsageOpt, + /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionPagedUsage, + /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, + /* disablement strs */ NULL, NULL } +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** Reference to the upper cased version of certtool. */ +#define zPROGNAME (certtool_opt_strs+6295) +/** Reference to the title line for certtool usage. */ +#define zUsageTitle (certtool_opt_strs+6304) +/** There is no certtool configuration file. */ +#define zRcName NULL +/** There are no directories to search for certtool config files. */ +#define apzHomeList NULL +/** The certtool program bug email address. */ +#define zBugsAddr (certtool_opt_strs+6397) +/** Clarification/explanation of what certtool does. */ +#define zExplain (certtool_opt_strs+6417) +/** Extra detail explaining what certtool does. */ +#define zDetail (certtool_opt_strs+6419) +/** The full version string for certtool. */ +#define zFullVersion (certtool_opt_strs+6770) +/* extracted from optcode.tlib near line 364 */ + +#if defined(ENABLE_NLS) +# define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT + static tOptionXlateProc translate_option_strings; +#else +# define OPTPROC_BASE OPTPROC_NONE +# define translate_option_strings NULL +#endif /* ENABLE_NLS */ + +#define certtool_full_usage (NULL) +#define certtool_short_usage (certtool_opt_strs+6789) + +#endif /* not defined __doxygen__ */ + +/* + * Create the static procedure(s) declared above. + */ +/** + * The callout function that invokes the optionUsage function. + * + * @param[in] opts the AutoOpts option description structure + * @param[in] od the descriptor for the "help" (usage) option. + * @noreturn + */ +static void +doUsageOpt(tOptions * opts, tOptDesc * od) +{ + int ex_code; + ex_code = CERTTOOL_EXIT_SUCCESS; + optionUsage(&certtoolOptions, ex_code); + /* NOTREACHED */ + exit(CERTTOOL_EXIT_FAILURE); + (void)opts; + (void)od; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the debug option. + * Specifies the debug level. + * @param[in] pOptions the certtool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptDebug(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[1] = { + { 0 , 9999 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 1; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + + emit_ranges: +optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the infile option. + * + * @param[in] pOptions the certtool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptInfile(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the ecdsa option. + * + * @param[in] pOptions the certtool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptEcdsa(tOptions* pOptions, tOptDesc* pOptDesc) +{ + int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_ECC); + if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0)) + USAGE(CERTTOOL_EXIT_USAGE_ERROR); + +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the inraw option. + * + * @param[in] pOptions the certtool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptInraw(tOptions* pOptions, tOptDesc* pOptDesc) +{ + int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_INDER); + if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0)) + USAGE(CERTTOOL_EXIT_USAGE_ERROR); + +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the outraw option. + * + * @param[in] pOptions the certtool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptOutraw(tOptions* pOptions, tOptDesc* pOptDesc) +{ + int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_OUTDER); + if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0)) + USAGE(CERTTOOL_EXIT_USAGE_ERROR); + +} +/* extracted from optmain.tlib near line 1250 */ + +/** + * The directory containing the data associated with certtool. + */ +#ifndef PKGDATADIR +# define PKGDATADIR "" +#endif + +/** + * Information about the person or institution that packaged certtool + * for the current distribution. + */ +#ifndef WITH_PACKAGER +# define certtool_packager_info NULL +#else +/** Packager information for certtool. */ +static char const certtool_packager_info[] = + "Packaged by " WITH_PACKAGER + +# ifdef WITH_PACKAGER_VERSION + " ("WITH_PACKAGER_VERSION")" +# endif + +# ifdef WITH_PACKAGER_BUG_REPORTS + "\nReport certtool bugs to " WITH_PACKAGER_BUG_REPORTS +# endif + "\n"; +#endif +#ifndef __doxygen__ + +#endif /* __doxygen__ */ +/** + * The option definitions for certtool. The one structure that + * binds them all. + */ +tOptions certtoolOptions = { + OPTIONS_STRUCT_VERSION, + 0, NULL, /* original argc + argv */ + ( OPTPROC_BASE + + OPTPROC_ERRSTOP + + OPTPROC_SHORTOPT + + OPTPROC_LONGOPT + + OPTPROC_NO_REQ_OPT + + OPTPROC_NEGATIONS + + OPTPROC_NO_ARGS + + OPTPROC_GNUUSAGE + + OPTPROC_MISUSE ), + 0, NULL, /* current option index, current option */ + NULL, NULL, zPROGNAME, + zRcName, zCopyright, zLicenseDescrip, + zFullVersion, apzHomeList, zUsageTitle, + zExplain, zDetail, optDesc, + zBugsAddr, /* address to send bugs to */ + NULL, NULL, /* extensions/saved state */ + optionUsage, /* usage procedure */ + translate_option_strings, /* translation procedure */ + /* + * Indexes to special options + */ + { INDEX_OPT_MORE_HELP, /* more-help option index */ + NO_EQUIVALENT, /* save option index */ + NO_EQUIVALENT, /* '-#' option index */ + NO_EQUIVALENT /* index of default opt */ + }, + 86 /* full option count */, 83 /* user option count */, + certtool_full_usage, certtool_short_usage, + NULL, NULL, + PKGDATADIR, certtool_packager_info +}; + +#if ENABLE_NLS +/** + * This code is designed to translate translatable option text for the + * certtool program. These translations happen upon entry + * to optionProcess(). + */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#ifdef HAVE_DCGETTEXT +# include <gettext.h> +#endif +#include <autoopts/usage-txt.h> + +static char * AO_gettext(char const * pz); +static void coerce_it(void ** s); + +/** + * AutoGen specific wrapper function for gettext. It relies on the macro _() + * to convert from English to the target language, then strdup-duplicates the + * result string. It tries the "libopts" domain first, then whatever has been + * set via the \a textdomain(3) call. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * +AO_gettext(char const * pz) +{ + char * res; + if (pz == NULL) + return NULL; +#ifdef HAVE_DCGETTEXT + /* + * While processing the option_xlateable_txt data, try to use the + * "libopts" domain. Once we switch to the option descriptor data, + * do *not* use that domain. + */ + if (option_xlateable_txt.field_ct != 0) { + res = dgettext("libopts", pz); + if (res == pz) + res = (char *)VOIDP(_(pz)); + } else + res = (char *)VOIDP(_(pz)); +#else + res = (char *)VOIDP(_(pz)); +#endif + if (res == pz) + return res; + res = strdup(res); + if (res == NULL) { + fputs(_("No memory for duping translated strings\n"), stderr); + exit(CERTTOOL_EXIT_FAILURE); + } + return res; +} + +/** + * All the pointers we use are marked "* const", but they are stored in + * writable memory. Coerce the mutability and set the pointer. + */ +static void coerce_it(void ** s) { *s = AO_gettext(*s); +} + +/** + * Translate all the translatable strings in the certtoolOptions + * structure defined above. This is done only once. + */ +static void +translate_option_strings(void) +{ + tOptions * const opts = &certtoolOptions; + + /* + * Guard against re-translation. It won't work. The strings will have + * been changed by the first pass through this code. One shot only. + */ + if (option_xlateable_txt.field_ct != 0) { + /* + * Do the translations. The first pointer follows the field count + * field. The field count field is the size of a pointer. + */ + char ** ppz = (char**)VOIDP(&(option_xlateable_txt)); + int ix = option_xlateable_txt.field_ct; + + do { + ppz++; /* skip over field_ct */ + *ppz = AO_gettext(*ppz); + } while (--ix > 0); + /* prevent re-translation and disable "libopts" domain lookup */ + option_xlateable_txt.field_ct = 0; + + coerce_it(VOIDP(&(opts->pzCopyright))); + coerce_it(VOIDP(&(opts->pzCopyNotice))); + coerce_it(VOIDP(&(opts->pzFullVersion))); + coerce_it(VOIDP(&(opts->pzUsageTitle))); + coerce_it(VOIDP(&(opts->pzExplain))); + coerce_it(VOIDP(&(opts->pzDetail))); + { + tOptDesc * od = opts->pOptDesc; + for (ix = opts->optCt; ix > 0; ix--, od++) + coerce_it(VOIDP(&(od->pzText))); + } + } +} +#endif /* ENABLE_NLS */ + +#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT +/** I18N function strictly for xgettext. Do not compile. */ +static void bogus_function(void) { + /* TRANSLATORS: + + The following dummy function was crated solely so that xgettext can + extract the correct strings. These strings are actually referenced + by a field name in the certtoolOptions structure noted in the + comments below. The literal text is defined in certtool_opt_strs. + + NOTE: the strings below are segmented with respect to the source string + certtool_opt_strs. The strings above are handed off for translation + at run time a paragraph at a time. Consequently, they are presented here + for translation a paragraph at a time. + + ALSO: often the description for an option will reference another option + by name. These are set off with apostrophe quotes (I hope). Do not + translate option names. + */ + /* referenced via certtoolOptions.pzCopyright */ + puts(_("certtool @VERSION@\n\ +Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n\ +This is free software. It is licensed for use, modification and\n\ +redistribution under the terms of the GNU General Public License,\n\ +version 3 or later <http://gnu.org/licenses/gpl.html>\n")); + + /* referenced via certtoolOptions.pzCopyNotice */ + puts(_("certtool is free software: you can redistribute it and/or modify it under\n\ +the terms of the GNU General Public License as published by the Free\n\ +Software Foundation, either version 3 of the License, or (at your option)\n\ +any later version.\n\n")); + puts(_("certtool is distributed in the hope that it will be useful, but WITHOUT ANY\n\ +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n\ +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n\ +details.\n\n")); + puts(_("You should have received a copy of the GNU General Public License along\n\ +with this program. If not, see <http://www.gnu.org/licenses/>.\n")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Enable debugging")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("More verbose output")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Input file")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Output file")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Generate a self-signed certificate")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Generate a signed certificate")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Generates a proxy certificate")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Generate a CRL")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Update a signed certificate")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Generate a private key")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Generate a private key or parameters from a seed using a provable method")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Verify a private key generated from a seed using a provable method")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("When generating a private key use the given hex-encoded seed")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Generate a PKCS #10 certificate request")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Verify a PEM encoded certificate chain")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Verify a PEM encoded certificate chain using a trusted list")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Verify a CRL using a trusted list")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Specify a hostname to be used for certificate chain verification")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Specify a email to be used for certificate chain verification")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Specify a purpose OID to be used for certificate chain verification")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Allow broken algorithms, such as MD5 for verification")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Generate PKCS #3 encoded Diffie-Hellman parameters")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Get the included PKCS #3 encoded Diffie-Hellman parameters")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Print information PKCS #3 encoded Diffie-Hellman parameters")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Loads a private key file")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Loads a public key file")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Loads a certificate request file")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Loads a certificate file")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Loads the certificate authority's private key file")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Loads the certificate authority's certificate file")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Loads the provided CRL")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Loads auxiliary data")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Password to use")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Enforce a NULL password")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Enforce an empty password")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Print big number in an easier format to parse")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("In certain operations it prints the information in C-friendly format")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Print information on the given certificate")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Print the fingerprint of the given certificate")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Print the key ID of the given certificate")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Print certificate's public key")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Print information on the given OpenPGP certificate")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Print information on the given OpenPGP keyring structure")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Print information on the given CRL structure")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Print information on the given certificate request")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Do not use extensions in certificate requests")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Print information on a PKCS #12 structure")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("The PKCS #12 friendly name to use")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Generate a PKCS #7 structure")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Signs using a PKCS #7 structure")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Signs using a detached PKCS #7 structure")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("The signer's certificate will be included in the cert list.")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Will include a timestamp in the PKCS #7 structure")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Will show the embedded data in the PKCS #7 structure")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Print information on a PKCS #7 structure")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Verify the provided PKCS #7 structure")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Print information on a PKCS #8 structure")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Convert S/MIME to PKCS #7 structure")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Print information on a private key")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Print information on an OpenPGP private key")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Print information on a public key")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Generate an X.509 version 1 certificate (with no extensions)")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Generate a PKCS #12 structure")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Generate a PKCS #8 structure")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Use PKCS #8 format for private keys")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Generate RSA key")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Generate DSA key")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Generate ECC (ECDSA) key")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("an alias for the 'ecc' option")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Hash algorithm to use for signing")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Use DER format for input certificates, private keys, and DH parameters")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("an alias for the 'inder' option")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Use DER format for output certificates, private keys, and DH parameters")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("an alias for the 'outder' option")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Specify the number of bits for key generate")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Specify the curve used for EC key generation")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Specify the security level [low, legacy, medium, high, ultra]")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("No effect")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Template file to use for non-interactive operation")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Print information to stdout instead of stderr")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Enable interaction for entering password when in batch mode.")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Cipher to use for PKCS #8 and #12 operations")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("Specify the PKCS #11 provider library")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("display extended usage information and exit")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("extended usage information passed thru pager")); + + /* referenced via certtoolOptions.pOptDesc->pzText */ + puts(_("output version information and exit")); + + /* referenced via certtoolOptions.pzUsageTitle */ + puts(_("certtool - GnuTLS certificate tool\n\ +Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n")); + + /* referenced via certtoolOptions.pzExplain */ + puts(_("\n")); + + /* referenced via certtoolOptions.pzDetail */ + puts(_("Tool to parse and generate X.509 certificates, requests and private keys.\n\ +It can be used interactively or non interactively by specifying the\n\ +template command line option.\n\n")); + puts(_("The tool accepts files or URLs supported by GnuTLS. In case PIN is\n\ +required for the URL access you can provide it using the environment\n\ +variables GNUTLS_PIN and GNUTLS_SO_PIN.\n")); + + /* referenced via certtoolOptions.pzFullVersion */ + puts(_("certtool @VERSION@")); + + /* referenced via certtoolOptions.pzFullUsage */ + puts(_("<<<NOT-FOUND>>>")); + + /* referenced via certtoolOptions.pzShortUsage */ + puts(_("certtool [options]\n\ +certtool --help for usage instructions.\n")); + /* LIBOPTS-MESSAGES: */ +#line 67 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 93 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 53 "../init.c" + puts(_("AutoOpts function called without option descriptor\n")); +#line 86 "../init.c" + puts(_("\tThis exceeds the compiled library version: ")); +#line 84 "../init.c" + puts(_("Automated Options Processing Error!\n" + "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); +#line 80 "../autoopts.c" + puts(_("realloc of %d bytes at 0x%p failed\n")); +#line 88 "../init.c" + puts(_("\tThis is less than the minimum library version: ")); +#line 121 "../version.c" + puts(_("Automated Options version %s\n" + "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); +#line 87 "../makeshell.c" + puts(_("(AutoOpts bug): %s.\n")); +#line 90 "../reset.c" + puts(_("optionResetOpt() called, but reset-option not configured")); +#line 295 "../usage.c" + puts(_("could not locate the 'help' option")); +#line 336 "../autoopts.c" + puts(_("optionProcess() was called with invalid data")); +#line 751 "../usage.c" + puts(_("invalid argument type specified")); +#line 598 "../find.c" + puts(_("defaulted to option with optional arg")); +#line 76 "../alias.c" + puts(_("aliasing option is out of range.")); +#line 235 "../enum.c" + puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); +#line 108 "../find.c" + puts(_(" The following options match:\n")); +#line 293 "../find.c" + puts(_("%s: ambiguous option name: %s (matches %d options)\n")); +#line 161 "../check.c" + puts(_("%s: Command line arguments required\n")); +#line 43 "../alias.c" + puts(_("%d %s%s options allowed\n")); +#line 94 "../makeshell.c" + puts(_("%s error %d (%s) calling %s for '%s'\n")); +#line 306 "../makeshell.c" + puts(_("interprocess pipe")); +#line 168 "../version.c" + puts(_("error: version option argument '%c' invalid. Use:\n" + "\t'v' - version only\n" + "\t'c' - version and copyright\n" + "\t'n' - version and full copyright notice\n")); +#line 58 "../check.c" + puts(_("%s error: the '%s' and '%s' options conflict\n")); +#line 217 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 430 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 38 "../alias.c" + puts(_("-equivalence")); +#line 469 "../find.c" + puts(_("%s: illegal option -- %c\n")); +#line 110 "../reset.c" + puts(_("%s: illegal option -- %c\n")); +#line 271 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 755 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 118 "../reset.c" + puts(_("%s: illegal option -- %s\n")); +#line 335 "../find.c" + puts(_("%s: unknown vendor extension option -- %s\n")); +#line 160 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 170 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 750 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 1084 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 385 "../find.c" + puts(_("%s: invalid option name: %s\n")); +#line 527 "../find.c" + puts(_("%s: The '%s' option requires an argument.\n")); +#line 156 "../autoopts.c" + puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" + "\t'%s' and '%s'.")); +#line 94 "../check.c" + puts(_("%s error: The %s option is required\n")); +#line 632 "../find.c" + puts(_("%s: The '%s' option cannot have an argument.\n")); +#line 151 "../check.c" + puts(_("%s: Command line arguments are not allowed.\n")); +#line 536 "../save.c" + puts(_("error %d (%s) creating %s\n")); +#line 235 "../enum.c" + puts(_("%s error: '%s' does not match any %s keywords.\n")); +#line 93 "../reset.c" + puts(_("%s error: The '%s' option requires an argument.\n")); +#line 186 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 239 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 143 "../restore.c" + puts(_("%s error: no saved option state\n")); +#line 231 "../autoopts.c" + puts(_("'%s' is not a command line option.\n")); +#line 113 "../time.c" + puts(_("%s error: '%s' is not a recognizable date/time.\n")); +#line 131 "../save.c" + puts(_("'%s' not defined\n")); +#line 50 "../time.c" + puts(_("%s error: '%s' is not a recognizable time duration.\n")); +#line 92 "../check.c" + puts(_("%s error: The %s option must appear %d times.\n")); +#line 165 "../numeric.c" + puts(_("%s error: '%s' is not a recognizable number.\n")); +#line 201 "../enum.c" + puts(_("%s error: %s exceeds %s keyword count\n")); +#line 333 "../usage.c" + puts(_("Try '%s %s' for more information.\n")); +#line 45 "../alias.c" + puts(_("one %s%s option allowed\n")); +#line 208 "../makeshell.c" + puts(_("standard output")); +#line 943 "../makeshell.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard output")); +#line 418 "../usage.c" + puts(_("standard output")); +#line 628 "../usage.c" + puts(_("standard output")); +#line 175 "../version.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard error")); +#line 418 "../usage.c" + puts(_("standard error")); +#line 628 "../usage.c" + puts(_("standard error")); +#line 175 "../version.c" + puts(_("standard error")); +#line 208 "../makeshell.c" + puts(_("write")); +#line 943 "../makeshell.c" + puts(_("write")); +#line 276 "../usage.c" + puts(_("write")); +#line 417 "../usage.c" + puts(_("write")); +#line 627 "../usage.c" + puts(_("write")); +#line 174 "../version.c" + puts(_("write")); +#line 60 "../numeric.c" + puts(_("%s error: %s option value %ld is out of range.\n")); +#line 44 "../check.c" + puts(_("%s error: %s option requires the %s option\n")); +#line 130 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 185 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 238 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 257 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 535 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); + /* END-LIBOPTS-MESSAGES */ + + /* USAGE-TEXT: */ +#line 876 "../usage.c" + puts(_("\t\t\t\t- an alternate for '%s'\n")); +#line 1151 "../usage.c" + puts(_("Version, usage and configuration options:")); +#line 927 "../usage.c" + puts(_("\t\t\t\t- default option for unnamed options\n")); +#line 840 "../usage.c" + puts(_("\t\t\t\t- disabled as '--%s'\n")); +#line 1120 "../usage.c" + puts(_(" --- %-14s %s\n")); +#line 1118 "../usage.c" + puts(_("This option has been disabled")); +#line 867 "../usage.c" + puts(_("\t\t\t\t- enabled by default\n")); +#line 40 "../alias.c" + puts(_("%s error: only ")); +#line 1197 "../usage.c" + puts(_(" - examining environment variables named %s_*\n")); +#line 168 "../file.c" + puts(_("\t\t\t\t- file must not pre-exist\n")); +#line 172 "../file.c" + puts(_("\t\t\t\t- file must pre-exist\n")); +#line 383 "../usage.c" + puts(_("Options are specified by doubled hyphens and their name or by a single\n" + "hyphen and the flag character.\n")); +#line 921 "../makeshell.c" + puts(_("\n" + "= = = = = = = =\n\n" + "This incarnation of genshell will produce\n" + "a shell script to parse the options for %s:\n\n")); +#line 167 "../enum.c" + puts(_(" or an integer mask with any of the lower %d bits set\n")); +#line 900 "../usage.c" + puts(_("\t\t\t\t- is a set membership option\n")); +#line 921 "../usage.c" + puts(_("\t\t\t\t- must appear between %d and %d times\n")); +#line 385 "../usage.c" + puts(_("Options are specified by single or double hyphens and their name.\n")); +#line 907 "../usage.c" + puts(_("\t\t\t\t- may appear multiple times\n")); +#line 894 "../usage.c" + puts(_("\t\t\t\t- may not be preset\n")); +#line 1312 "../usage.c" + puts(_(" Arg Option-Name Description\n")); +#line 1248 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1306 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1307 "../usage.c" + puts(_(" %3s %s")); +#line 1313 "../usage.c" + puts(_(" %3s %s")); +#line 390 "../usage.c" + puts(_("The '-#<number>' option may omit the hash char\n")); +#line 386 "../usage.c" + puts(_("All arguments are named options.\n")); +#line 974 "../usage.c" + puts(_(" - reading file %s")); +#line 412 "../usage.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 100 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 129 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 906 "../usage.c" + puts(_("\t\t\t\t- may NOT appear - preset only\n")); +#line 947 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 1195 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 685 "../usage.c" + puts(_("prohibits these options:\n")); +#line 680 "../usage.c" + puts(_("prohibits the option '%s'\n")); +#line 81 "../numeric.c" + puts(_("%s%ld to %ld")); +#line 79 "../numeric.c" + puts(_("%sgreater than or equal to %ld")); +#line 75 "../numeric.c" + puts(_("%s%ld exactly")); +#line 68 "../numeric.c" + puts(_("%sit must lie in one of the ranges:\n")); +#line 68 "../numeric.c" + puts(_("%sit must be in the range:\n")); +#line 88 "../numeric.c" + puts(_(", or\n")); +#line 66 "../numeric.c" + puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); +#line 77 "../numeric.c" + puts(_("%sless than or equal to %ld")); +#line 393 "../usage.c" + puts(_("Operands and options may be intermixed. They will be reordered.\n")); +#line 655 "../usage.c" + puts(_("requires the option '%s'\n")); +#line 658 "../usage.c" + puts(_("requires these options:\n")); +#line 1324 "../usage.c" + puts(_(" Arg Option-Name Req? Description\n")); +#line 1318 "../usage.c" + puts(_(" Flg Arg Option-Name Req? Description\n")); +#line 168 "../enum.c" + puts(_("or you may use a numeric representation. Preceding these with a '!'\n" + "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" + "will set them all. Multiple entries may be passed as an option\n" + "argument list.\n")); +#line 913 "../usage.c" + puts(_("\t\t\t\t- may appear up to %d times\n")); +#line 77 "../enum.c" + puts(_("The valid \"%s\" option keywords are:\n")); +#line 1155 "../usage.c" + puts(_("The next option supports vendor supported extra options:")); +#line 776 "../usage.c" + puts(_("These additional options are:")); + /* END-USAGE-TEXT */ +} +#endif /* uncompilable code */ +#ifdef __cplusplus +} +#endif +/* certtool-args.c ends here */ diff --git a/src/certtool-args.h.bak b/src/certtool-args.h.bak new file mode 100644 index 0000000000..5c5dd8fce6 --- /dev/null +++ b/src/certtool-args.h.bak @@ -0,0 +1,379 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (certtool-args.h) + * + * It has been AutoGen-ed + * From the definitions certtool-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the certtool author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The certtool program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * certtool is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * certtool is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ +/** + * This file contains the programmatic interface to the Automated + * Options generated for the certtool program. + * These macros are documented in the AutoGen info file in the + * "AutoOpts" chapter. Please refer to that doc for usage help. + */ +#ifndef AUTOOPTS_CERTTOOL_ARGS_H_GUARD +#define AUTOOPTS_CERTTOOL_ARGS_H_GUARD 1 +#include "config.h" +#include <autoopts/options.h> + +/** + * Ensure that the library used for compiling this generated header is at + * least as new as the version current when the header template was released + * (not counting patch version increments). Also ensure that the oldest + * tolerable version is at least as old as what was current when the header + * template was released. + */ +#define AO_TEMPLATE_VERSION 167937 +#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ + || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) +# error option template version mismatches autoopts/options.h header + Choke Me. +#endif + +/** + * Enumeration of each option type for certtool + */ +typedef enum { + INDEX_OPT_DEBUG = 0, + INDEX_OPT_VERBOSE = 1, + INDEX_OPT_INFILE = 2, + INDEX_OPT_OUTFILE = 3, + INDEX_OPT_GENERATE_SELF_SIGNED = 4, + INDEX_OPT_GENERATE_CERTIFICATE = 5, + INDEX_OPT_GENERATE_PROXY = 6, + INDEX_OPT_GENERATE_CRL = 7, + INDEX_OPT_UPDATE_CERTIFICATE = 8, + INDEX_OPT_GENERATE_PRIVKEY = 9, + INDEX_OPT_PROVABLE = 10, + INDEX_OPT_VERIFY_PROVABLE_PRIVKEY = 11, + INDEX_OPT_SEED = 12, + INDEX_OPT_GENERATE_REQUEST = 13, + INDEX_OPT_VERIFY_CHAIN = 14, + INDEX_OPT_VERIFY = 15, + INDEX_OPT_VERIFY_CRL = 16, + INDEX_OPT_VERIFY_HOSTNAME = 17, + INDEX_OPT_VERIFY_EMAIL = 18, + INDEX_OPT_VERIFY_PURPOSE = 19, + INDEX_OPT_VERIFY_ALLOW_BROKEN = 20, + INDEX_OPT_GENERATE_DH_PARAMS = 21, + INDEX_OPT_GET_DH_PARAMS = 22, + INDEX_OPT_DH_INFO = 23, + INDEX_OPT_LOAD_PRIVKEY = 24, + INDEX_OPT_LOAD_PUBKEY = 25, + INDEX_OPT_LOAD_REQUEST = 26, + INDEX_OPT_LOAD_CERTIFICATE = 27, + INDEX_OPT_LOAD_CA_PRIVKEY = 28, + INDEX_OPT_LOAD_CA_CERTIFICATE = 29, + INDEX_OPT_LOAD_CRL = 30, + INDEX_OPT_LOAD_DATA = 31, + INDEX_OPT_PASSWORD = 32, + INDEX_OPT_NULL_PASSWORD = 33, + INDEX_OPT_EMPTY_PASSWORD = 34, + INDEX_OPT_HEX_NUMBERS = 35, + INDEX_OPT_CPRINT = 36, + INDEX_OPT_CERTIFICATE_INFO = 37, + INDEX_OPT_FINGERPRINT = 38, + INDEX_OPT_KEY_ID = 39, + INDEX_OPT_CERTIFICATE_PUBKEY = 40, + INDEX_OPT_PGP_CERTIFICATE_INFO = 41, + INDEX_OPT_PGP_RING_INFO = 42, + INDEX_OPT_CRL_INFO = 43, + INDEX_OPT_CRQ_INFO = 44, + INDEX_OPT_NO_CRQ_EXTENSIONS = 45, + INDEX_OPT_P12_INFO = 46, + INDEX_OPT_P12_NAME = 47, + INDEX_OPT_P7_GENERATE = 48, + INDEX_OPT_P7_SIGN = 49, + INDEX_OPT_P7_DETACHED_SIGN = 50, + INDEX_OPT_P7_INCLUDE_CERT = 51, + INDEX_OPT_P7_TIME = 52, + INDEX_OPT_P7_SHOW_DATA = 53, + INDEX_OPT_P7_INFO = 54, + INDEX_OPT_P7_VERIFY = 55, + INDEX_OPT_P8_INFO = 56, + INDEX_OPT_SMIME_TO_P7 = 57, + INDEX_OPT_KEY_INFO = 58, + INDEX_OPT_PGP_KEY_INFO = 59, + INDEX_OPT_PUBKEY_INFO = 60, + INDEX_OPT_V1 = 61, + INDEX_OPT_TO_P12 = 62, + INDEX_OPT_TO_P8 = 63, + INDEX_OPT_PKCS8 = 64, + INDEX_OPT_RSA = 65, + INDEX_OPT_DSA = 66, + INDEX_OPT_ECC = 67, + INDEX_OPT_ECDSA = 68, + INDEX_OPT_HASH = 69, + INDEX_OPT_INDER = 70, + INDEX_OPT_INRAW = 71, + INDEX_OPT_OUTDER = 72, + INDEX_OPT_OUTRAW = 73, + INDEX_OPT_BITS = 74, + INDEX_OPT_CURVE = 75, + INDEX_OPT_SEC_PARAM = 76, + INDEX_OPT_DISABLE_QUICK_RANDOM = 77, + INDEX_OPT_TEMPLATE = 78, + INDEX_OPT_STDOUT_INFO = 79, + INDEX_OPT_ASK_PASS = 80, + INDEX_OPT_PKCS_CIPHER = 81, + INDEX_OPT_PROVIDER = 82, + INDEX_OPT_VERSION = 83, + INDEX_OPT_HELP = 84, + INDEX_OPT_MORE_HELP = 85 +} teOptIndex; +/** count of all options for certtool */ +#define OPTION_CT 86 +/** certtool version */ +#define CERTTOOL_VERSION "@VERSION@" +/** Full certtool version text */ +#define CERTTOOL_FULL_VERSION "certtool @VERSION@" + +/** + * Interface defines for all options. Replace "n" with the UPPER_CASED + * option name (as in the teOptIndex enumeration above). + * e.g. HAVE_OPT(DEBUG) + */ +#define DESC(n) (certtoolOptions.pOptDesc[INDEX_OPT_## n]) +/** 'true' if an option has been specified in any way */ +#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) +/** The string argument to an option. The argument type must be \"string\". */ +#define OPT_ARG(n) (DESC(n).optArg.argString) +/** Mask the option state revealing how an option was specified. + * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET, + * \a OPTST_DEFINED, \a OPTST_RESET or zero. + */ +#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) +/** Count of option's occurrances *on the command line*. */ +#define COUNT_OPT(n) (DESC(n).optOccCt) +/** mask of \a OPTST_SET and \a OPTST_DEFINED. */ +#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) +/** 'true' if \a HAVE_OPT would yield 'false'. */ +#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) +/** 'true' if OPTST_DISABLED bit not set. */ +#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) +/** number of stacked option arguments. + * Valid only for stacked option arguments. */ +#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) +/** stacked argument vector. + * Valid only for stacked option arguments. */ +#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) +/** Reset an option. */ +#define CLEAR_OPT(n) STMTS( \ + DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + DESC(n).fOptState |= OPTST_DISABLED; \ + DESC(n).optCookie = NULL ) +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Enumeration of certtool exit codes + */ +typedef enum { + CERTTOOL_EXIT_SUCCESS = 0, + CERTTOOL_EXIT_FAILURE = 1, + CERTTOOL_EXIT_USAGE_ERROR = 64, + CERTTOOL_EXIT_LIBOPTS_FAILURE = 70 +} certtool_exit_code_t; +/** + * Interface defines for specific options. + * @{ + */ +#define VALUE_OPT_DEBUG 'd' + +#define OPT_VALUE_DEBUG (DESC(DEBUG).optArg.argInt) +#define VALUE_OPT_VERBOSE 'V' +#define VALUE_OPT_INFILE 0x1001 +#define VALUE_OPT_OUTFILE 0x1002 +#define VALUE_OPT_GENERATE_SELF_SIGNED 's' +#define VALUE_OPT_GENERATE_CERTIFICATE 'c' +#define VALUE_OPT_GENERATE_PROXY 0x1003 +#define VALUE_OPT_GENERATE_CRL 0x1004 +#define VALUE_OPT_UPDATE_CERTIFICATE 'u' +#define VALUE_OPT_GENERATE_PRIVKEY 'p' +#define VALUE_OPT_PROVABLE 0x1005 +#define VALUE_OPT_VERIFY_PROVABLE_PRIVKEY 0x1006 +#define VALUE_OPT_SEED 0x1007 +#define VALUE_OPT_GENERATE_REQUEST 'q' +#define VALUE_OPT_VERIFY_CHAIN 'e' +#define VALUE_OPT_VERIFY 0x1008 +#define VALUE_OPT_VERIFY_CRL 0x1009 +#define VALUE_OPT_VERIFY_HOSTNAME 0x100A +#define VALUE_OPT_VERIFY_EMAIL 0x100B +#define VALUE_OPT_VERIFY_PURPOSE 0x100C +#define VALUE_OPT_VERIFY_ALLOW_BROKEN 0x100D +#define VALUE_OPT_GENERATE_DH_PARAMS 0x100E +#define VALUE_OPT_GET_DH_PARAMS 0x100F +#define VALUE_OPT_DH_INFO 0x1010 +#define VALUE_OPT_LOAD_PRIVKEY 0x1011 +#define VALUE_OPT_LOAD_PUBKEY 0x1012 +#define VALUE_OPT_LOAD_REQUEST 0x1013 +#define VALUE_OPT_LOAD_CERTIFICATE 0x1014 +#define VALUE_OPT_LOAD_CA_PRIVKEY 0x1015 +#define VALUE_OPT_LOAD_CA_CERTIFICATE 0x1016 +#define VALUE_OPT_LOAD_CRL 0x1017 +#define VALUE_OPT_LOAD_DATA 0x1018 +#define VALUE_OPT_PASSWORD 0x1019 +#define VALUE_OPT_NULL_PASSWORD 0x101A +#define VALUE_OPT_EMPTY_PASSWORD 0x101B +#define VALUE_OPT_HEX_NUMBERS 0x101C +#define VALUE_OPT_CPRINT 0x101D +#define VALUE_OPT_CERTIFICATE_INFO 'i' +#define VALUE_OPT_FINGERPRINT 0x101E +#define VALUE_OPT_KEY_ID 0x101F +#define VALUE_OPT_CERTIFICATE_PUBKEY 0x1020 +#define VALUE_OPT_PGP_CERTIFICATE_INFO 0x1021 +#define VALUE_OPT_PGP_RING_INFO 0x1022 +#define VALUE_OPT_CRL_INFO 'l' +#define VALUE_OPT_CRQ_INFO 0x1023 +#define VALUE_OPT_NO_CRQ_EXTENSIONS 0x1024 +#define VALUE_OPT_P12_INFO 0x1025 +#define VALUE_OPT_P12_NAME 0x1026 +#define VALUE_OPT_P7_GENERATE 0x1027 +#define VALUE_OPT_P7_SIGN 0x1028 +#define VALUE_OPT_P7_DETACHED_SIGN 0x1029 +#define VALUE_OPT_P7_INCLUDE_CERT 0x102A +#define VALUE_OPT_P7_TIME 0x102B +#define VALUE_OPT_P7_SHOW_DATA 0x102C +#define VALUE_OPT_P7_INFO 0x102D +#define VALUE_OPT_P7_VERIFY 0x102E +#define VALUE_OPT_P8_INFO 0x102F +#define VALUE_OPT_SMIME_TO_P7 0x1030 +#define VALUE_OPT_KEY_INFO 'k' +#define VALUE_OPT_PGP_KEY_INFO 0x1031 +#define VALUE_OPT_PUBKEY_INFO 0x1032 +#define VALUE_OPT_V1 0x1033 +#define VALUE_OPT_TO_P12 0x1034 +#define VALUE_OPT_TO_P8 0x1035 +#define VALUE_OPT_PKCS8 '8' +#define VALUE_OPT_RSA 0x1036 +#define VALUE_OPT_DSA 0x1037 +#define VALUE_OPT_ECC 0x1038 +#define VALUE_OPT_ECDSA 0x1039 +#define VALUE_OPT_HASH 0x103A +#define VALUE_OPT_INDER 0x103B +#define VALUE_OPT_INRAW 0x103C +#define VALUE_OPT_OUTDER 0x103D +#define VALUE_OPT_OUTRAW 0x103E +#define VALUE_OPT_BITS 0x103F + +#define OPT_VALUE_BITS (DESC(BITS).optArg.argInt) +#define VALUE_OPT_CURVE 0x1040 +#define VALUE_OPT_SEC_PARAM 0x1041 +#define VALUE_OPT_DISABLE_QUICK_RANDOM 0x1042 +#define VALUE_OPT_TEMPLATE 0x1043 +#define VALUE_OPT_STDOUT_INFO 0x1044 +#define VALUE_OPT_ASK_PASS 0x1045 +#define VALUE_OPT_PKCS_CIPHER 0x1046 +#define VALUE_OPT_PROVIDER 0x1047 +/** option flag (value) for help-value option */ +#define VALUE_OPT_HELP 'h' +/** option flag (value) for more-help-value option */ +#define VALUE_OPT_MORE_HELP '!' +/** option flag (value) for version-value option */ +#define VALUE_OPT_VERSION 'v' +/* + * Interface defines not associated with particular options + */ +#define ERRSKIP_OPTERR STMTS(certtoolOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(certtoolOptions.fOptSet |= OPTPROC_ERRSTOP) +#define RESTART_OPT(n) STMTS( \ + certtoolOptions.curOptIdx = (n); \ + certtoolOptions.pzCurOpt = NULL ) +#define START_OPT RESTART_OPT(1) +#define USAGE(c) (*certtoolOptions.pUsageProc)(&certtoolOptions, c) + +#ifdef __cplusplus +extern "C" { +#endif +/* + * global exported definitions + */ +#include <gettext.h> + + +/* * * * * * + * + * Declare the certtool option descriptor. + */ +extern tOptions certtoolOptions; + +#if defined(ENABLE_NLS) +# ifndef _ +# include <stdio.h> +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include <libintl.h> +# endif + +# ifndef ATTRIBUTE_FORMAT_ARG +# define ATTRIBUTE_FORMAT_ARG(_a) +# endif + +static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1); +static inline char* aoGetsText(char const* pz) { + if (pz == NULL) return NULL; + return (char*)gettext(pz); +} +# define _(s) aoGetsText(s) +# endif /* _() */ + +# define OPT_NO_XLAT_CFG_NAMES STMTS(certtoolOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT_CFG;) +# define OPT_NO_XLAT_OPT_NAMES STMTS(certtoolOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) + +# define OPT_XLAT_CFG_NAMES STMTS(certtoolOptions.fOptSet &= \ + ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) +# define OPT_XLAT_OPT_NAMES STMTS(certtoolOptions.fOptSet &= \ + ~OPTPROC_NXLAT_OPT;) + +#else /* ENABLE_NLS */ +# define OPT_NO_XLAT_CFG_NAMES +# define OPT_NO_XLAT_OPT_NAMES + +# define OPT_XLAT_CFG_NAMES +# define OPT_XLAT_OPT_NAMES + +# ifndef _ +# define _(_s) _s +# endif +#endif /* ENABLE_NLS */ + +#ifdef __cplusplus +} +#endif +#endif /* AUTOOPTS_CERTTOOL_ARGS_H_GUARD */ + +/* certtool-args.h ends here */ diff --git a/src/cli-args.c.bak b/src/cli-args.c.bak new file mode 100644 index 0000000000..23a1c5733c --- /dev/null +++ b/src/cli-args.c.bak @@ -0,0 +1,2737 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (cli-args.c) + * + * It has been AutoGen-ed + * From the definitions cli-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the gnutls-cli author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The gnutls-cli program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * gnutls-cli is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * gnutls-cli is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "cli-args.h" +#include <sys/types.h> + +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> + +#ifdef __cplusplus +extern "C" { +#endif +extern FILE * option_usage_fp; +#define zCopyright (gnutls_cli_opt_strs+0) +#define zLicenseDescrip (gnutls_cli_opt_strs+291) + + +#ifndef NULL +# define NULL 0 +#endif + +/** + * static const strings for gnutls-cli options + */ +static char const gnutls_cli_opt_strs[4694] = +/* 0 */ "gnutls-cli @VERSION@\n" + "Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n" + "This is free software. It is licensed for use, modification and\n" + "redistribution under the terms of the GNU General Public License,\n" + "version 3 or later <http://gnu.org/licenses/gpl.html>\n\0" +/* 291 */ "gnutls-cli is free software: you can redistribute it and/or modify it under\n" + "the terms of the GNU General Public License as published by the Free\n" + "Software Foundation, either version 3 of the License, or (at your option)\n" + "any later version.\n\n" + "gnutls-cli is distributed in the hope that it will be useful, but WITHOUT\n" + "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n" + "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n" + "more details.\n\n" + "You should have received a copy of the GNU General Public License along\n" + "with this program. If not, see <http://www.gnu.org/licenses/>.\n\0" +/* 900 */ "Enable debugging\0" +/* 917 */ "DEBUG\0" +/* 923 */ "debug\0" +/* 929 */ "More verbose output\0" +/* 949 */ "VERBOSE\0" +/* 957 */ "verbose\0" +/* 965 */ "Enable trust on first use authentication\0" +/* 1006 */ "TOFU\0" +/* 1011 */ "no-tofu\0" +/* 1019 */ "no\0" +/* 1022 */ "Fail to connect if a known certificate has changed\0" +/* 1073 */ "STRICT_TOFU\0" +/* 1085 */ "no-strict-tofu\0" +/* 1100 */ "Enable DANE certificate verification (DNSSEC)\0" +/* 1146 */ "DANE\0" +/* 1151 */ "no-dane\0" +/* 1159 */ "Use the local DNS server for DNSSEC resolving\0" +/* 1205 */ "LOCAL_DNS\0" +/* 1215 */ "no-local-dns\0" +/* 1228 */ "Enable CA certificate verification\0" +/* 1263 */ "CA_VERIFICATION\0" +/* 1279 */ "no-ca-verification\0" +/* 1298 */ "Enable OCSP certificate verification\0" +/* 1335 */ "OCSP\0" +/* 1340 */ "no-ocsp\0" +/* 1348 */ "Establish a session and resume\0" +/* 1379 */ "RESUME\0" +/* 1386 */ "resume\0" +/* 1393 */ "Establish a session and rehandshake\0" +/* 1429 */ "REHANDSHAKE\0" +/* 1441 */ "rehandshake\0" +/* 1453 */ "Connect, establish a plain session and start TLS\0" +/* 1502 */ "STARTTLS\0" +/* 1511 */ "starttls\0" +/* 1520 */ "an alias for the 'starttls-proto' option\0" +/* 1561 */ "app-proto\0" +/* 1571 */ "The application protocol to be used to obtain the server's certificate\n" + "(https, ftp, smtp, imap, ldap, xmpp)\0" +/* 1679 */ "STARTTLS_PROTO\0" +/* 1694 */ "starttls-proto\0" +/* 1709 */ "Use DTLS (datagram TLS) over UDP\0" +/* 1742 */ "UDP\0" +/* 1746 */ "udp\0" +/* 1750 */ "Set MTU for datagram TLS\0" +/* 1775 */ "MTU\0" +/* 1779 */ "mtu\0" +/* 1783 */ "Send CR LF instead of LF\0" +/* 1808 */ "CRLF\0" +/* 1813 */ "crlf\0" +/* 1818 */ "Enable TCP Fast Open\0" +/* 1839 */ "FASTOPEN\0" +/* 1848 */ "fastopen\0" +/* 1857 */ "Use DER format for certificates to read from\0" +/* 1902 */ "X509FMTDER\0" +/* 1913 */ "x509fmtder\0" +/* 1924 */ "Send the openpgp fingerprint, instead of the key\0" +/* 1973 */ "FINGERPRINT\0" +/* 1985 */ "fingerprint\0" +/* 1997 */ "Print peer's certificate in PEM format\0" +/* 2036 */ "PRINT_CERT\0" +/* 2047 */ "print-cert\0" +/* 2058 */ "Save the peer's certificate chain in the specified file in PEM format\0" +/* 2128 */ "SAVE_CERT\0" +/* 2138 */ "save-cert\0" +/* 2148 */ "Save the peer's OCSP status response in the provided file\0" +/* 2206 */ "SAVE_OCSP\0" +/* 2216 */ "save-ocsp\0" +/* 2226 */ "The minimum number of bits allowed for DH\0" +/* 2268 */ "DH_BITS\0" +/* 2276 */ "dh-bits\0" +/* 2284 */ "Priorities string\0" +/* 2302 */ "PRIORITY\0" +/* 2311 */ "priority\0" +/* 2320 */ "Certificate file or PKCS #11 URL to use\0" +/* 2360 */ "X509CAFILE\0" +/* 2371 */ "x509cafile\0" +/* 2382 */ "CRL file to use\0" +/* 2398 */ "X509CRLFILE\0" +/* 2410 */ "x509crlfile\0" +/* 2422 */ "PGP Key file to use\0" +/* 2442 */ "PGPKEYFILE\0" +/* 2453 */ "pgpkeyfile\0" +/* 2464 */ "PGP Key ring file to use\0" +/* 2489 */ "PGPKEYRING\0" +/* 2500 */ "pgpkeyring\0" +/* 2511 */ "PGP Public Key (certificate) file to use\0" +/* 2552 */ "PGPCERTFILE\0" +/* 2564 */ "pgpcertfile\0" +/* 2576 */ "X.509 key file or PKCS #11 URL to use\0" +/* 2614 */ "X509KEYFILE\0" +/* 2626 */ "x509keyfile\0" +/* 2638 */ "X.509 Certificate file or PKCS #11 URL to use\0" +/* 2684 */ "X509CERTFILE\0" +/* 2697 */ "x509certfile\0" +/* 2710 */ "PGP subkey to use (hex or auto)\0" +/* 2742 */ "PGPSUBKEY\0" +/* 2752 */ "pgpsubkey\0" +/* 2762 */ "SRP username to use\0" +/* 2782 */ "SRPUSERNAME\0" +/* 2794 */ "srpusername\0" +/* 2806 */ "SRP password to use\0" +/* 2826 */ "SRPPASSWD\0" +/* 2836 */ "srppasswd\0" +/* 2846 */ "PSK username to use\0" +/* 2866 */ "PSKUSERNAME\0" +/* 2878 */ "pskusername\0" +/* 2890 */ "PSK key (in hex) to use\0" +/* 2914 */ "PSKKEY\0" +/* 2921 */ "pskkey\0" +/* 2928 */ "The port or service to connect to\0" +/* 2962 */ "PORT\0" +/* 2967 */ "port\0" +/* 2972 */ "Don't abort program if server certificate can't be validated\0" +/* 3033 */ "INSECURE\0" +/* 3042 */ "insecure\0" +/* 3051 */ "Use length-hiding padding to prevent traffic analysis\0" +/* 3105 */ "RANGES\0" +/* 3112 */ "ranges\0" +/* 3119 */ "Benchmark individual ciphers\0" +/* 3148 */ "BENCHMARK_CIPHERS\0" +/* 3166 */ "benchmark-ciphers\0" +/* 3184 */ "Benchmark TLS key exchange methods\0" +/* 3219 */ "BENCHMARK_TLS_KX\0" +/* 3236 */ "benchmark-tls-kx\0" +/* 3253 */ "Benchmark TLS ciphers\0" +/* 3275 */ "BENCHMARK_TLS_CIPHERS\0" +/* 3297 */ "benchmark-tls-ciphers\0" +/* 3319 */ "Print a list of the supported algorithms and modes\0" +/* 3370 */ "LIST\0" +/* 3375 */ "list\0" +/* 3380 */ "Print a list of the supported priority strings\0" +/* 3427 */ "PRIORITY_LIST\0" +/* 3441 */ "priority-list\0" +/* 3455 */ "Don't allow session tickets\0" +/* 3483 */ "NOTICKET\0" +/* 3492 */ "noticket\0" +/* 3501 */ "Offer SRTP profiles\0" +/* 3521 */ "SRTP_PROFILES\0" +/* 3535 */ "srtp-profiles\0" +/* 3549 */ "Application layer protocol\0" +/* 3576 */ "ALPN\0" +/* 3581 */ "alpn\0" +/* 3586 */ "Activate heartbeat support\0" +/* 3613 */ "HEARTBEAT\0" +/* 3623 */ "heartbeat\0" +/* 3633 */ "The maximum record size to advertize\0" +/* 3670 */ "RECORDSIZE\0" +/* 3681 */ "recordsize\0" +/* 3692 */ "Do not send a Server Name Indication (SNI)\0" +/* 3735 */ "DISABLE_SNI\0" +/* 3747 */ "disable-sni\0" +/* 3759 */ "Disable all the TLS extensions\0" +/* 3790 */ "DISABLE_EXTENSIONS\0" +/* 3809 */ "disable-extensions\0" +/* 3828 */ "Inline commands of the form ^<cmd>^\0" +/* 3864 */ "INLINE_COMMANDS\0" +/* 3880 */ "inline-commands\0" +/* 3896 */ "Change the default delimiter for inline commands.\0" +/* 3946 */ "INLINE_COMMANDS_PREFIX\0" +/* 3969 */ "inline-commands-prefix\0" +/* 3992 */ "Specify the PKCS #11 provider library\0" +/* 4030 */ "PROVIDER\0" +/* 4039 */ "provider\0" +/* 4048 */ "Reports the status of the FIPS140-2 mode in gnutls library\0" +/* 4107 */ "FIPS140_MODE\0" +/* 4120 */ "fips140-mode\0" +/* 4133 */ "display extended usage information and exit\0" +/* 4177 */ "help\0" +/* 4182 */ "extended usage information passed thru pager\0" +/* 4227 */ "more-help\0" +/* 4237 */ "output version information and exit\0" +/* 4273 */ "version\0" +/* 4281 */ "GNUTLS_CLI\0" +/* 4292 */ "gnutls-cli - GnuTLS client\n" + "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [hostname]\n\0" +/* 4388 */ "@PACKAGE_BUGREPORT@\0" +/* 4408 */ "\n\0" +/* 4410 */ "Simple client program to set up a TLS connection to some other computer. It\n" + "sets up a TLS connection and forwards data from the standard input to the\n" + "secured socket and vice versa.\n\0" +/* 4593 */ "gnutls-cli @VERSION@\0" +/* 4614 */ "Usage: gnutls-cli [options] hostname\n" + "gnutls-cli --help for usage instructions.\n"; + +/** + * debug option description: + */ +/** Descriptive text for the debug option */ +#define DEBUG_DESC (gnutls_cli_opt_strs+900) +/** Upper-cased name for the debug option */ +#define DEBUG_NAME (gnutls_cli_opt_strs+917) +/** Name string for the debug option */ +#define DEBUG_name (gnutls_cli_opt_strs+923) +/** Compiled in flag settings for the debug option */ +#define DEBUG_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * verbose option description: + */ +/** Descriptive text for the verbose option */ +#define VERBOSE_DESC (gnutls_cli_opt_strs+929) +/** Upper-cased name for the verbose option */ +#define VERBOSE_NAME (gnutls_cli_opt_strs+949) +/** Name string for the verbose option */ +#define VERBOSE_name (gnutls_cli_opt_strs+957) +/** Compiled in flag settings for the verbose option */ +#define VERBOSE_FLAGS (OPTST_DISABLED) + +/** + * tofu option description: + */ +/** Descriptive text for the tofu option */ +#define TOFU_DESC (gnutls_cli_opt_strs+965) +/** Upper-cased name for the tofu option */ +#define TOFU_NAME (gnutls_cli_opt_strs+1006) +/** disablement name for the tofu option */ +#define NOT_TOFU_name (gnutls_cli_opt_strs+1011) +/** disablement prefix for the tofu option */ +#define NOT_TOFU_PFX (gnutls_cli_opt_strs+1019) +/** Name string for the tofu option */ +#define TOFU_name (NOT_TOFU_name + 3) +/** Compiled in flag settings for the tofu option */ +#define TOFU_FLAGS (OPTST_DISABLED) + +/** + * strict-tofu option description: + */ +/** Descriptive text for the strict-tofu option */ +#define STRICT_TOFU_DESC (gnutls_cli_opt_strs+1022) +/** Upper-cased name for the strict-tofu option */ +#define STRICT_TOFU_NAME (gnutls_cli_opt_strs+1073) +/** disablement name for the strict-tofu option */ +#define NOT_STRICT_TOFU_name (gnutls_cli_opt_strs+1085) +/** disablement prefix for the strict-tofu option */ +#define NOT_STRICT_TOFU_PFX (gnutls_cli_opt_strs+1019) +/** Name string for the strict-tofu option */ +#define STRICT_TOFU_name (NOT_STRICT_TOFU_name + 3) +/** Compiled in flag settings for the strict-tofu option */ +#define STRICT_TOFU_FLAGS (OPTST_DISABLED) + +/** + * dane option description: + */ +/** Descriptive text for the dane option */ +#define DANE_DESC (gnutls_cli_opt_strs+1100) +/** Upper-cased name for the dane option */ +#define DANE_NAME (gnutls_cli_opt_strs+1146) +/** disablement name for the dane option */ +#define NOT_DANE_name (gnutls_cli_opt_strs+1151) +/** disablement prefix for the dane option */ +#define NOT_DANE_PFX (gnutls_cli_opt_strs+1019) +/** Name string for the dane option */ +#define DANE_name (NOT_DANE_name + 3) +/** Compiled in flag settings for the dane option */ +#define DANE_FLAGS (OPTST_DISABLED) + +/** + * local-dns option description: + */ +/** Descriptive text for the local-dns option */ +#define LOCAL_DNS_DESC (gnutls_cli_opt_strs+1159) +/** Upper-cased name for the local-dns option */ +#define LOCAL_DNS_NAME (gnutls_cli_opt_strs+1205) +/** disablement name for the local-dns option */ +#define NOT_LOCAL_DNS_name (gnutls_cli_opt_strs+1215) +/** disablement prefix for the local-dns option */ +#define NOT_LOCAL_DNS_PFX (gnutls_cli_opt_strs+1019) +/** Name string for the local-dns option */ +#define LOCAL_DNS_name (NOT_LOCAL_DNS_name + 3) +/** Compiled in flag settings for the local-dns option */ +#define LOCAL_DNS_FLAGS (OPTST_DISABLED) + +/** + * ca-verification option description: + */ +/** Descriptive text for the ca-verification option */ +#define CA_VERIFICATION_DESC (gnutls_cli_opt_strs+1228) +/** Upper-cased name for the ca-verification option */ +#define CA_VERIFICATION_NAME (gnutls_cli_opt_strs+1263) +/** disablement name for the ca-verification option */ +#define NOT_CA_VERIFICATION_name (gnutls_cli_opt_strs+1279) +/** disablement prefix for the ca-verification option */ +#define NOT_CA_VERIFICATION_PFX (gnutls_cli_opt_strs+1019) +/** Name string for the ca-verification option */ +#define CA_VERIFICATION_name (NOT_CA_VERIFICATION_name + 3) +/** Compiled in flag settings for the ca-verification option */ +#define CA_VERIFICATION_FLAGS (OPTST_INITENABLED) + +/** + * ocsp option description: + */ +/** Descriptive text for the ocsp option */ +#define OCSP_DESC (gnutls_cli_opt_strs+1298) +/** Upper-cased name for the ocsp option */ +#define OCSP_NAME (gnutls_cli_opt_strs+1335) +/** disablement name for the ocsp option */ +#define NOT_OCSP_name (gnutls_cli_opt_strs+1340) +/** disablement prefix for the ocsp option */ +#define NOT_OCSP_PFX (gnutls_cli_opt_strs+1019) +/** Name string for the ocsp option */ +#define OCSP_name (NOT_OCSP_name + 3) +/** Compiled in flag settings for the ocsp option */ +#define OCSP_FLAGS (OPTST_DISABLED) + +/** + * resume option description: + */ +/** Descriptive text for the resume option */ +#define RESUME_DESC (gnutls_cli_opt_strs+1348) +/** Upper-cased name for the resume option */ +#define RESUME_NAME (gnutls_cli_opt_strs+1379) +/** Name string for the resume option */ +#define RESUME_name (gnutls_cli_opt_strs+1386) +/** Compiled in flag settings for the resume option */ +#define RESUME_FLAGS (OPTST_DISABLED) + +/** + * rehandshake option description: + */ +/** Descriptive text for the rehandshake option */ +#define REHANDSHAKE_DESC (gnutls_cli_opt_strs+1393) +/** Upper-cased name for the rehandshake option */ +#define REHANDSHAKE_NAME (gnutls_cli_opt_strs+1429) +/** Name string for the rehandshake option */ +#define REHANDSHAKE_name (gnutls_cli_opt_strs+1441) +/** Compiled in flag settings for the rehandshake option */ +#define REHANDSHAKE_FLAGS (OPTST_DISABLED) + +/** + * starttls option description: + */ +/** Descriptive text for the starttls option */ +#define STARTTLS_DESC (gnutls_cli_opt_strs+1453) +/** Upper-cased name for the starttls option */ +#define STARTTLS_NAME (gnutls_cli_opt_strs+1502) +/** Name string for the starttls option */ +#define STARTTLS_name (gnutls_cli_opt_strs+1511) +/** Compiled in flag settings for the starttls option */ +#define STARTTLS_FLAGS (OPTST_DISABLED) + +/** + * app-proto option description: + */ +/** Descriptive text for the app-proto option */ +#define APP_PROTO_DESC (gnutls_cli_opt_strs+1520) +#define APP_PROTO_NAME NULL +/** Unmodified name string for the app-proto option */ +#define APP_PROTO_name (gnutls_cli_opt_strs+1561) +/** Compiled in flag settings for the app-proto option */ +#define APP_PROTO_FLAGS (STARTTLS_PROTO_FLAGS | OPTST_ALIAS) + +/** + * starttls-proto option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the starttls-proto option */ +#define STARTTLS_PROTO_DESC (gnutls_cli_opt_strs+1571) +/** Upper-cased name for the starttls-proto option */ +#define STARTTLS_PROTO_NAME (gnutls_cli_opt_strs+1679) +/** Name string for the starttls-proto option */ +#define STARTTLS_PROTO_name (gnutls_cli_opt_strs+1694) +/** Other options that appear in conjunction with the starttls-proto option */ +static int const aStarttls_ProtoCantList[] = { + INDEX_OPT_STARTTLS, NO_EQUIVALENT }; +/** Compiled in flag settings for the starttls-proto option */ +#define STARTTLS_PROTO_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * udp option description: + */ +/** Descriptive text for the udp option */ +#define UDP_DESC (gnutls_cli_opt_strs+1709) +/** Upper-cased name for the udp option */ +#define UDP_NAME (gnutls_cli_opt_strs+1742) +/** Name string for the udp option */ +#define UDP_name (gnutls_cli_opt_strs+1746) +/** Compiled in flag settings for the udp option */ +#define UDP_FLAGS (OPTST_DISABLED) + +/** + * mtu option description: + */ +/** Descriptive text for the mtu option */ +#define MTU_DESC (gnutls_cli_opt_strs+1750) +/** Upper-cased name for the mtu option */ +#define MTU_NAME (gnutls_cli_opt_strs+1775) +/** Name string for the mtu option */ +#define MTU_name (gnutls_cli_opt_strs+1779) +/** Compiled in flag settings for the mtu option */ +#define MTU_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * crlf option description: + */ +/** Descriptive text for the crlf option */ +#define CRLF_DESC (gnutls_cli_opt_strs+1783) +/** Upper-cased name for the crlf option */ +#define CRLF_NAME (gnutls_cli_opt_strs+1808) +/** Name string for the crlf option */ +#define CRLF_name (gnutls_cli_opt_strs+1813) +/** Compiled in flag settings for the crlf option */ +#define CRLF_FLAGS (OPTST_DISABLED) + +/** + * fastopen option description: + */ +/** Descriptive text for the fastopen option */ +#define FASTOPEN_DESC (gnutls_cli_opt_strs+1818) +/** Upper-cased name for the fastopen option */ +#define FASTOPEN_NAME (gnutls_cli_opt_strs+1839) +/** Name string for the fastopen option */ +#define FASTOPEN_name (gnutls_cli_opt_strs+1848) +/** Compiled in flag settings for the fastopen option */ +#define FASTOPEN_FLAGS (OPTST_DISABLED) + +/** + * x509fmtder option description: + */ +/** Descriptive text for the x509fmtder option */ +#define X509FMTDER_DESC (gnutls_cli_opt_strs+1857) +/** Upper-cased name for the x509fmtder option */ +#define X509FMTDER_NAME (gnutls_cli_opt_strs+1902) +/** Name string for the x509fmtder option */ +#define X509FMTDER_name (gnutls_cli_opt_strs+1913) +/** Compiled in flag settings for the x509fmtder option */ +#define X509FMTDER_FLAGS (OPTST_DISABLED) + +/** + * fingerprint option description: + */ +/** Descriptive text for the fingerprint option */ +#define FINGERPRINT_DESC (gnutls_cli_opt_strs+1924) +/** Upper-cased name for the fingerprint option */ +#define FINGERPRINT_NAME (gnutls_cli_opt_strs+1973) +/** Name string for the fingerprint option */ +#define FINGERPRINT_name (gnutls_cli_opt_strs+1985) +/** Compiled in flag settings for the fingerprint option */ +#define FINGERPRINT_FLAGS (OPTST_DISABLED) + +/** + * print-cert option description: + */ +/** Descriptive text for the print-cert option */ +#define PRINT_CERT_DESC (gnutls_cli_opt_strs+1997) +/** Upper-cased name for the print-cert option */ +#define PRINT_CERT_NAME (gnutls_cli_opt_strs+2036) +/** Name string for the print-cert option */ +#define PRINT_CERT_name (gnutls_cli_opt_strs+2047) +/** Compiled in flag settings for the print-cert option */ +#define PRINT_CERT_FLAGS (OPTST_DISABLED) + +/** + * save-cert option description: + */ +/** Descriptive text for the save-cert option */ +#define SAVE_CERT_DESC (gnutls_cli_opt_strs+2058) +/** Upper-cased name for the save-cert option */ +#define SAVE_CERT_NAME (gnutls_cli_opt_strs+2128) +/** Name string for the save-cert option */ +#define SAVE_CERT_name (gnutls_cli_opt_strs+2138) +/** Compiled in flag settings for the save-cert option */ +#define SAVE_CERT_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * save-ocsp option description: + */ +/** Descriptive text for the save-ocsp option */ +#define SAVE_OCSP_DESC (gnutls_cli_opt_strs+2148) +/** Upper-cased name for the save-ocsp option */ +#define SAVE_OCSP_NAME (gnutls_cli_opt_strs+2206) +/** Name string for the save-ocsp option */ +#define SAVE_OCSP_name (gnutls_cli_opt_strs+2216) +/** Compiled in flag settings for the save-ocsp option */ +#define SAVE_OCSP_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * dh-bits option description: + */ +/** Descriptive text for the dh-bits option */ +#define DH_BITS_DESC (gnutls_cli_opt_strs+2226) +/** Upper-cased name for the dh-bits option */ +#define DH_BITS_NAME (gnutls_cli_opt_strs+2268) +/** Name string for the dh-bits option */ +#define DH_BITS_name (gnutls_cli_opt_strs+2276) +/** Compiled in flag settings for the dh-bits option */ +#define DH_BITS_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * priority option description: + */ +/** Descriptive text for the priority option */ +#define PRIORITY_DESC (gnutls_cli_opt_strs+2284) +/** Upper-cased name for the priority option */ +#define PRIORITY_NAME (gnutls_cli_opt_strs+2302) +/** Name string for the priority option */ +#define PRIORITY_name (gnutls_cli_opt_strs+2311) +/** Compiled in flag settings for the priority option */ +#define PRIORITY_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * x509cafile option description: + */ +/** Descriptive text for the x509cafile option */ +#define X509CAFILE_DESC (gnutls_cli_opt_strs+2320) +/** Upper-cased name for the x509cafile option */ +#define X509CAFILE_NAME (gnutls_cli_opt_strs+2360) +/** Name string for the x509cafile option */ +#define X509CAFILE_name (gnutls_cli_opt_strs+2371) +/** Compiled in flag settings for the x509cafile option */ +#define X509CAFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * x509crlfile option description: + */ +/** Descriptive text for the x509crlfile option */ +#define X509CRLFILE_DESC (gnutls_cli_opt_strs+2382) +/** Upper-cased name for the x509crlfile option */ +#define X509CRLFILE_NAME (gnutls_cli_opt_strs+2398) +/** Name string for the x509crlfile option */ +#define X509CRLFILE_name (gnutls_cli_opt_strs+2410) +/** Compiled in flag settings for the x509crlfile option */ +#define X509CRLFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * pgpkeyfile option description: + */ +/** Descriptive text for the pgpkeyfile option */ +#define PGPKEYFILE_DESC (gnutls_cli_opt_strs+2422) +/** Upper-cased name for the pgpkeyfile option */ +#define PGPKEYFILE_NAME (gnutls_cli_opt_strs+2442) +/** Name string for the pgpkeyfile option */ +#define PGPKEYFILE_name (gnutls_cli_opt_strs+2453) +/** Compiled in flag settings for the pgpkeyfile option */ +#define PGPKEYFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * pgpkeyring option description: + */ +/** Descriptive text for the pgpkeyring option */ +#define PGPKEYRING_DESC (gnutls_cli_opt_strs+2464) +/** Upper-cased name for the pgpkeyring option */ +#define PGPKEYRING_NAME (gnutls_cli_opt_strs+2489) +/** Name string for the pgpkeyring option */ +#define PGPKEYRING_name (gnutls_cli_opt_strs+2500) +/** Compiled in flag settings for the pgpkeyring option */ +#define PGPKEYRING_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * pgpcertfile option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the pgpcertfile option */ +#define PGPCERTFILE_DESC (gnutls_cli_opt_strs+2511) +/** Upper-cased name for the pgpcertfile option */ +#define PGPCERTFILE_NAME (gnutls_cli_opt_strs+2552) +/** Name string for the pgpcertfile option */ +#define PGPCERTFILE_name (gnutls_cli_opt_strs+2564) +/** Other options that are required by the pgpcertfile option */ +static int const aPgpcertfileMustList[] = { + INDEX_OPT_PGPKEYFILE, NO_EQUIVALENT }; +/** Compiled in flag settings for the pgpcertfile option */ +#define PGPCERTFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * x509keyfile option description: + */ +/** Descriptive text for the x509keyfile option */ +#define X509KEYFILE_DESC (gnutls_cli_opt_strs+2576) +/** Upper-cased name for the x509keyfile option */ +#define X509KEYFILE_NAME (gnutls_cli_opt_strs+2614) +/** Name string for the x509keyfile option */ +#define X509KEYFILE_name (gnutls_cli_opt_strs+2626) +/** Compiled in flag settings for the x509keyfile option */ +#define X509KEYFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * x509certfile option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the x509certfile option */ +#define X509CERTFILE_DESC (gnutls_cli_opt_strs+2638) +/** Upper-cased name for the x509certfile option */ +#define X509CERTFILE_NAME (gnutls_cli_opt_strs+2684) +/** Name string for the x509certfile option */ +#define X509CERTFILE_name (gnutls_cli_opt_strs+2697) +/** Other options that are required by the x509certfile option */ +static int const aX509certfileMustList[] = { + INDEX_OPT_X509KEYFILE, NO_EQUIVALENT }; +/** Compiled in flag settings for the x509certfile option */ +#define X509CERTFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * pgpsubkey option description: + */ +/** Descriptive text for the pgpsubkey option */ +#define PGPSUBKEY_DESC (gnutls_cli_opt_strs+2710) +/** Upper-cased name for the pgpsubkey option */ +#define PGPSUBKEY_NAME (gnutls_cli_opt_strs+2742) +/** Name string for the pgpsubkey option */ +#define PGPSUBKEY_name (gnutls_cli_opt_strs+2752) +/** Compiled in flag settings for the pgpsubkey option */ +#define PGPSUBKEY_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * srpusername option description: + */ +/** Descriptive text for the srpusername option */ +#define SRPUSERNAME_DESC (gnutls_cli_opt_strs+2762) +/** Upper-cased name for the srpusername option */ +#define SRPUSERNAME_NAME (gnutls_cli_opt_strs+2782) +/** Name string for the srpusername option */ +#define SRPUSERNAME_name (gnutls_cli_opt_strs+2794) +/** Compiled in flag settings for the srpusername option */ +#define SRPUSERNAME_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * srppasswd option description: + */ +/** Descriptive text for the srppasswd option */ +#define SRPPASSWD_DESC (gnutls_cli_opt_strs+2806) +/** Upper-cased name for the srppasswd option */ +#define SRPPASSWD_NAME (gnutls_cli_opt_strs+2826) +/** Name string for the srppasswd option */ +#define SRPPASSWD_name (gnutls_cli_opt_strs+2836) +/** Compiled in flag settings for the srppasswd option */ +#define SRPPASSWD_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * pskusername option description: + */ +/** Descriptive text for the pskusername option */ +#define PSKUSERNAME_DESC (gnutls_cli_opt_strs+2846) +/** Upper-cased name for the pskusername option */ +#define PSKUSERNAME_NAME (gnutls_cli_opt_strs+2866) +/** Name string for the pskusername option */ +#define PSKUSERNAME_name (gnutls_cli_opt_strs+2878) +/** Compiled in flag settings for the pskusername option */ +#define PSKUSERNAME_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * pskkey option description: + */ +/** Descriptive text for the pskkey option */ +#define PSKKEY_DESC (gnutls_cli_opt_strs+2890) +/** Upper-cased name for the pskkey option */ +#define PSKKEY_NAME (gnutls_cli_opt_strs+2914) +/** Name string for the pskkey option */ +#define PSKKEY_name (gnutls_cli_opt_strs+2921) +/** Compiled in flag settings for the pskkey option */ +#define PSKKEY_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * port option description: + */ +/** Descriptive text for the port option */ +#define PORT_DESC (gnutls_cli_opt_strs+2928) +/** Upper-cased name for the port option */ +#define PORT_NAME (gnutls_cli_opt_strs+2962) +/** Name string for the port option */ +#define PORT_name (gnutls_cli_opt_strs+2967) +/** Compiled in flag settings for the port option */ +#define PORT_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * insecure option description: + */ +/** Descriptive text for the insecure option */ +#define INSECURE_DESC (gnutls_cli_opt_strs+2972) +/** Upper-cased name for the insecure option */ +#define INSECURE_NAME (gnutls_cli_opt_strs+3033) +/** Name string for the insecure option */ +#define INSECURE_name (gnutls_cli_opt_strs+3042) +/** Compiled in flag settings for the insecure option */ +#define INSECURE_FLAGS (OPTST_DISABLED) + +/** + * ranges option description: + */ +/** Descriptive text for the ranges option */ +#define RANGES_DESC (gnutls_cli_opt_strs+3051) +/** Upper-cased name for the ranges option */ +#define RANGES_NAME (gnutls_cli_opt_strs+3105) +/** Name string for the ranges option */ +#define RANGES_name (gnutls_cli_opt_strs+3112) +/** Compiled in flag settings for the ranges option */ +#define RANGES_FLAGS (OPTST_DISABLED) + +/** + * benchmark-ciphers option description: + */ +/** Descriptive text for the benchmark-ciphers option */ +#define BENCHMARK_CIPHERS_DESC (gnutls_cli_opt_strs+3119) +/** Upper-cased name for the benchmark-ciphers option */ +#define BENCHMARK_CIPHERS_NAME (gnutls_cli_opt_strs+3148) +/** Name string for the benchmark-ciphers option */ +#define BENCHMARK_CIPHERS_name (gnutls_cli_opt_strs+3166) +/** Compiled in flag settings for the benchmark-ciphers option */ +#define BENCHMARK_CIPHERS_FLAGS (OPTST_DISABLED) + +/** + * benchmark-tls-kx option description: + */ +/** Descriptive text for the benchmark-tls-kx option */ +#define BENCHMARK_TLS_KX_DESC (gnutls_cli_opt_strs+3184) +/** Upper-cased name for the benchmark-tls-kx option */ +#define BENCHMARK_TLS_KX_NAME (gnutls_cli_opt_strs+3219) +/** Name string for the benchmark-tls-kx option */ +#define BENCHMARK_TLS_KX_name (gnutls_cli_opt_strs+3236) +/** Compiled in flag settings for the benchmark-tls-kx option */ +#define BENCHMARK_TLS_KX_FLAGS (OPTST_DISABLED) + +/** + * benchmark-tls-ciphers option description: + */ +/** Descriptive text for the benchmark-tls-ciphers option */ +#define BENCHMARK_TLS_CIPHERS_DESC (gnutls_cli_opt_strs+3253) +/** Upper-cased name for the benchmark-tls-ciphers option */ +#define BENCHMARK_TLS_CIPHERS_NAME (gnutls_cli_opt_strs+3275) +/** Name string for the benchmark-tls-ciphers option */ +#define BENCHMARK_TLS_CIPHERS_name (gnutls_cli_opt_strs+3297) +/** Compiled in flag settings for the benchmark-tls-ciphers option */ +#define BENCHMARK_TLS_CIPHERS_FLAGS (OPTST_DISABLED) + +/** + * list option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the list option */ +#define LIST_DESC (gnutls_cli_opt_strs+3319) +/** Upper-cased name for the list option */ +#define LIST_NAME (gnutls_cli_opt_strs+3370) +/** Name string for the list option */ +#define LIST_name (gnutls_cli_opt_strs+3375) +/** Other options that appear in conjunction with the list option */ +static int const aListCantList[] = { + INDEX_OPT_PORT, NO_EQUIVALENT }; +/** Compiled in flag settings for the list option */ +#define LIST_FLAGS (OPTST_DISABLED) + +/** + * priority-list option description: + */ +/** Descriptive text for the priority-list option */ +#define PRIORITY_LIST_DESC (gnutls_cli_opt_strs+3380) +/** Upper-cased name for the priority-list option */ +#define PRIORITY_LIST_NAME (gnutls_cli_opt_strs+3427) +/** Name string for the priority-list option */ +#define PRIORITY_LIST_name (gnutls_cli_opt_strs+3441) +/** Compiled in flag settings for the priority-list option */ +#define PRIORITY_LIST_FLAGS (OPTST_DISABLED) + +/** + * noticket option description: + */ +/** Descriptive text for the noticket option */ +#define NOTICKET_DESC (gnutls_cli_opt_strs+3455) +/** Upper-cased name for the noticket option */ +#define NOTICKET_NAME (gnutls_cli_opt_strs+3483) +/** Name string for the noticket option */ +#define NOTICKET_name (gnutls_cli_opt_strs+3492) +/** Compiled in flag settings for the noticket option */ +#define NOTICKET_FLAGS (OPTST_DISABLED) + +/** + * srtp_profiles option description: + */ +/** Descriptive text for the srtp_profiles option */ +#define SRTP_PROFILES_DESC (gnutls_cli_opt_strs+3501) +/** Upper-cased name for the srtp_profiles option */ +#define SRTP_PROFILES_NAME (gnutls_cli_opt_strs+3521) +/** Name string for the srtp_profiles option */ +#define SRTP_PROFILES_name (gnutls_cli_opt_strs+3535) +/** Compiled in flag settings for the srtp_profiles option */ +#define SRTP_PROFILES_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * alpn option description: + */ +/** Descriptive text for the alpn option */ +#define ALPN_DESC (gnutls_cli_opt_strs+3549) +/** Upper-cased name for the alpn option */ +#define ALPN_NAME (gnutls_cli_opt_strs+3576) +/** Name string for the alpn option */ +#define ALPN_name (gnutls_cli_opt_strs+3581) +/** Compiled in flag settings for the alpn option */ +#define ALPN_FLAGS (OPTST_DISABLED | OPTST_STACKED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * heartbeat option description: + */ +/** Descriptive text for the heartbeat option */ +#define HEARTBEAT_DESC (gnutls_cli_opt_strs+3586) +/** Upper-cased name for the heartbeat option */ +#define HEARTBEAT_NAME (gnutls_cli_opt_strs+3613) +/** Name string for the heartbeat option */ +#define HEARTBEAT_name (gnutls_cli_opt_strs+3623) +/** Compiled in flag settings for the heartbeat option */ +#define HEARTBEAT_FLAGS (OPTST_DISABLED) + +/** + * recordsize option description: + */ +/** Descriptive text for the recordsize option */ +#define RECORDSIZE_DESC (gnutls_cli_opt_strs+3633) +/** Upper-cased name for the recordsize option */ +#define RECORDSIZE_NAME (gnutls_cli_opt_strs+3670) +/** Name string for the recordsize option */ +#define RECORDSIZE_name (gnutls_cli_opt_strs+3681) +/** Compiled in flag settings for the recordsize option */ +#define RECORDSIZE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * disable-sni option description: + */ +/** Descriptive text for the disable-sni option */ +#define DISABLE_SNI_DESC (gnutls_cli_opt_strs+3692) +/** Upper-cased name for the disable-sni option */ +#define DISABLE_SNI_NAME (gnutls_cli_opt_strs+3735) +/** Name string for the disable-sni option */ +#define DISABLE_SNI_name (gnutls_cli_opt_strs+3747) +/** Compiled in flag settings for the disable-sni option */ +#define DISABLE_SNI_FLAGS (OPTST_DISABLED) + +/** + * disable-extensions option description: + */ +/** Descriptive text for the disable-extensions option */ +#define DISABLE_EXTENSIONS_DESC (gnutls_cli_opt_strs+3759) +/** Upper-cased name for the disable-extensions option */ +#define DISABLE_EXTENSIONS_NAME (gnutls_cli_opt_strs+3790) +/** Name string for the disable-extensions option */ +#define DISABLE_EXTENSIONS_name (gnutls_cli_opt_strs+3809) +/** Compiled in flag settings for the disable-extensions option */ +#define DISABLE_EXTENSIONS_FLAGS (OPTST_DISABLED) + +/** + * inline-commands option description: + */ +/** Descriptive text for the inline-commands option */ +#define INLINE_COMMANDS_DESC (gnutls_cli_opt_strs+3828) +/** Upper-cased name for the inline-commands option */ +#define INLINE_COMMANDS_NAME (gnutls_cli_opt_strs+3864) +/** Name string for the inline-commands option */ +#define INLINE_COMMANDS_name (gnutls_cli_opt_strs+3880) +/** Compiled in flag settings for the inline-commands option */ +#define INLINE_COMMANDS_FLAGS (OPTST_DISABLED) + +/** + * inline-commands-prefix option description: + */ +/** Descriptive text for the inline-commands-prefix option */ +#define INLINE_COMMANDS_PREFIX_DESC (gnutls_cli_opt_strs+3896) +/** Upper-cased name for the inline-commands-prefix option */ +#define INLINE_COMMANDS_PREFIX_NAME (gnutls_cli_opt_strs+3946) +/** Name string for the inline-commands-prefix option */ +#define INLINE_COMMANDS_PREFIX_name (gnutls_cli_opt_strs+3969) +/** Compiled in flag settings for the inline-commands-prefix option */ +#define INLINE_COMMANDS_PREFIX_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * provider option description: + */ +/** Descriptive text for the provider option */ +#define PROVIDER_DESC (gnutls_cli_opt_strs+3992) +/** Upper-cased name for the provider option */ +#define PROVIDER_NAME (gnutls_cli_opt_strs+4030) +/** Name string for the provider option */ +#define PROVIDER_name (gnutls_cli_opt_strs+4039) +/** Compiled in flag settings for the provider option */ +#define PROVIDER_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * fips140-mode option description: + */ +/** Descriptive text for the fips140-mode option */ +#define FIPS140_MODE_DESC (gnutls_cli_opt_strs+4048) +/** Upper-cased name for the fips140-mode option */ +#define FIPS140_MODE_NAME (gnutls_cli_opt_strs+4107) +/** Name string for the fips140-mode option */ +#define FIPS140_MODE_name (gnutls_cli_opt_strs+4120) +/** Compiled in flag settings for the fips140-mode option */ +#define FIPS140_MODE_FLAGS (OPTST_DISABLED) + +/* + * Help/More_Help/Version option descriptions: + */ +#define HELP_DESC (gnutls_cli_opt_strs+4133) +#define HELP_name (gnutls_cli_opt_strs+4177) +#ifdef HAVE_WORKING_FORK +#define MORE_HELP_DESC (gnutls_cli_opt_strs+4182) +#define MORE_HELP_name (gnutls_cli_opt_strs+4227) +#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +#define MORE_HELP_DESC HELP_DESC +#define MORE_HELP_name HELP_name +#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#endif +#ifdef NO_OPTIONAL_OPT_ARGS +# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ + OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) +#endif +#define VER_DESC (gnutls_cli_opt_strs+4237) +#define VER_name (gnutls_cli_opt_strs+4273) +/** + * Declare option callback procedures + */ +extern tOptProc + optionBooleanVal, optionNestedVal, optionNumericVal, + optionPagedUsage, optionPrintVersion, optionResetOpt, + optionStackArg, optionTimeDate, optionTimeVal, + optionUnstackArg, optionVendorOption; +static tOptProc + doOptApp_Proto, doOptDebug, doOptMtu, doOptPgpcertfile, + doOptPgpkeyfile, doOptPgpkeyring, doOptProvider, doOptRecordsize, + doOptX509crlfile, doUsageOpt; +#define VER_PROC optionPrintVersion + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the gnutls-cli Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the gnutls-cli program responds to. + */ +static tOptDesc optDesc[OPTION_CT] = { + { /* entry idx, value */ 0, VALUE_OPT_DEBUG, + /* equiv idx, value */ 0, VALUE_OPT_DEBUG, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DEBUG_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --debug */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptDebug, + /* desc, NAME, name */ DEBUG_DESC, DEBUG_NAME, DEBUG_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 1, VALUE_OPT_VERBOSE, + /* equiv idx, value */ 1, VALUE_OPT_VERBOSE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, NOLIMIT, 0, + /* opt state flags */ VERBOSE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --verbose */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ VERBOSE_DESC, VERBOSE_NAME, VERBOSE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 2, VALUE_OPT_TOFU, + /* equiv idx, value */ 2, VALUE_OPT_TOFU, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ TOFU_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --tofu */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ TOFU_DESC, TOFU_NAME, TOFU_name, + /* disablement strs */ NOT_TOFU_name, NOT_TOFU_PFX }, + + { /* entry idx, value */ 3, VALUE_OPT_STRICT_TOFU, + /* equiv idx, value */ 3, VALUE_OPT_STRICT_TOFU, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ STRICT_TOFU_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --strict-tofu */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ STRICT_TOFU_DESC, STRICT_TOFU_NAME, STRICT_TOFU_name, + /* disablement strs */ NOT_STRICT_TOFU_name, NOT_STRICT_TOFU_PFX }, + + { /* entry idx, value */ 4, VALUE_OPT_DANE, + /* equiv idx, value */ 4, VALUE_OPT_DANE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DANE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --dane */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ DANE_DESC, DANE_NAME, DANE_name, + /* disablement strs */ NOT_DANE_name, NOT_DANE_PFX }, + + { /* entry idx, value */ 5, VALUE_OPT_LOCAL_DNS, + /* equiv idx, value */ 5, VALUE_OPT_LOCAL_DNS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOCAL_DNS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --local-dns */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LOCAL_DNS_DESC, LOCAL_DNS_NAME, LOCAL_DNS_name, + /* disablement strs */ NOT_LOCAL_DNS_name, NOT_LOCAL_DNS_PFX }, + + { /* entry idx, value */ 6, VALUE_OPT_CA_VERIFICATION, + /* equiv idx, value */ 6, VALUE_OPT_CA_VERIFICATION, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ CA_VERIFICATION_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --ca-verification */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ CA_VERIFICATION_DESC, CA_VERIFICATION_NAME, CA_VERIFICATION_name, + /* disablement strs */ NOT_CA_VERIFICATION_name, NOT_CA_VERIFICATION_PFX }, + + { /* entry idx, value */ 7, VALUE_OPT_OCSP, + /* equiv idx, value */ 7, VALUE_OPT_OCSP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OCSP_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --ocsp */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ OCSP_DESC, OCSP_NAME, OCSP_name, + /* disablement strs */ NOT_OCSP_name, NOT_OCSP_PFX }, + + { /* entry idx, value */ 8, VALUE_OPT_RESUME, + /* equiv idx, value */ 8, VALUE_OPT_RESUME, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ RESUME_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --resume */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ RESUME_DESC, RESUME_NAME, RESUME_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 9, VALUE_OPT_REHANDSHAKE, + /* equiv idx, value */ 9, VALUE_OPT_REHANDSHAKE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ REHANDSHAKE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --rehandshake */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ REHANDSHAKE_DESC, REHANDSHAKE_NAME, REHANDSHAKE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 10, VALUE_OPT_STARTTLS, + /* equiv idx, value */ 10, VALUE_OPT_STARTTLS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ STARTTLS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --starttls */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ STARTTLS_DESC, STARTTLS_NAME, STARTTLS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 11, VALUE_OPT_APP_PROTO, + /* equiv idx, value */ 11, VALUE_OPT_APP_PROTO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ APP_PROTO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --app-proto */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptApp_Proto, + /* desc, NAME, name */ APP_PROTO_DESC, APP_PROTO_NAME, APP_PROTO_name, + /* disablement strs */ 0, 0 }, + + { /* entry idx, value */ 12, VALUE_OPT_STARTTLS_PROTO, + /* equiv idx, value */ 12, VALUE_OPT_STARTTLS_PROTO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ STARTTLS_PROTO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --starttls-proto */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, aStarttls_ProtoCantList, + /* option proc */ NULL, + /* desc, NAME, name */ STARTTLS_PROTO_DESC, STARTTLS_PROTO_NAME, STARTTLS_PROTO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 13, VALUE_OPT_UDP, + /* equiv idx, value */ 13, VALUE_OPT_UDP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ UDP_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --udp */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ UDP_DESC, UDP_NAME, UDP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 14, VALUE_OPT_MTU, + /* equiv idx, value */ 14, VALUE_OPT_MTU, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MTU_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --mtu */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptMtu, + /* desc, NAME, name */ MTU_DESC, MTU_NAME, MTU_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 15, VALUE_OPT_CRLF, + /* equiv idx, value */ 15, VALUE_OPT_CRLF, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ CRLF_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --crlf */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ CRLF_DESC, CRLF_NAME, CRLF_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 16, VALUE_OPT_FASTOPEN, + /* equiv idx, value */ 16, VALUE_OPT_FASTOPEN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ FASTOPEN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --fastopen */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ FASTOPEN_DESC, FASTOPEN_NAME, FASTOPEN_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 17, VALUE_OPT_X509FMTDER, + /* equiv idx, value */ 17, VALUE_OPT_X509FMTDER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ X509FMTDER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --x509fmtder */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ X509FMTDER_DESC, X509FMTDER_NAME, X509FMTDER_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 18, VALUE_OPT_FINGERPRINT, + /* equiv idx, value */ 18, VALUE_OPT_FINGERPRINT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ FINGERPRINT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --fingerprint */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ FINGERPRINT_DESC, FINGERPRINT_NAME, FINGERPRINT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 19, VALUE_OPT_PRINT_CERT, + /* equiv idx, value */ 19, VALUE_OPT_PRINT_CERT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PRINT_CERT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --print-cert */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PRINT_CERT_DESC, PRINT_CERT_NAME, PRINT_CERT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 20, VALUE_OPT_SAVE_CERT, + /* equiv idx, value */ 20, VALUE_OPT_SAVE_CERT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SAVE_CERT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --save-cert */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SAVE_CERT_DESC, SAVE_CERT_NAME, SAVE_CERT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 21, VALUE_OPT_SAVE_OCSP, + /* equiv idx, value */ 21, VALUE_OPT_SAVE_OCSP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SAVE_OCSP_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --save-ocsp */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SAVE_OCSP_DESC, SAVE_OCSP_NAME, SAVE_OCSP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 22, VALUE_OPT_DH_BITS, + /* equiv idx, value */ 22, VALUE_OPT_DH_BITS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DH_BITS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --dh-bits */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionNumericVal, + /* desc, NAME, name */ DH_BITS_DESC, DH_BITS_NAME, DH_BITS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 23, VALUE_OPT_PRIORITY, + /* equiv idx, value */ 23, VALUE_OPT_PRIORITY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PRIORITY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --priority */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PRIORITY_DESC, PRIORITY_NAME, PRIORITY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 24, VALUE_OPT_X509CAFILE, + /* equiv idx, value */ 24, VALUE_OPT_X509CAFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ X509CAFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --x509cafile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ X509CAFILE_DESC, X509CAFILE_NAME, X509CAFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 25, VALUE_OPT_X509CRLFILE, + /* equiv idx, value */ 25, VALUE_OPT_X509CRLFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ X509CRLFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --x509crlfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptX509crlfile, + /* desc, NAME, name */ X509CRLFILE_DESC, X509CRLFILE_NAME, X509CRLFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 26, VALUE_OPT_PGPKEYFILE, + /* equiv idx, value */ 26, VALUE_OPT_PGPKEYFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PGPKEYFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pgpkeyfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptPgpkeyfile, + /* desc, NAME, name */ PGPKEYFILE_DESC, PGPKEYFILE_NAME, PGPKEYFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 27, VALUE_OPT_PGPKEYRING, + /* equiv idx, value */ 27, VALUE_OPT_PGPKEYRING, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PGPKEYRING_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pgpkeyring */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptPgpkeyring, + /* desc, NAME, name */ PGPKEYRING_DESC, PGPKEYRING_NAME, PGPKEYRING_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 28, VALUE_OPT_PGPCERTFILE, + /* equiv idx, value */ 28, VALUE_OPT_PGPCERTFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PGPCERTFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pgpcertfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ aPgpcertfileMustList, NULL, + /* option proc */ doOptPgpcertfile, + /* desc, NAME, name */ PGPCERTFILE_DESC, PGPCERTFILE_NAME, PGPCERTFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 29, VALUE_OPT_X509KEYFILE, + /* equiv idx, value */ 29, VALUE_OPT_X509KEYFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ X509KEYFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --x509keyfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ X509KEYFILE_DESC, X509KEYFILE_NAME, X509KEYFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 30, VALUE_OPT_X509CERTFILE, + /* equiv idx, value */ 30, VALUE_OPT_X509CERTFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ X509CERTFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --x509certfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ aX509certfileMustList, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ X509CERTFILE_DESC, X509CERTFILE_NAME, X509CERTFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 31, VALUE_OPT_PGPSUBKEY, + /* equiv idx, value */ 31, VALUE_OPT_PGPSUBKEY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PGPSUBKEY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pgpsubkey */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PGPSUBKEY_DESC, PGPSUBKEY_NAME, PGPSUBKEY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 32, VALUE_OPT_SRPUSERNAME, + /* equiv idx, value */ 32, VALUE_OPT_SRPUSERNAME, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SRPUSERNAME_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --srpusername */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SRPUSERNAME_DESC, SRPUSERNAME_NAME, SRPUSERNAME_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 33, VALUE_OPT_SRPPASSWD, + /* equiv idx, value */ 33, VALUE_OPT_SRPPASSWD, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SRPPASSWD_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --srppasswd */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SRPPASSWD_DESC, SRPPASSWD_NAME, SRPPASSWD_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 34, VALUE_OPT_PSKUSERNAME, + /* equiv idx, value */ 34, VALUE_OPT_PSKUSERNAME, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PSKUSERNAME_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pskusername */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PSKUSERNAME_DESC, PSKUSERNAME_NAME, PSKUSERNAME_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 35, VALUE_OPT_PSKKEY, + /* equiv idx, value */ 35, VALUE_OPT_PSKKEY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PSKKEY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pskkey */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PSKKEY_DESC, PSKKEY_NAME, PSKKEY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 36, VALUE_OPT_PORT, + /* equiv idx, value */ 36, VALUE_OPT_PORT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PORT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --port */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PORT_DESC, PORT_NAME, PORT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 37, VALUE_OPT_INSECURE, + /* equiv idx, value */ 37, VALUE_OPT_INSECURE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INSECURE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --insecure */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ INSECURE_DESC, INSECURE_NAME, INSECURE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 38, VALUE_OPT_RANGES, + /* equiv idx, value */ 38, VALUE_OPT_RANGES, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ RANGES_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --ranges */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ RANGES_DESC, RANGES_NAME, RANGES_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 39, VALUE_OPT_BENCHMARK_CIPHERS, + /* equiv idx, value */ 39, VALUE_OPT_BENCHMARK_CIPHERS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ BENCHMARK_CIPHERS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --benchmark-ciphers */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ BENCHMARK_CIPHERS_DESC, BENCHMARK_CIPHERS_NAME, BENCHMARK_CIPHERS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 40, VALUE_OPT_BENCHMARK_TLS_KX, + /* equiv idx, value */ 40, VALUE_OPT_BENCHMARK_TLS_KX, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ BENCHMARK_TLS_KX_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --benchmark-tls-kx */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ BENCHMARK_TLS_KX_DESC, BENCHMARK_TLS_KX_NAME, BENCHMARK_TLS_KX_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 41, VALUE_OPT_BENCHMARK_TLS_CIPHERS, + /* equiv idx, value */ 41, VALUE_OPT_BENCHMARK_TLS_CIPHERS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ BENCHMARK_TLS_CIPHERS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --benchmark-tls-ciphers */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ BENCHMARK_TLS_CIPHERS_DESC, BENCHMARK_TLS_CIPHERS_NAME, BENCHMARK_TLS_CIPHERS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 42, VALUE_OPT_LIST, + /* equiv idx, value */ 42, VALUE_OPT_LIST, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LIST_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --list */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, aListCantList, + /* option proc */ NULL, + /* desc, NAME, name */ LIST_DESC, LIST_NAME, LIST_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 43, VALUE_OPT_PRIORITY_LIST, + /* equiv idx, value */ 43, VALUE_OPT_PRIORITY_LIST, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PRIORITY_LIST_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --priority-list */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PRIORITY_LIST_DESC, PRIORITY_LIST_NAME, PRIORITY_LIST_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 44, VALUE_OPT_NOTICKET, + /* equiv idx, value */ 44, VALUE_OPT_NOTICKET, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ NOTICKET_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --noticket */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ NOTICKET_DESC, NOTICKET_NAME, NOTICKET_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 45, VALUE_OPT_SRTP_PROFILES, + /* equiv idx, value */ 45, VALUE_OPT_SRTP_PROFILES, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SRTP_PROFILES_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --srtp_profiles */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SRTP_PROFILES_DESC, SRTP_PROFILES_NAME, SRTP_PROFILES_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 46, VALUE_OPT_ALPN, + /* equiv idx, value */ 46, VALUE_OPT_ALPN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, NOLIMIT, 0, + /* opt state flags */ ALPN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --alpn */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionStackArg, + /* desc, NAME, name */ ALPN_DESC, ALPN_NAME, ALPN_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 47, VALUE_OPT_HEARTBEAT, + /* equiv idx, value */ 47, VALUE_OPT_HEARTBEAT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ HEARTBEAT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --heartbeat */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ HEARTBEAT_DESC, HEARTBEAT_NAME, HEARTBEAT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 48, VALUE_OPT_RECORDSIZE, + /* equiv idx, value */ 48, VALUE_OPT_RECORDSIZE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ RECORDSIZE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --recordsize */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptRecordsize, + /* desc, NAME, name */ RECORDSIZE_DESC, RECORDSIZE_NAME, RECORDSIZE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 49, VALUE_OPT_DISABLE_SNI, + /* equiv idx, value */ 49, VALUE_OPT_DISABLE_SNI, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DISABLE_SNI_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --disable-sni */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ DISABLE_SNI_DESC, DISABLE_SNI_NAME, DISABLE_SNI_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 50, VALUE_OPT_DISABLE_EXTENSIONS, + /* equiv idx, value */ 50, VALUE_OPT_DISABLE_EXTENSIONS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DISABLE_EXTENSIONS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --disable-extensions */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ DISABLE_EXTENSIONS_DESC, DISABLE_EXTENSIONS_NAME, DISABLE_EXTENSIONS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 51, VALUE_OPT_INLINE_COMMANDS, + /* equiv idx, value */ 51, VALUE_OPT_INLINE_COMMANDS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INLINE_COMMANDS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --inline-commands */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ INLINE_COMMANDS_DESC, INLINE_COMMANDS_NAME, INLINE_COMMANDS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 52, VALUE_OPT_INLINE_COMMANDS_PREFIX, + /* equiv idx, value */ 52, VALUE_OPT_INLINE_COMMANDS_PREFIX, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INLINE_COMMANDS_PREFIX_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --inline-commands-prefix */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ INLINE_COMMANDS_PREFIX_DESC, INLINE_COMMANDS_PREFIX_NAME, INLINE_COMMANDS_PREFIX_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 53, VALUE_OPT_PROVIDER, + /* equiv idx, value */ 53, VALUE_OPT_PROVIDER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PROVIDER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --provider */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptProvider, + /* desc, NAME, name */ PROVIDER_DESC, PROVIDER_NAME, PROVIDER_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 54, VALUE_OPT_FIPS140_MODE, + /* equiv idx, value */ 54, VALUE_OPT_FIPS140_MODE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ FIPS140_MODE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --fips140-mode */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ FIPS140_MODE_DESC, FIPS140_MODE_NAME, FIPS140_MODE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VER_FLAGS, AOUSE_VERSION, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ VER_PROC, + /* desc, NAME, name */ VER_DESC, NULL, VER_name, + /* disablement strs */ NULL, NULL }, + + + + { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doUsageOpt, + /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionPagedUsage, + /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, + /* disablement strs */ NULL, NULL } +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** Reference to the upper cased version of gnutls-cli. */ +#define zPROGNAME (gnutls_cli_opt_strs+4281) +/** Reference to the title line for gnutls-cli usage. */ +#define zUsageTitle (gnutls_cli_opt_strs+4292) +/** There is no gnutls-cli configuration file. */ +#define zRcName NULL +/** There are no directories to search for gnutls-cli config files. */ +#define apzHomeList NULL +/** The gnutls-cli program bug email address. */ +#define zBugsAddr (gnutls_cli_opt_strs+4388) +/** Clarification/explanation of what gnutls-cli does. */ +#define zExplain (gnutls_cli_opt_strs+4408) +/** Extra detail explaining what gnutls-cli does. */ +#define zDetail (gnutls_cli_opt_strs+4410) +/** The full version string for gnutls-cli. */ +#define zFullVersion (gnutls_cli_opt_strs+4593) +/* extracted from optcode.tlib near line 364 */ + +#if defined(ENABLE_NLS) +# define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT + static tOptionXlateProc translate_option_strings; +#else +# define OPTPROC_BASE OPTPROC_NONE +# define translate_option_strings NULL +#endif /* ENABLE_NLS */ + +#define gnutls_cli_full_usage (NULL) +#define gnutls_cli_short_usage (gnutls_cli_opt_strs+4614) + +#endif /* not defined __doxygen__ */ + +/* + * Create the static procedure(s) declared above. + */ +/** + * The callout function that invokes the optionUsage function. + * + * @param[in] opts the AutoOpts option description structure + * @param[in] od the descriptor for the "help" (usage) option. + * @noreturn + */ +static void +doUsageOpt(tOptions * opts, tOptDesc * od) +{ + int ex_code; + ex_code = GNUTLS_CLI_EXIT_SUCCESS; + optionUsage(&gnutls_cliOptions, ex_code); + /* NOTREACHED */ + exit(GNUTLS_CLI_EXIT_FAILURE); + (void)opts; + (void)od; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the debug option. + * Specifies the debug level. + * @param[in] pOptions the gnutls-cli options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptDebug(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[1] = { + { 0 , 9999 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 1; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + + emit_ranges: +optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the app-proto option. + * + * @param[in] pOptions the gnutls-cli options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptApp_Proto(tOptions* pOptions, tOptDesc* pOptDesc) +{ + int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_STARTTLS_PROTO); + if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0)) + USAGE(GNUTLS_CLI_EXIT_USAGE_ERROR); + +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the mtu option. + * + * @param[in] pOptions the gnutls-cli options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptMtu(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[1] = { + { 0, 17000 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 1; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + + emit_ranges: +optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the x509crlfile option. + * + * @param[in] pOptions the gnutls-cli options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptX509crlfile(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the pgpkeyfile option. + * + * @param[in] pOptions the gnutls-cli options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptPgpkeyfile(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the pgpkeyring option. + * + * @param[in] pOptions the gnutls-cli options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptPgpkeyring(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the pgpcertfile option. + * + * @param[in] pOptions the gnutls-cli options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptPgpcertfile(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the recordsize option. + * + * @param[in] pOptions the gnutls-cli options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptRecordsize(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[1] = { + { 0, 4096 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 1; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + + emit_ranges: +optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the provider option. + * This will override the default options in /etc/gnutls/pkcs11.conf + * @param[in] pOptions the gnutls-cli options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptProvider(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} +/* extracted from optmain.tlib near line 1250 */ + +/** + * The directory containing the data associated with gnutls-cli. + */ +#ifndef PKGDATADIR +# define PKGDATADIR "" +#endif + +/** + * Information about the person or institution that packaged gnutls-cli + * for the current distribution. + */ +#ifndef WITH_PACKAGER +# define gnutls_cli_packager_info NULL +#else +/** Packager information for gnutls-cli. */ +static char const gnutls_cli_packager_info[] = + "Packaged by " WITH_PACKAGER + +# ifdef WITH_PACKAGER_VERSION + " ("WITH_PACKAGER_VERSION")" +# endif + +# ifdef WITH_PACKAGER_BUG_REPORTS + "\nReport gnutls_cli bugs to " WITH_PACKAGER_BUG_REPORTS +# endif + "\n"; +#endif +#ifndef __doxygen__ + +#endif /* __doxygen__ */ +/** + * The option definitions for gnutls-cli. The one structure that + * binds them all. + */ +tOptions gnutls_cliOptions = { + OPTIONS_STRUCT_VERSION, + 0, NULL, /* original argc + argv */ + ( OPTPROC_BASE + + OPTPROC_ERRSTOP + + OPTPROC_SHORTOPT + + OPTPROC_LONGOPT + + OPTPROC_NO_REQ_OPT + + OPTPROC_NEGATIONS + + OPTPROC_REORDER + + OPTPROC_GNUUSAGE + + OPTPROC_MISUSE ), + 0, NULL, /* current option index, current option */ + NULL, NULL, zPROGNAME, + zRcName, zCopyright, zLicenseDescrip, + zFullVersion, apzHomeList, zUsageTitle, + zExplain, zDetail, optDesc, + zBugsAddr, /* address to send bugs to */ + NULL, NULL, /* extensions/saved state */ + optionUsage, /* usage procedure */ + translate_option_strings, /* translation procedure */ + /* + * Indexes to special options + */ + { INDEX_OPT_MORE_HELP, /* more-help option index */ + NO_EQUIVALENT, /* save option index */ + NO_EQUIVALENT, /* '-#' option index */ + NO_EQUIVALENT /* index of default opt */ + }, + 58 /* full option count */, 55 /* user option count */, + gnutls_cli_full_usage, gnutls_cli_short_usage, + NULL, NULL, + PKGDATADIR, gnutls_cli_packager_info +}; + +#if ENABLE_NLS +/** + * This code is designed to translate translatable option text for the + * gnutls-cli program. These translations happen upon entry + * to optionProcess(). + */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#ifdef HAVE_DCGETTEXT +# include <gettext.h> +#endif +#include <autoopts/usage-txt.h> + +static char * AO_gettext(char const * pz); +static void coerce_it(void ** s); + +/** + * AutoGen specific wrapper function for gettext. It relies on the macro _() + * to convert from English to the target language, then strdup-duplicates the + * result string. It tries the "libopts" domain first, then whatever has been + * set via the \a textdomain(3) call. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * +AO_gettext(char const * pz) +{ + char * res; + if (pz == NULL) + return NULL; +#ifdef HAVE_DCGETTEXT + /* + * While processing the option_xlateable_txt data, try to use the + * "libopts" domain. Once we switch to the option descriptor data, + * do *not* use that domain. + */ + if (option_xlateable_txt.field_ct != 0) { + res = dgettext("libopts", pz); + if (res == pz) + res = (char *)VOIDP(_(pz)); + } else + res = (char *)VOIDP(_(pz)); +#else + res = (char *)VOIDP(_(pz)); +#endif + if (res == pz) + return res; + res = strdup(res); + if (res == NULL) { + fputs(_("No memory for duping translated strings\n"), stderr); + exit(GNUTLS_CLI_EXIT_FAILURE); + } + return res; +} + +/** + * All the pointers we use are marked "* const", but they are stored in + * writable memory. Coerce the mutability and set the pointer. + */ +static void coerce_it(void ** s) { *s = AO_gettext(*s); +} + +/** + * Translate all the translatable strings in the gnutls_cliOptions + * structure defined above. This is done only once. + */ +static void +translate_option_strings(void) +{ + tOptions * const opts = &gnutls_cliOptions; + + /* + * Guard against re-translation. It won't work. The strings will have + * been changed by the first pass through this code. One shot only. + */ + if (option_xlateable_txt.field_ct != 0) { + /* + * Do the translations. The first pointer follows the field count + * field. The field count field is the size of a pointer. + */ + char ** ppz = (char**)VOIDP(&(option_xlateable_txt)); + int ix = option_xlateable_txt.field_ct; + + do { + ppz++; /* skip over field_ct */ + *ppz = AO_gettext(*ppz); + } while (--ix > 0); + /* prevent re-translation and disable "libopts" domain lookup */ + option_xlateable_txt.field_ct = 0; + + coerce_it(VOIDP(&(opts->pzCopyright))); + coerce_it(VOIDP(&(opts->pzCopyNotice))); + coerce_it(VOIDP(&(opts->pzFullVersion))); + coerce_it(VOIDP(&(opts->pzUsageTitle))); + coerce_it(VOIDP(&(opts->pzExplain))); + coerce_it(VOIDP(&(opts->pzDetail))); + { + tOptDesc * od = opts->pOptDesc; + for (ix = opts->optCt; ix > 0; ix--, od++) + coerce_it(VOIDP(&(od->pzText))); + } + } +} +#endif /* ENABLE_NLS */ + +#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT +/** I18N function strictly for xgettext. Do not compile. */ +static void bogus_function(void) { + /* TRANSLATORS: + + The following dummy function was crated solely so that xgettext can + extract the correct strings. These strings are actually referenced + by a field name in the gnutls_cliOptions structure noted in the + comments below. The literal text is defined in gnutls_cli_opt_strs. + + NOTE: the strings below are segmented with respect to the source string + gnutls_cli_opt_strs. The strings above are handed off for translation + at run time a paragraph at a time. Consequently, they are presented here + for translation a paragraph at a time. + + ALSO: often the description for an option will reference another option + by name. These are set off with apostrophe quotes (I hope). Do not + translate option names. + */ + /* referenced via gnutls_cliOptions.pzCopyright */ + puts(_("gnutls-cli @VERSION@\n\ +Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n\ +This is free software. It is licensed for use, modification and\n\ +redistribution under the terms of the GNU General Public License,\n\ +version 3 or later <http://gnu.org/licenses/gpl.html>\n")); + + /* referenced via gnutls_cliOptions.pzCopyNotice */ + puts(_("gnutls-cli is free software: you can redistribute it and/or modify it under\n\ +the terms of the GNU General Public License as published by the Free\n\ +Software Foundation, either version 3 of the License, or (at your option)\n\ +any later version.\n\n")); + puts(_("gnutls-cli is distributed in the hope that it will be useful, but WITHOUT\n\ +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n\ +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n\ +more details.\n\n")); + puts(_("You should have received a copy of the GNU General Public License along\n\ +with this program. If not, see <http://www.gnu.org/licenses/>.\n")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Enable debugging")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("More verbose output")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Enable trust on first use authentication")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Fail to connect if a known certificate has changed")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Enable DANE certificate verification (DNSSEC)")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Use the local DNS server for DNSSEC resolving")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Enable CA certificate verification")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Enable OCSP certificate verification")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Establish a session and resume")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Establish a session and rehandshake")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Connect, establish a plain session and start TLS")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("an alias for the 'starttls-proto' option")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("The application protocol to be used to obtain the server's certificate\n\ +(https, ftp, smtp, imap, ldap, xmpp)")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Use DTLS (datagram TLS) over UDP")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Set MTU for datagram TLS")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Send CR LF instead of LF")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Enable TCP Fast Open")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Use DER format for certificates to read from")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Send the openpgp fingerprint, instead of the key")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Print peer's certificate in PEM format")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Save the peer's certificate chain in the specified file in PEM format")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Save the peer's OCSP status response in the provided file")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("The minimum number of bits allowed for DH")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Priorities string")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Certificate file or PKCS #11 URL to use")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("CRL file to use")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("PGP Key file to use")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("PGP Key ring file to use")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("PGP Public Key (certificate) file to use")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("X.509 key file or PKCS #11 URL to use")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("X.509 Certificate file or PKCS #11 URL to use")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("PGP subkey to use (hex or auto)")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("SRP username to use")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("SRP password to use")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("PSK username to use")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("PSK key (in hex) to use")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("The port or service to connect to")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Don't abort program if server certificate can't be validated")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Use length-hiding padding to prevent traffic analysis")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Benchmark individual ciphers")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Benchmark TLS key exchange methods")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Benchmark TLS ciphers")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Print a list of the supported algorithms and modes")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Print a list of the supported priority strings")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Don't allow session tickets")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Offer SRTP profiles")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Application layer protocol")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Activate heartbeat support")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("The maximum record size to advertize")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Do not send a Server Name Indication (SNI)")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Disable all the TLS extensions")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Inline commands of the form ^<cmd>^")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Change the default delimiter for inline commands.")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Specify the PKCS #11 provider library")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("Reports the status of the FIPS140-2 mode in gnutls library")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("display extended usage information and exit")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("extended usage information passed thru pager")); + + /* referenced via gnutls_cliOptions.pOptDesc->pzText */ + puts(_("output version information and exit")); + + /* referenced via gnutls_cliOptions.pzUsageTitle */ + puts(_("gnutls-cli - GnuTLS client\n\ +Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [hostname]\n")); + + /* referenced via gnutls_cliOptions.pzExplain */ + puts(_("\n")); + + /* referenced via gnutls_cliOptions.pzDetail */ + puts(_("Simple client program to set up a TLS connection to some other computer. It\n\ +sets up a TLS connection and forwards data from the standard input to the\n\ +secured socket and vice versa.\n")); + + /* referenced via gnutls_cliOptions.pzFullVersion */ + puts(_("gnutls-cli @VERSION@")); + + /* referenced via gnutls_cliOptions.pzFullUsage */ + puts(_("<<<NOT-FOUND>>>")); + + /* referenced via gnutls_cliOptions.pzShortUsage */ + puts(_("Usage: gnutls-cli [options] hostname\n\ +gnutls-cli --help for usage instructions.\n")); + /* LIBOPTS-MESSAGES: */ +#line 67 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 93 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 53 "../init.c" + puts(_("AutoOpts function called without option descriptor\n")); +#line 86 "../init.c" + puts(_("\tThis exceeds the compiled library version: ")); +#line 84 "../init.c" + puts(_("Automated Options Processing Error!\n" + "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); +#line 80 "../autoopts.c" + puts(_("realloc of %d bytes at 0x%p failed\n")); +#line 88 "../init.c" + puts(_("\tThis is less than the minimum library version: ")); +#line 121 "../version.c" + puts(_("Automated Options version %s\n" + "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); +#line 87 "../makeshell.c" + puts(_("(AutoOpts bug): %s.\n")); +#line 90 "../reset.c" + puts(_("optionResetOpt() called, but reset-option not configured")); +#line 295 "../usage.c" + puts(_("could not locate the 'help' option")); +#line 336 "../autoopts.c" + puts(_("optionProcess() was called with invalid data")); +#line 751 "../usage.c" + puts(_("invalid argument type specified")); +#line 598 "../find.c" + puts(_("defaulted to option with optional arg")); +#line 76 "../alias.c" + puts(_("aliasing option is out of range.")); +#line 235 "../enum.c" + puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); +#line 108 "../find.c" + puts(_(" The following options match:\n")); +#line 293 "../find.c" + puts(_("%s: ambiguous option name: %s (matches %d options)\n")); +#line 161 "../check.c" + puts(_("%s: Command line arguments required\n")); +#line 43 "../alias.c" + puts(_("%d %s%s options allowed\n")); +#line 94 "../makeshell.c" + puts(_("%s error %d (%s) calling %s for '%s'\n")); +#line 306 "../makeshell.c" + puts(_("interprocess pipe")); +#line 168 "../version.c" + puts(_("error: version option argument '%c' invalid. Use:\n" + "\t'v' - version only\n" + "\t'c' - version and copyright\n" + "\t'n' - version and full copyright notice\n")); +#line 58 "../check.c" + puts(_("%s error: the '%s' and '%s' options conflict\n")); +#line 217 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 430 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 38 "../alias.c" + puts(_("-equivalence")); +#line 469 "../find.c" + puts(_("%s: illegal option -- %c\n")); +#line 110 "../reset.c" + puts(_("%s: illegal option -- %c\n")); +#line 271 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 755 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 118 "../reset.c" + puts(_("%s: illegal option -- %s\n")); +#line 335 "../find.c" + puts(_("%s: unknown vendor extension option -- %s\n")); +#line 160 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 170 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 750 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 1084 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 385 "../find.c" + puts(_("%s: invalid option name: %s\n")); +#line 527 "../find.c" + puts(_("%s: The '%s' option requires an argument.\n")); +#line 156 "../autoopts.c" + puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" + "\t'%s' and '%s'.")); +#line 94 "../check.c" + puts(_("%s error: The %s option is required\n")); +#line 632 "../find.c" + puts(_("%s: The '%s' option cannot have an argument.\n")); +#line 151 "../check.c" + puts(_("%s: Command line arguments are not allowed.\n")); +#line 536 "../save.c" + puts(_("error %d (%s) creating %s\n")); +#line 235 "../enum.c" + puts(_("%s error: '%s' does not match any %s keywords.\n")); +#line 93 "../reset.c" + puts(_("%s error: The '%s' option requires an argument.\n")); +#line 186 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 239 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 143 "../restore.c" + puts(_("%s error: no saved option state\n")); +#line 231 "../autoopts.c" + puts(_("'%s' is not a command line option.\n")); +#line 113 "../time.c" + puts(_("%s error: '%s' is not a recognizable date/time.\n")); +#line 131 "../save.c" + puts(_("'%s' not defined\n")); +#line 50 "../time.c" + puts(_("%s error: '%s' is not a recognizable time duration.\n")); +#line 92 "../check.c" + puts(_("%s error: The %s option must appear %d times.\n")); +#line 165 "../numeric.c" + puts(_("%s error: '%s' is not a recognizable number.\n")); +#line 201 "../enum.c" + puts(_("%s error: %s exceeds %s keyword count\n")); +#line 333 "../usage.c" + puts(_("Try '%s %s' for more information.\n")); +#line 45 "../alias.c" + puts(_("one %s%s option allowed\n")); +#line 208 "../makeshell.c" + puts(_("standard output")); +#line 943 "../makeshell.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard output")); +#line 418 "../usage.c" + puts(_("standard output")); +#line 628 "../usage.c" + puts(_("standard output")); +#line 175 "../version.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard error")); +#line 418 "../usage.c" + puts(_("standard error")); +#line 628 "../usage.c" + puts(_("standard error")); +#line 175 "../version.c" + puts(_("standard error")); +#line 208 "../makeshell.c" + puts(_("write")); +#line 943 "../makeshell.c" + puts(_("write")); +#line 276 "../usage.c" + puts(_("write")); +#line 417 "../usage.c" + puts(_("write")); +#line 627 "../usage.c" + puts(_("write")); +#line 174 "../version.c" + puts(_("write")); +#line 60 "../numeric.c" + puts(_("%s error: %s option value %ld is out of range.\n")); +#line 44 "../check.c" + puts(_("%s error: %s option requires the %s option\n")); +#line 130 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 185 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 238 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 257 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 535 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); + /* END-LIBOPTS-MESSAGES */ + + /* USAGE-TEXT: */ +#line 876 "../usage.c" + puts(_("\t\t\t\t- an alternate for '%s'\n")); +#line 1151 "../usage.c" + puts(_("Version, usage and configuration options:")); +#line 927 "../usage.c" + puts(_("\t\t\t\t- default option for unnamed options\n")); +#line 840 "../usage.c" + puts(_("\t\t\t\t- disabled as '--%s'\n")); +#line 1120 "../usage.c" + puts(_(" --- %-14s %s\n")); +#line 1118 "../usage.c" + puts(_("This option has been disabled")); +#line 867 "../usage.c" + puts(_("\t\t\t\t- enabled by default\n")); +#line 40 "../alias.c" + puts(_("%s error: only ")); +#line 1197 "../usage.c" + puts(_(" - examining environment variables named %s_*\n")); +#line 168 "../file.c" + puts(_("\t\t\t\t- file must not pre-exist\n")); +#line 172 "../file.c" + puts(_("\t\t\t\t- file must pre-exist\n")); +#line 383 "../usage.c" + puts(_("Options are specified by doubled hyphens and their name or by a single\n" + "hyphen and the flag character.\n")); +#line 921 "../makeshell.c" + puts(_("\n" + "= = = = = = = =\n\n" + "This incarnation of genshell will produce\n" + "a shell script to parse the options for %s:\n\n")); +#line 167 "../enum.c" + puts(_(" or an integer mask with any of the lower %d bits set\n")); +#line 900 "../usage.c" + puts(_("\t\t\t\t- is a set membership option\n")); +#line 921 "../usage.c" + puts(_("\t\t\t\t- must appear between %d and %d times\n")); +#line 385 "../usage.c" + puts(_("Options are specified by single or double hyphens and their name.\n")); +#line 907 "../usage.c" + puts(_("\t\t\t\t- may appear multiple times\n")); +#line 894 "../usage.c" + puts(_("\t\t\t\t- may not be preset\n")); +#line 1312 "../usage.c" + puts(_(" Arg Option-Name Description\n")); +#line 1248 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1306 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1307 "../usage.c" + puts(_(" %3s %s")); +#line 1313 "../usage.c" + puts(_(" %3s %s")); +#line 390 "../usage.c" + puts(_("The '-#<number>' option may omit the hash char\n")); +#line 386 "../usage.c" + puts(_("All arguments are named options.\n")); +#line 974 "../usage.c" + puts(_(" - reading file %s")); +#line 412 "../usage.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 100 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 129 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 906 "../usage.c" + puts(_("\t\t\t\t- may NOT appear - preset only\n")); +#line 947 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 1195 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 685 "../usage.c" + puts(_("prohibits these options:\n")); +#line 680 "../usage.c" + puts(_("prohibits the option '%s'\n")); +#line 81 "../numeric.c" + puts(_("%s%ld to %ld")); +#line 79 "../numeric.c" + puts(_("%sgreater than or equal to %ld")); +#line 75 "../numeric.c" + puts(_("%s%ld exactly")); +#line 68 "../numeric.c" + puts(_("%sit must lie in one of the ranges:\n")); +#line 68 "../numeric.c" + puts(_("%sit must be in the range:\n")); +#line 88 "../numeric.c" + puts(_(", or\n")); +#line 66 "../numeric.c" + puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); +#line 77 "../numeric.c" + puts(_("%sless than or equal to %ld")); +#line 393 "../usage.c" + puts(_("Operands and options may be intermixed. They will be reordered.\n")); +#line 655 "../usage.c" + puts(_("requires the option '%s'\n")); +#line 658 "../usage.c" + puts(_("requires these options:\n")); +#line 1324 "../usage.c" + puts(_(" Arg Option-Name Req? Description\n")); +#line 1318 "../usage.c" + puts(_(" Flg Arg Option-Name Req? Description\n")); +#line 168 "../enum.c" + puts(_("or you may use a numeric representation. Preceding these with a '!'\n" + "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" + "will set them all. Multiple entries may be passed as an option\n" + "argument list.\n")); +#line 913 "../usage.c" + puts(_("\t\t\t\t- may appear up to %d times\n")); +#line 77 "../enum.c" + puts(_("The valid \"%s\" option keywords are:\n")); +#line 1155 "../usage.c" + puts(_("The next option supports vendor supported extra options:")); +#line 776 "../usage.c" + puts(_("These additional options are:")); + /* END-USAGE-TEXT */ +} +#endif /* uncompilable code */ +#ifdef __cplusplus +} +#endif +/* cli-args.c ends here */ diff --git a/src/cli-args.h.bak b/src/cli-args.h.bak new file mode 100644 index 0000000000..01f81c93e9 --- /dev/null +++ b/src/cli-args.h.bak @@ -0,0 +1,327 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (cli-args.h) + * + * It has been AutoGen-ed + * From the definitions cli-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the gnutls-cli author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The gnutls-cli program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * gnutls-cli is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * gnutls-cli is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ +/** + * This file contains the programmatic interface to the Automated + * Options generated for the gnutls-cli program. + * These macros are documented in the AutoGen info file in the + * "AutoOpts" chapter. Please refer to that doc for usage help. + */ +#ifndef AUTOOPTS_CLI_ARGS_H_GUARD +#define AUTOOPTS_CLI_ARGS_H_GUARD 1 +#include "config.h" +#include <autoopts/options.h> + +/** + * Ensure that the library used for compiling this generated header is at + * least as new as the version current when the header template was released + * (not counting patch version increments). Also ensure that the oldest + * tolerable version is at least as old as what was current when the header + * template was released. + */ +#define AO_TEMPLATE_VERSION 167937 +#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ + || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) +# error option template version mismatches autoopts/options.h header + Choke Me. +#endif + +/** + * Enumeration of each option type for gnutls-cli + */ +typedef enum { + INDEX_OPT_DEBUG = 0, + INDEX_OPT_VERBOSE = 1, + INDEX_OPT_TOFU = 2, + INDEX_OPT_STRICT_TOFU = 3, + INDEX_OPT_DANE = 4, + INDEX_OPT_LOCAL_DNS = 5, + INDEX_OPT_CA_VERIFICATION = 6, + INDEX_OPT_OCSP = 7, + INDEX_OPT_RESUME = 8, + INDEX_OPT_REHANDSHAKE = 9, + INDEX_OPT_STARTTLS = 10, + INDEX_OPT_APP_PROTO = 11, + INDEX_OPT_STARTTLS_PROTO = 12, + INDEX_OPT_UDP = 13, + INDEX_OPT_MTU = 14, + INDEX_OPT_CRLF = 15, + INDEX_OPT_FASTOPEN = 16, + INDEX_OPT_X509FMTDER = 17, + INDEX_OPT_FINGERPRINT = 18, + INDEX_OPT_PRINT_CERT = 19, + INDEX_OPT_SAVE_CERT = 20, + INDEX_OPT_SAVE_OCSP = 21, + INDEX_OPT_DH_BITS = 22, + INDEX_OPT_PRIORITY = 23, + INDEX_OPT_X509CAFILE = 24, + INDEX_OPT_X509CRLFILE = 25, + INDEX_OPT_PGPKEYFILE = 26, + INDEX_OPT_PGPKEYRING = 27, + INDEX_OPT_PGPCERTFILE = 28, + INDEX_OPT_X509KEYFILE = 29, + INDEX_OPT_X509CERTFILE = 30, + INDEX_OPT_PGPSUBKEY = 31, + INDEX_OPT_SRPUSERNAME = 32, + INDEX_OPT_SRPPASSWD = 33, + INDEX_OPT_PSKUSERNAME = 34, + INDEX_OPT_PSKKEY = 35, + INDEX_OPT_PORT = 36, + INDEX_OPT_INSECURE = 37, + INDEX_OPT_RANGES = 38, + INDEX_OPT_BENCHMARK_CIPHERS = 39, + INDEX_OPT_BENCHMARK_TLS_KX = 40, + INDEX_OPT_BENCHMARK_TLS_CIPHERS = 41, + INDEX_OPT_LIST = 42, + INDEX_OPT_PRIORITY_LIST = 43, + INDEX_OPT_NOTICKET = 44, + INDEX_OPT_SRTP_PROFILES = 45, + INDEX_OPT_ALPN = 46, + INDEX_OPT_HEARTBEAT = 47, + INDEX_OPT_RECORDSIZE = 48, + INDEX_OPT_DISABLE_SNI = 49, + INDEX_OPT_DISABLE_EXTENSIONS = 50, + INDEX_OPT_INLINE_COMMANDS = 51, + INDEX_OPT_INLINE_COMMANDS_PREFIX = 52, + INDEX_OPT_PROVIDER = 53, + INDEX_OPT_FIPS140_MODE = 54, + INDEX_OPT_VERSION = 55, + INDEX_OPT_HELP = 56, + INDEX_OPT_MORE_HELP = 57 +} teOptIndex; +/** count of all options for gnutls-cli */ +#define OPTION_CT 58 +/** gnutls-cli version */ +#define GNUTLS_CLI_VERSION "@VERSION@" +/** Full gnutls-cli version text */ +#define GNUTLS_CLI_FULL_VERSION "gnutls-cli @VERSION@" + +/** + * Interface defines for all options. Replace "n" with the UPPER_CASED + * option name (as in the teOptIndex enumeration above). + * e.g. HAVE_OPT(DEBUG) + */ +#define DESC(n) (gnutls_cliOptions.pOptDesc[INDEX_OPT_## n]) +/** 'true' if an option has been specified in any way */ +#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) +/** The string argument to an option. The argument type must be \"string\". */ +#define OPT_ARG(n) (DESC(n).optArg.argString) +/** Mask the option state revealing how an option was specified. + * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET, + * \a OPTST_DEFINED, \a OPTST_RESET or zero. + */ +#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) +/** Count of option's occurrances *on the command line*. */ +#define COUNT_OPT(n) (DESC(n).optOccCt) +/** mask of \a OPTST_SET and \a OPTST_DEFINED. */ +#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) +/** 'true' if \a HAVE_OPT would yield 'false'. */ +#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) +/** 'true' if OPTST_DISABLED bit not set. */ +#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) +/** number of stacked option arguments. + * Valid only for stacked option arguments. */ +#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) +/** stacked argument vector. + * Valid only for stacked option arguments. */ +#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) +/** Reset an option. */ +#define CLEAR_OPT(n) STMTS( \ + DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + DESC(n).fOptState |= OPTST_DISABLED; \ + DESC(n).optCookie = NULL ) +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Enumeration of gnutls-cli exit codes + */ +typedef enum { + GNUTLS_CLI_EXIT_SUCCESS = 0, + GNUTLS_CLI_EXIT_FAILURE = 1, + GNUTLS_CLI_EXIT_USAGE_ERROR = 64, + GNUTLS_CLI_EXIT_LIBOPTS_FAILURE = 70 +} gnutls_cli_exit_code_t; +/** + * Interface defines for specific options. + * @{ + */ +#define VALUE_OPT_DEBUG 'd' + +#define OPT_VALUE_DEBUG (DESC(DEBUG).optArg.argInt) +#define VALUE_OPT_VERBOSE 'V' +#define VALUE_OPT_TOFU 0x1001 +#define VALUE_OPT_STRICT_TOFU 0x1002 +#define VALUE_OPT_DANE 0x1003 +#define VALUE_OPT_LOCAL_DNS 0x1004 +#define VALUE_OPT_CA_VERIFICATION 0x1005 +#define VALUE_OPT_OCSP 0x1006 +#define VALUE_OPT_RESUME 'r' +#define VALUE_OPT_REHANDSHAKE 'e' +#define VALUE_OPT_STARTTLS 's' +#define VALUE_OPT_APP_PROTO 0x1007 +#define VALUE_OPT_STARTTLS_PROTO 0x1008 +#define VALUE_OPT_UDP 'u' +#define VALUE_OPT_MTU 0x1009 + +#define OPT_VALUE_MTU (DESC(MTU).optArg.argInt) +#define VALUE_OPT_CRLF 0x100A +#define VALUE_OPT_FASTOPEN 0x100B +#define VALUE_OPT_X509FMTDER 0x100C +#define VALUE_OPT_FINGERPRINT 'f' +#define VALUE_OPT_PRINT_CERT 0x100D +#define VALUE_OPT_SAVE_CERT 0x100E +#define VALUE_OPT_SAVE_OCSP 0x100F +#define VALUE_OPT_DH_BITS 0x1010 + +#define OPT_VALUE_DH_BITS (DESC(DH_BITS).optArg.argInt) +#define VALUE_OPT_PRIORITY 0x1011 +#define VALUE_OPT_X509CAFILE 0x1012 +#define VALUE_OPT_X509CRLFILE 0x1013 +#define VALUE_OPT_PGPKEYFILE 0x1014 +#define VALUE_OPT_PGPKEYRING 0x1015 +#define VALUE_OPT_PGPCERTFILE 0x1016 +#define VALUE_OPT_X509KEYFILE 0x1017 +#define VALUE_OPT_X509CERTFILE 0x1018 +#define VALUE_OPT_PGPSUBKEY 0x1019 +#define VALUE_OPT_SRPUSERNAME 0x101A +#define VALUE_OPT_SRPPASSWD 0x101B +#define VALUE_OPT_PSKUSERNAME 0x101C +#define VALUE_OPT_PSKKEY 0x101D +#define VALUE_OPT_PORT 'p' +#define VALUE_OPT_INSECURE 0x101E +#define VALUE_OPT_RANGES 0x101F +#define VALUE_OPT_BENCHMARK_CIPHERS 0x1020 +#define VALUE_OPT_BENCHMARK_TLS_KX 0x1021 +#define VALUE_OPT_BENCHMARK_TLS_CIPHERS 0x1022 +#define VALUE_OPT_LIST 'l' +#define VALUE_OPT_PRIORITY_LIST 0x1023 +#define VALUE_OPT_NOTICKET 0x1024 +#define VALUE_OPT_SRTP_PROFILES 0x1025 +#define VALUE_OPT_ALPN 0x1026 +#define VALUE_OPT_HEARTBEAT 'b' +#define VALUE_OPT_RECORDSIZE 0x1027 + +#define OPT_VALUE_RECORDSIZE (DESC(RECORDSIZE).optArg.argInt) +#define VALUE_OPT_DISABLE_SNI 0x1028 +#define VALUE_OPT_DISABLE_EXTENSIONS 0x1029 +#define VALUE_OPT_INLINE_COMMANDS 0x102A +#define VALUE_OPT_INLINE_COMMANDS_PREFIX 0x102B +#define VALUE_OPT_PROVIDER 0x102C +#define VALUE_OPT_FIPS140_MODE 0x102D +/** option flag (value) for help-value option */ +#define VALUE_OPT_HELP 'h' +/** option flag (value) for more-help-value option */ +#define VALUE_OPT_MORE_HELP '!' +/** option flag (value) for version-value option */ +#define VALUE_OPT_VERSION 'v' +/* + * Interface defines not associated with particular options + */ +#define ERRSKIP_OPTERR STMTS(gnutls_cliOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(gnutls_cliOptions.fOptSet |= OPTPROC_ERRSTOP) +#define RESTART_OPT(n) STMTS( \ + gnutls_cliOptions.curOptIdx = (n); \ + gnutls_cliOptions.pzCurOpt = NULL ) +#define START_OPT RESTART_OPT(1) +#define USAGE(c) (*gnutls_cliOptions.pUsageProc)(&gnutls_cliOptions, c) + +#ifdef __cplusplus +extern "C" { +#endif +/* + * global exported definitions + */ +#include <gettext.h> + + +/* * * * * * + * + * Declare the gnutls-cli option descriptor. + */ +extern tOptions gnutls_cliOptions; + +#if defined(ENABLE_NLS) +# ifndef _ +# include <stdio.h> +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include <libintl.h> +# endif + +# ifndef ATTRIBUTE_FORMAT_ARG +# define ATTRIBUTE_FORMAT_ARG(_a) +# endif + +static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1); +static inline char* aoGetsText(char const* pz) { + if (pz == NULL) return NULL; + return (char*)gettext(pz); +} +# define _(s) aoGetsText(s) +# endif /* _() */ + +# define OPT_NO_XLAT_CFG_NAMES STMTS(gnutls_cliOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT_CFG;) +# define OPT_NO_XLAT_OPT_NAMES STMTS(gnutls_cliOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) + +# define OPT_XLAT_CFG_NAMES STMTS(gnutls_cliOptions.fOptSet &= \ + ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) +# define OPT_XLAT_OPT_NAMES STMTS(gnutls_cliOptions.fOptSet &= \ + ~OPTPROC_NXLAT_OPT;) + +#else /* ENABLE_NLS */ +# define OPT_NO_XLAT_CFG_NAMES +# define OPT_NO_XLAT_OPT_NAMES + +# define OPT_XLAT_CFG_NAMES +# define OPT_XLAT_OPT_NAMES + +# ifndef _ +# define _(_s) _s +# endif +#endif /* ENABLE_NLS */ + +#ifdef __cplusplus +} +#endif +#endif /* AUTOOPTS_CLI_ARGS_H_GUARD */ + +/* cli-args.h ends here */ diff --git a/src/cli-debug-args.c.bak b/src/cli-debug-args.c.bak new file mode 100644 index 0000000000..3263a10797 --- /dev/null +++ b/src/cli-debug-args.c.bak @@ -0,0 +1,1023 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (cli-debug-args.c) + * + * It has been AutoGen-ed + * From the definitions cli-debug-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the gnutls-cli-debug author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The gnutls-cli-debug program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * gnutls-cli-debug is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * gnutls-cli-debug is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "cli-debug-args.h" +#include <sys/types.h> + +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> + +#ifdef __cplusplus +extern "C" { +#endif +extern FILE * option_usage_fp; +#define zCopyright (gnutls_cli_debug_opt_strs+0) +#define zLicenseDescrip (gnutls_cli_debug_opt_strs+297) + + +#ifndef NULL +# define NULL 0 +#endif + +/** + * static const strings for gnutls-cli-debug options + */ +static char const gnutls_cli_debug_opt_strs[2021] = +/* 0 */ "gnutls-cli-debug @VERSION@\n" + "Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n" + "This is free software. It is licensed for use, modification and\n" + "redistribution under the terms of the GNU General Public License,\n" + "version 3 or later <http://gnu.org/licenses/gpl.html>\n\0" +/* 297 */ "gnutls-cli-debug is free software: you can redistribute it and/or modify it\n" + "under the terms of the GNU General Public License as published by the Free\n" + "Software Foundation, either version 3 of the License, or (at your option)\n" + "any later version.\n\n" + "gnutls-cli-debug is distributed in the hope that it will be useful, but\n" + "WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n" + "or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n" + "for more details.\n\n" + "You should have received a copy of the GNU General Public License along\n" + "with this program. If not, see <http://www.gnu.org/licenses/>.\n\0" +/* 918 */ "Enable debugging\0" +/* 935 */ "DEBUG\0" +/* 941 */ "debug\0" +/* 947 */ "More verbose output\0" +/* 967 */ "VERBOSE\0" +/* 975 */ "verbose\0" +/* 983 */ "The port to connect to\0" +/* 1006 */ "PORT\0" +/* 1011 */ "port\0" +/* 1016 */ "an alias for the 'starttls-proto' option\0" +/* 1057 */ "app-proto\0" +/* 1067 */ "The application protocol to be used to obtain the server's certificate\n" + "(https, ftp, smtp, imap, ldap, xmpp)\0" +/* 1175 */ "STARTTLS_PROTO\0" +/* 1190 */ "starttls-proto\0" +/* 1205 */ "display extended usage information and exit\0" +/* 1249 */ "help\0" +/* 1254 */ "extended usage information passed thru pager\0" +/* 1299 */ "more-help\0" +/* 1309 */ "output version information and exit\0" +/* 1345 */ "version\0" +/* 1353 */ "GNUTLS_CLI_DEBUG\0" +/* 1370 */ "gnutls-cli-debug - GnuTLS debug client\n" + "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \n\0" +/* 1468 */ "@PACKAGE_BUGREPORT@\0" +/* 1488 */ "\n\0" +/* 1490 */ "TLS debug client. It sets up multiple TLS connections to a server and\n" + "queries its capabilities. It was created to assist in debugging GnuTLS,\n" + "but it might be useful to extract a TLS server's capabilities. It connects\n" + "to a TLS server, performs tests and print the server's capabilities. If\n" + "called with the `-v' parameter more checks will be performed. Can be used\n" + "to check for servers with special needs or bugs.\n\0" +/* 1908 */ "gnutls-cli-debug @VERSION@\0" +/* 1935 */ "Usage: gnutls-cli-debug [options] hostname\n" + "gnutls-cli --help for usage instructions.\n"; + +/** + * debug option description: + */ +/** Descriptive text for the debug option */ +#define DEBUG_DESC (gnutls_cli_debug_opt_strs+918) +/** Upper-cased name for the debug option */ +#define DEBUG_NAME (gnutls_cli_debug_opt_strs+935) +/** Name string for the debug option */ +#define DEBUG_name (gnutls_cli_debug_opt_strs+941) +/** Compiled in flag settings for the debug option */ +#define DEBUG_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * verbose option description: + */ +/** Descriptive text for the verbose option */ +#define VERBOSE_DESC (gnutls_cli_debug_opt_strs+947) +/** Upper-cased name for the verbose option */ +#define VERBOSE_NAME (gnutls_cli_debug_opt_strs+967) +/** Name string for the verbose option */ +#define VERBOSE_name (gnutls_cli_debug_opt_strs+975) +/** Compiled in flag settings for the verbose option */ +#define VERBOSE_FLAGS (OPTST_DISABLED) + +/** + * port option description: + */ +/** Descriptive text for the port option */ +#define PORT_DESC (gnutls_cli_debug_opt_strs+983) +/** Upper-cased name for the port option */ +#define PORT_NAME (gnutls_cli_debug_opt_strs+1006) +/** Name string for the port option */ +#define PORT_name (gnutls_cli_debug_opt_strs+1011) +/** Compiled in flag settings for the port option */ +#define PORT_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * app-proto option description: + */ +/** Descriptive text for the app-proto option */ +#define APP_PROTO_DESC (gnutls_cli_debug_opt_strs+1016) +#define APP_PROTO_NAME NULL +/** Unmodified name string for the app-proto option */ +#define APP_PROTO_name (gnutls_cli_debug_opt_strs+1057) +/** Compiled in flag settings for the app-proto option */ +#define APP_PROTO_FLAGS (STARTTLS_PROTO_FLAGS | OPTST_ALIAS) + +/** + * starttls-proto option description: + */ +/** Descriptive text for the starttls-proto option */ +#define STARTTLS_PROTO_DESC (gnutls_cli_debug_opt_strs+1067) +/** Upper-cased name for the starttls-proto option */ +#define STARTTLS_PROTO_NAME (gnutls_cli_debug_opt_strs+1175) +/** Name string for the starttls-proto option */ +#define STARTTLS_PROTO_name (gnutls_cli_debug_opt_strs+1190) +/** Compiled in flag settings for the starttls-proto option */ +#define STARTTLS_PROTO_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/* + * Help/More_Help/Version option descriptions: + */ +#define HELP_DESC (gnutls_cli_debug_opt_strs+1205) +#define HELP_name (gnutls_cli_debug_opt_strs+1249) +#ifdef HAVE_WORKING_FORK +#define MORE_HELP_DESC (gnutls_cli_debug_opt_strs+1254) +#define MORE_HELP_name (gnutls_cli_debug_opt_strs+1299) +#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +#define MORE_HELP_DESC HELP_DESC +#define MORE_HELP_name HELP_name +#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#endif +#ifdef NO_OPTIONAL_OPT_ARGS +# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ + OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) +#endif +#define VER_DESC (gnutls_cli_debug_opt_strs+1309) +#define VER_name (gnutls_cli_debug_opt_strs+1345) +/** + * Declare option callback procedures + */ +extern tOptProc + optionBooleanVal, optionNestedVal, optionNumericVal, + optionPagedUsage, optionPrintVersion, optionResetOpt, + optionStackArg, optionTimeDate, optionTimeVal, + optionUnstackArg, optionVendorOption; +static tOptProc + doOptApp_Proto, doOptDebug, doOptPort, doUsageOpt; +#define VER_PROC optionPrintVersion + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the gnutls-cli-debug Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the gnutls-cli-debug program responds to. + */ +static tOptDesc optDesc[OPTION_CT] = { + { /* entry idx, value */ 0, VALUE_OPT_DEBUG, + /* equiv idx, value */ 0, VALUE_OPT_DEBUG, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DEBUG_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --debug */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptDebug, + /* desc, NAME, name */ DEBUG_DESC, DEBUG_NAME, DEBUG_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 1, VALUE_OPT_VERBOSE, + /* equiv idx, value */ 1, VALUE_OPT_VERBOSE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, NOLIMIT, 0, + /* opt state flags */ VERBOSE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --verbose */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ VERBOSE_DESC, VERBOSE_NAME, VERBOSE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 2, VALUE_OPT_PORT, + /* equiv idx, value */ 2, VALUE_OPT_PORT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PORT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --port */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptPort, + /* desc, NAME, name */ PORT_DESC, PORT_NAME, PORT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 3, VALUE_OPT_APP_PROTO, + /* equiv idx, value */ 3, VALUE_OPT_APP_PROTO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ APP_PROTO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --app-proto */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptApp_Proto, + /* desc, NAME, name */ APP_PROTO_DESC, APP_PROTO_NAME, APP_PROTO_name, + /* disablement strs */ 0, 0 }, + + { /* entry idx, value */ 4, VALUE_OPT_STARTTLS_PROTO, + /* equiv idx, value */ 4, VALUE_OPT_STARTTLS_PROTO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ STARTTLS_PROTO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --starttls-proto */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ STARTTLS_PROTO_DESC, STARTTLS_PROTO_NAME, STARTTLS_PROTO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VER_FLAGS, AOUSE_VERSION, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ VER_PROC, + /* desc, NAME, name */ VER_DESC, NULL, VER_name, + /* disablement strs */ NULL, NULL }, + + + + { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doUsageOpt, + /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionPagedUsage, + /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, + /* disablement strs */ NULL, NULL } +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** Reference to the upper cased version of gnutls-cli-debug. */ +#define zPROGNAME (gnutls_cli_debug_opt_strs+1353) +/** Reference to the title line for gnutls-cli-debug usage. */ +#define zUsageTitle (gnutls_cli_debug_opt_strs+1370) +/** There is no gnutls-cli-debug configuration file. */ +#define zRcName NULL +/** There are no directories to search for gnutls-cli-debug config files. */ +#define apzHomeList NULL +/** The gnutls-cli-debug program bug email address. */ +#define zBugsAddr (gnutls_cli_debug_opt_strs+1468) +/** Clarification/explanation of what gnutls-cli-debug does. */ +#define zExplain (gnutls_cli_debug_opt_strs+1488) +/** Extra detail explaining what gnutls-cli-debug does. */ +#define zDetail (gnutls_cli_debug_opt_strs+1490) +/** The full version string for gnutls-cli-debug. */ +#define zFullVersion (gnutls_cli_debug_opt_strs+1908) +/* extracted from optcode.tlib near line 364 */ + +#if defined(ENABLE_NLS) +# define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT + static tOptionXlateProc translate_option_strings; +#else +# define OPTPROC_BASE OPTPROC_NONE +# define translate_option_strings NULL +#endif /* ENABLE_NLS */ + +#define gnutls_cli_debug_full_usage (NULL) +#define gnutls_cli_debug_short_usage (gnutls_cli_debug_opt_strs+1935) + +#endif /* not defined __doxygen__ */ + +/* + * Create the static procedure(s) declared above. + */ +/** + * The callout function that invokes the optionUsage function. + * + * @param[in] opts the AutoOpts option description structure + * @param[in] od the descriptor for the "help" (usage) option. + * @noreturn + */ +static void +doUsageOpt(tOptions * opts, tOptDesc * od) +{ + int ex_code; + ex_code = GNUTLS_CLI_DEBUG_EXIT_SUCCESS; + optionUsage(&gnutls_cli_debugOptions, ex_code); + /* NOTREACHED */ + exit(GNUTLS_CLI_DEBUG_EXIT_FAILURE); + (void)opts; + (void)od; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the debug option. + * Specifies the debug level. + * @param[in] pOptions the gnutls-cli-debug options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptDebug(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[1] = { + { 0 , 9999 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 1; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + + emit_ranges: +optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the port option. + * + * @param[in] pOptions the gnutls-cli-debug options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptPort(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[1] = { + { 0 , 65536 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 1; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + + emit_ranges: +optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the app-proto option. + * + * @param[in] pOptions the gnutls-cli-debug options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptApp_Proto(tOptions* pOptions, tOptDesc* pOptDesc) +{ + int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_STARTTLS_PROTO); + if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0)) + USAGE(GNUTLS_CLI_DEBUG_EXIT_USAGE_ERROR); + +} +/* extracted from optmain.tlib near line 1250 */ + +/** + * The directory containing the data associated with gnutls-cli-debug. + */ +#ifndef PKGDATADIR +# define PKGDATADIR "" +#endif + +/** + * Information about the person or institution that packaged gnutls-cli-debug + * for the current distribution. + */ +#ifndef WITH_PACKAGER +# define gnutls_cli_debug_packager_info NULL +#else +/** Packager information for gnutls-cli-debug. */ +static char const gnutls_cli_debug_packager_info[] = + "Packaged by " WITH_PACKAGER + +# ifdef WITH_PACKAGER_VERSION + " ("WITH_PACKAGER_VERSION")" +# endif + +# ifdef WITH_PACKAGER_BUG_REPORTS + "\nReport gnutls_cli_debug bugs to " WITH_PACKAGER_BUG_REPORTS +# endif + "\n"; +#endif +#ifndef __doxygen__ + +#endif /* __doxygen__ */ +/** + * The option definitions for gnutls-cli-debug. The one structure that + * binds them all. + */ +tOptions gnutls_cli_debugOptions = { + OPTIONS_STRUCT_VERSION, + 0, NULL, /* original argc + argv */ + ( OPTPROC_BASE + + OPTPROC_ERRSTOP + + OPTPROC_SHORTOPT + + OPTPROC_LONGOPT + + OPTPROC_NO_REQ_OPT + + OPTPROC_ARGS_REQ + + OPTPROC_REORDER + + OPTPROC_GNUUSAGE + + OPTPROC_MISUSE ), + 0, NULL, /* current option index, current option */ + NULL, NULL, zPROGNAME, + zRcName, zCopyright, zLicenseDescrip, + zFullVersion, apzHomeList, zUsageTitle, + zExplain, zDetail, optDesc, + zBugsAddr, /* address to send bugs to */ + NULL, NULL, /* extensions/saved state */ + optionUsage, /* usage procedure */ + translate_option_strings, /* translation procedure */ + /* + * Indexes to special options + */ + { INDEX_OPT_MORE_HELP, /* more-help option index */ + NO_EQUIVALENT, /* save option index */ + NO_EQUIVALENT, /* '-#' option index */ + NO_EQUIVALENT /* index of default opt */ + }, + 8 /* full option count */, 5 /* user option count */, + gnutls_cli_debug_full_usage, gnutls_cli_debug_short_usage, + NULL, NULL, + PKGDATADIR, gnutls_cli_debug_packager_info +}; + +#if ENABLE_NLS +/** + * This code is designed to translate translatable option text for the + * gnutls-cli-debug program. These translations happen upon entry + * to optionProcess(). + */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#ifdef HAVE_DCGETTEXT +# include <gettext.h> +#endif +#include <autoopts/usage-txt.h> + +static char * AO_gettext(char const * pz); +static void coerce_it(void ** s); + +/** + * AutoGen specific wrapper function for gettext. It relies on the macro _() + * to convert from English to the target language, then strdup-duplicates the + * result string. It tries the "libopts" domain first, then whatever has been + * set via the \a textdomain(3) call. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * +AO_gettext(char const * pz) +{ + char * res; + if (pz == NULL) + return NULL; +#ifdef HAVE_DCGETTEXT + /* + * While processing the option_xlateable_txt data, try to use the + * "libopts" domain. Once we switch to the option descriptor data, + * do *not* use that domain. + */ + if (option_xlateable_txt.field_ct != 0) { + res = dgettext("libopts", pz); + if (res == pz) + res = (char *)VOIDP(_(pz)); + } else + res = (char *)VOIDP(_(pz)); +#else + res = (char *)VOIDP(_(pz)); +#endif + if (res == pz) + return res; + res = strdup(res); + if (res == NULL) { + fputs(_("No memory for duping translated strings\n"), stderr); + exit(GNUTLS_CLI_DEBUG_EXIT_FAILURE); + } + return res; +} + +/** + * All the pointers we use are marked "* const", but they are stored in + * writable memory. Coerce the mutability and set the pointer. + */ +static void coerce_it(void ** s) { *s = AO_gettext(*s); +} + +/** + * Translate all the translatable strings in the gnutls_cli_debugOptions + * structure defined above. This is done only once. + */ +static void +translate_option_strings(void) +{ + tOptions * const opts = &gnutls_cli_debugOptions; + + /* + * Guard against re-translation. It won't work. The strings will have + * been changed by the first pass through this code. One shot only. + */ + if (option_xlateable_txt.field_ct != 0) { + /* + * Do the translations. The first pointer follows the field count + * field. The field count field is the size of a pointer. + */ + char ** ppz = (char**)VOIDP(&(option_xlateable_txt)); + int ix = option_xlateable_txt.field_ct; + + do { + ppz++; /* skip over field_ct */ + *ppz = AO_gettext(*ppz); + } while (--ix > 0); + /* prevent re-translation and disable "libopts" domain lookup */ + option_xlateable_txt.field_ct = 0; + + coerce_it(VOIDP(&(opts->pzCopyright))); + coerce_it(VOIDP(&(opts->pzCopyNotice))); + coerce_it(VOIDP(&(opts->pzFullVersion))); + coerce_it(VOIDP(&(opts->pzUsageTitle))); + coerce_it(VOIDP(&(opts->pzExplain))); + coerce_it(VOIDP(&(opts->pzDetail))); + { + tOptDesc * od = opts->pOptDesc; + for (ix = opts->optCt; ix > 0; ix--, od++) + coerce_it(VOIDP(&(od->pzText))); + } + } +} +#endif /* ENABLE_NLS */ + +#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT +/** I18N function strictly for xgettext. Do not compile. */ +static void bogus_function(void) { + /* TRANSLATORS: + + The following dummy function was crated solely so that xgettext can + extract the correct strings. These strings are actually referenced + by a field name in the gnutls_cli_debugOptions structure noted in the + comments below. The literal text is defined in gnutls_cli_debug_opt_strs. + + NOTE: the strings below are segmented with respect to the source string + gnutls_cli_debug_opt_strs. The strings above are handed off for translation + at run time a paragraph at a time. Consequently, they are presented here + for translation a paragraph at a time. + + ALSO: often the description for an option will reference another option + by name. These are set off with apostrophe quotes (I hope). Do not + translate option names. + */ + /* referenced via gnutls_cli_debugOptions.pzCopyright */ + puts(_("gnutls-cli-debug @VERSION@\n\ +Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n\ +This is free software. It is licensed for use, modification and\n\ +redistribution under the terms of the GNU General Public License,\n\ +version 3 or later <http://gnu.org/licenses/gpl.html>\n")); + + /* referenced via gnutls_cli_debugOptions.pzCopyNotice */ + puts(_("gnutls-cli-debug is free software: you can redistribute it and/or modify it\n\ +under the terms of the GNU General Public License as published by the Free\n\ +Software Foundation, either version 3 of the License, or (at your option)\n\ +any later version.\n\n")); + puts(_("gnutls-cli-debug is distributed in the hope that it will be useful, but\n\ +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n\ +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n\ +for more details.\n\n")); + puts(_("You should have received a copy of the GNU General Public License along\n\ +with this program. If not, see <http://www.gnu.org/licenses/>.\n")); + + /* referenced via gnutls_cli_debugOptions.pOptDesc->pzText */ + puts(_("Enable debugging")); + + /* referenced via gnutls_cli_debugOptions.pOptDesc->pzText */ + puts(_("More verbose output")); + + /* referenced via gnutls_cli_debugOptions.pOptDesc->pzText */ + puts(_("The port to connect to")); + + /* referenced via gnutls_cli_debugOptions.pOptDesc->pzText */ + puts(_("an alias for the 'starttls-proto' option")); + + /* referenced via gnutls_cli_debugOptions.pOptDesc->pzText */ + puts(_("The application protocol to be used to obtain the server's certificate\n\ +(https, ftp, smtp, imap, ldap, xmpp)")); + + /* referenced via gnutls_cli_debugOptions.pOptDesc->pzText */ + puts(_("display extended usage information and exit")); + + /* referenced via gnutls_cli_debugOptions.pOptDesc->pzText */ + puts(_("extended usage information passed thru pager")); + + /* referenced via gnutls_cli_debugOptions.pOptDesc->pzText */ + puts(_("output version information and exit")); + + /* referenced via gnutls_cli_debugOptions.pzUsageTitle */ + puts(_("gnutls-cli-debug - GnuTLS debug client\n\ +Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \n")); + + /* referenced via gnutls_cli_debugOptions.pzExplain */ + puts(_("\n")); + + /* referenced via gnutls_cli_debugOptions.pzDetail */ + puts(_("TLS debug client. It sets up multiple TLS connections to a server and\n\ +queries its capabilities. It was created to assist in debugging GnuTLS,\n\ +but it might be useful to extract a TLS server's capabilities. It connects\n\ +to a TLS server, performs tests and print the server's capabilities. If\n\ +called with the `-v' parameter more checks will be performed. Can be used\n\ +to check for servers with special needs or bugs.\n")); + + /* referenced via gnutls_cli_debugOptions.pzFullVersion */ + puts(_("gnutls-cli-debug @VERSION@")); + + /* referenced via gnutls_cli_debugOptions.pzFullUsage */ + puts(_("<<<NOT-FOUND>>>")); + + /* referenced via gnutls_cli_debugOptions.pzShortUsage */ + puts(_("Usage: gnutls-cli-debug [options] hostname\n\ +gnutls-cli --help for usage instructions.\n")); + /* LIBOPTS-MESSAGES: */ +#line 67 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 93 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 53 "../init.c" + puts(_("AutoOpts function called without option descriptor\n")); +#line 86 "../init.c" + puts(_("\tThis exceeds the compiled library version: ")); +#line 84 "../init.c" + puts(_("Automated Options Processing Error!\n" + "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); +#line 80 "../autoopts.c" + puts(_("realloc of %d bytes at 0x%p failed\n")); +#line 88 "../init.c" + puts(_("\tThis is less than the minimum library version: ")); +#line 121 "../version.c" + puts(_("Automated Options version %s\n" + "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); +#line 87 "../makeshell.c" + puts(_("(AutoOpts bug): %s.\n")); +#line 90 "../reset.c" + puts(_("optionResetOpt() called, but reset-option not configured")); +#line 295 "../usage.c" + puts(_("could not locate the 'help' option")); +#line 336 "../autoopts.c" + puts(_("optionProcess() was called with invalid data")); +#line 751 "../usage.c" + puts(_("invalid argument type specified")); +#line 598 "../find.c" + puts(_("defaulted to option with optional arg")); +#line 76 "../alias.c" + puts(_("aliasing option is out of range.")); +#line 235 "../enum.c" + puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); +#line 108 "../find.c" + puts(_(" The following options match:\n")); +#line 293 "../find.c" + puts(_("%s: ambiguous option name: %s (matches %d options)\n")); +#line 161 "../check.c" + puts(_("%s: Command line arguments required\n")); +#line 43 "../alias.c" + puts(_("%d %s%s options allowed\n")); +#line 94 "../makeshell.c" + puts(_("%s error %d (%s) calling %s for '%s'\n")); +#line 306 "../makeshell.c" + puts(_("interprocess pipe")); +#line 168 "../version.c" + puts(_("error: version option argument '%c' invalid. Use:\n" + "\t'v' - version only\n" + "\t'c' - version and copyright\n" + "\t'n' - version and full copyright notice\n")); +#line 58 "../check.c" + puts(_("%s error: the '%s' and '%s' options conflict\n")); +#line 217 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 430 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 38 "../alias.c" + puts(_("-equivalence")); +#line 469 "../find.c" + puts(_("%s: illegal option -- %c\n")); +#line 110 "../reset.c" + puts(_("%s: illegal option -- %c\n")); +#line 271 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 755 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 118 "../reset.c" + puts(_("%s: illegal option -- %s\n")); +#line 335 "../find.c" + puts(_("%s: unknown vendor extension option -- %s\n")); +#line 160 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 170 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 750 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 1084 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 385 "../find.c" + puts(_("%s: invalid option name: %s\n")); +#line 527 "../find.c" + puts(_("%s: The '%s' option requires an argument.\n")); +#line 156 "../autoopts.c" + puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" + "\t'%s' and '%s'.")); +#line 94 "../check.c" + puts(_("%s error: The %s option is required\n")); +#line 632 "../find.c" + puts(_("%s: The '%s' option cannot have an argument.\n")); +#line 151 "../check.c" + puts(_("%s: Command line arguments are not allowed.\n")); +#line 536 "../save.c" + puts(_("error %d (%s) creating %s\n")); +#line 235 "../enum.c" + puts(_("%s error: '%s' does not match any %s keywords.\n")); +#line 93 "../reset.c" + puts(_("%s error: The '%s' option requires an argument.\n")); +#line 186 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 239 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 143 "../restore.c" + puts(_("%s error: no saved option state\n")); +#line 231 "../autoopts.c" + puts(_("'%s' is not a command line option.\n")); +#line 113 "../time.c" + puts(_("%s error: '%s' is not a recognizable date/time.\n")); +#line 131 "../save.c" + puts(_("'%s' not defined\n")); +#line 50 "../time.c" + puts(_("%s error: '%s' is not a recognizable time duration.\n")); +#line 92 "../check.c" + puts(_("%s error: The %s option must appear %d times.\n")); +#line 165 "../numeric.c" + puts(_("%s error: '%s' is not a recognizable number.\n")); +#line 201 "../enum.c" + puts(_("%s error: %s exceeds %s keyword count\n")); +#line 333 "../usage.c" + puts(_("Try '%s %s' for more information.\n")); +#line 45 "../alias.c" + puts(_("one %s%s option allowed\n")); +#line 208 "../makeshell.c" + puts(_("standard output")); +#line 943 "../makeshell.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard output")); +#line 418 "../usage.c" + puts(_("standard output")); +#line 628 "../usage.c" + puts(_("standard output")); +#line 175 "../version.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard error")); +#line 418 "../usage.c" + puts(_("standard error")); +#line 628 "../usage.c" + puts(_("standard error")); +#line 175 "../version.c" + puts(_("standard error")); +#line 208 "../makeshell.c" + puts(_("write")); +#line 943 "../makeshell.c" + puts(_("write")); +#line 276 "../usage.c" + puts(_("write")); +#line 417 "../usage.c" + puts(_("write")); +#line 627 "../usage.c" + puts(_("write")); +#line 174 "../version.c" + puts(_("write")); +#line 60 "../numeric.c" + puts(_("%s error: %s option value %ld is out of range.\n")); +#line 44 "../check.c" + puts(_("%s error: %s option requires the %s option\n")); +#line 130 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 185 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 238 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 257 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 535 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); + /* END-LIBOPTS-MESSAGES */ + + /* USAGE-TEXT: */ +#line 876 "../usage.c" + puts(_("\t\t\t\t- an alternate for '%s'\n")); +#line 1151 "../usage.c" + puts(_("Version, usage and configuration options:")); +#line 927 "../usage.c" + puts(_("\t\t\t\t- default option for unnamed options\n")); +#line 840 "../usage.c" + puts(_("\t\t\t\t- disabled as '--%s'\n")); +#line 1120 "../usage.c" + puts(_(" --- %-14s %s\n")); +#line 1118 "../usage.c" + puts(_("This option has been disabled")); +#line 867 "../usage.c" + puts(_("\t\t\t\t- enabled by default\n")); +#line 40 "../alias.c" + puts(_("%s error: only ")); +#line 1197 "../usage.c" + puts(_(" - examining environment variables named %s_*\n")); +#line 168 "../file.c" + puts(_("\t\t\t\t- file must not pre-exist\n")); +#line 172 "../file.c" + puts(_("\t\t\t\t- file must pre-exist\n")); +#line 383 "../usage.c" + puts(_("Options are specified by doubled hyphens and their name or by a single\n" + "hyphen and the flag character.\n")); +#line 921 "../makeshell.c" + puts(_("\n" + "= = = = = = = =\n\n" + "This incarnation of genshell will produce\n" + "a shell script to parse the options for %s:\n\n")); +#line 167 "../enum.c" + puts(_(" or an integer mask with any of the lower %d bits set\n")); +#line 900 "../usage.c" + puts(_("\t\t\t\t- is a set membership option\n")); +#line 921 "../usage.c" + puts(_("\t\t\t\t- must appear between %d and %d times\n")); +#line 385 "../usage.c" + puts(_("Options are specified by single or double hyphens and their name.\n")); +#line 907 "../usage.c" + puts(_("\t\t\t\t- may appear multiple times\n")); +#line 894 "../usage.c" + puts(_("\t\t\t\t- may not be preset\n")); +#line 1312 "../usage.c" + puts(_(" Arg Option-Name Description\n")); +#line 1248 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1306 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1307 "../usage.c" + puts(_(" %3s %s")); +#line 1313 "../usage.c" + puts(_(" %3s %s")); +#line 390 "../usage.c" + puts(_("The '-#<number>' option may omit the hash char\n")); +#line 386 "../usage.c" + puts(_("All arguments are named options.\n")); +#line 974 "../usage.c" + puts(_(" - reading file %s")); +#line 412 "../usage.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 100 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 129 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 906 "../usage.c" + puts(_("\t\t\t\t- may NOT appear - preset only\n")); +#line 947 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 1195 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 685 "../usage.c" + puts(_("prohibits these options:\n")); +#line 680 "../usage.c" + puts(_("prohibits the option '%s'\n")); +#line 81 "../numeric.c" + puts(_("%s%ld to %ld")); +#line 79 "../numeric.c" + puts(_("%sgreater than or equal to %ld")); +#line 75 "../numeric.c" + puts(_("%s%ld exactly")); +#line 68 "../numeric.c" + puts(_("%sit must lie in one of the ranges:\n")); +#line 68 "../numeric.c" + puts(_("%sit must be in the range:\n")); +#line 88 "../numeric.c" + puts(_(", or\n")); +#line 66 "../numeric.c" + puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); +#line 77 "../numeric.c" + puts(_("%sless than or equal to %ld")); +#line 393 "../usage.c" + puts(_("Operands and options may be intermixed. They will be reordered.\n")); +#line 655 "../usage.c" + puts(_("requires the option '%s'\n")); +#line 658 "../usage.c" + puts(_("requires these options:\n")); +#line 1324 "../usage.c" + puts(_(" Arg Option-Name Req? Description\n")); +#line 1318 "../usage.c" + puts(_(" Flg Arg Option-Name Req? Description\n")); +#line 168 "../enum.c" + puts(_("or you may use a numeric representation. Preceding these with a '!'\n" + "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" + "will set them all. Multiple entries may be passed as an option\n" + "argument list.\n")); +#line 913 "../usage.c" + puts(_("\t\t\t\t- may appear up to %d times\n")); +#line 77 "../enum.c" + puts(_("The valid \"%s\" option keywords are:\n")); +#line 1155 "../usage.c" + puts(_("The next option supports vendor supported extra options:")); +#line 776 "../usage.c" + puts(_("These additional options are:")); + /* END-USAGE-TEXT */ +} +#endif /* uncompilable code */ +#ifdef __cplusplus +} +#endif +/* cli-debug-args.c ends here */ diff --git a/src/cli-debug-args.h.bak b/src/cli-debug-args.h.bak new file mode 100644 index 0000000000..10cb4036a4 --- /dev/null +++ b/src/cli-debug-args.h.bak @@ -0,0 +1,223 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (cli-debug-args.h) + * + * It has been AutoGen-ed + * From the definitions cli-debug-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the gnutls-cli-debug author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The gnutls-cli-debug program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * gnutls-cli-debug is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * gnutls-cli-debug is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ +/** + * This file contains the programmatic interface to the Automated + * Options generated for the gnutls-cli-debug program. + * These macros are documented in the AutoGen info file in the + * "AutoOpts" chapter. Please refer to that doc for usage help. + */ +#ifndef AUTOOPTS_CLI_DEBUG_ARGS_H_GUARD +#define AUTOOPTS_CLI_DEBUG_ARGS_H_GUARD 1 +#include "config.h" +#include <autoopts/options.h> + +/** + * Ensure that the library used for compiling this generated header is at + * least as new as the version current when the header template was released + * (not counting patch version increments). Also ensure that the oldest + * tolerable version is at least as old as what was current when the header + * template was released. + */ +#define AO_TEMPLATE_VERSION 167937 +#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ + || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) +# error option template version mismatches autoopts/options.h header + Choke Me. +#endif + +/** + * Enumeration of each option type for gnutls-cli-debug + */ +typedef enum { + INDEX_OPT_DEBUG = 0, + INDEX_OPT_VERBOSE = 1, + INDEX_OPT_PORT = 2, + INDEX_OPT_APP_PROTO = 3, + INDEX_OPT_STARTTLS_PROTO = 4, + INDEX_OPT_VERSION = 5, + INDEX_OPT_HELP = 6, + INDEX_OPT_MORE_HELP = 7 +} teOptIndex; +/** count of all options for gnutls-cli-debug */ +#define OPTION_CT 8 +/** gnutls-cli-debug version */ +#define GNUTLS_CLI_DEBUG_VERSION "@VERSION@" +/** Full gnutls-cli-debug version text */ +#define GNUTLS_CLI_DEBUG_FULL_VERSION "gnutls-cli-debug @VERSION@" + +/** + * Interface defines for all options. Replace "n" with the UPPER_CASED + * option name (as in the teOptIndex enumeration above). + * e.g. HAVE_OPT(DEBUG) + */ +#define DESC(n) (gnutls_cli_debugOptions.pOptDesc[INDEX_OPT_## n]) +/** 'true' if an option has been specified in any way */ +#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) +/** The string argument to an option. The argument type must be \"string\". */ +#define OPT_ARG(n) (DESC(n).optArg.argString) +/** Mask the option state revealing how an option was specified. + * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET, + * \a OPTST_DEFINED, \a OPTST_RESET or zero. + */ +#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) +/** Count of option's occurrances *on the command line*. */ +#define COUNT_OPT(n) (DESC(n).optOccCt) +/** mask of \a OPTST_SET and \a OPTST_DEFINED. */ +#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) +/** 'true' if \a HAVE_OPT would yield 'false'. */ +#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) +/** 'true' if OPTST_DISABLED bit not set. */ +#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) +/** number of stacked option arguments. + * Valid only for stacked option arguments. */ +#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) +/** stacked argument vector. + * Valid only for stacked option arguments. */ +#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) +/** Reset an option. */ +#define CLEAR_OPT(n) STMTS( \ + DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + DESC(n).fOptState |= OPTST_DISABLED; \ + DESC(n).optCookie = NULL ) +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Enumeration of gnutls-cli-debug exit codes + */ +typedef enum { + GNUTLS_CLI_DEBUG_EXIT_SUCCESS = 0, + GNUTLS_CLI_DEBUG_EXIT_FAILURE = 1, + GNUTLS_CLI_DEBUG_EXIT_USAGE_ERROR = 64, + GNUTLS_CLI_DEBUG_EXIT_LIBOPTS_FAILURE = 70 +} gnutls_cli_debug_exit_code_t; +/** + * Interface defines for specific options. + * @{ + */ +#define VALUE_OPT_DEBUG 'd' + +#define OPT_VALUE_DEBUG (DESC(DEBUG).optArg.argInt) +#define VALUE_OPT_VERBOSE 'V' +#define VALUE_OPT_PORT 'p' + +#define OPT_VALUE_PORT (DESC(PORT).optArg.argInt) +#define VALUE_OPT_APP_PROTO 0x1001 +#define VALUE_OPT_STARTTLS_PROTO 0x1002 +/** option flag (value) for help-value option */ +#define VALUE_OPT_HELP 'h' +/** option flag (value) for more-help-value option */ +#define VALUE_OPT_MORE_HELP '!' +/** option flag (value) for version-value option */ +#define VALUE_OPT_VERSION 'v' +/* + * Interface defines not associated with particular options + */ +#define ERRSKIP_OPTERR STMTS(gnutls_cli_debugOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(gnutls_cli_debugOptions.fOptSet |= OPTPROC_ERRSTOP) +#define RESTART_OPT(n) STMTS( \ + gnutls_cli_debugOptions.curOptIdx = (n); \ + gnutls_cli_debugOptions.pzCurOpt = NULL ) +#define START_OPT RESTART_OPT(1) +#define USAGE(c) (*gnutls_cli_debugOptions.pUsageProc)(&gnutls_cli_debugOptions, c) + +#ifdef __cplusplus +extern "C" { +#endif +/* + * global exported definitions + */ +#include <gettext.h> + + +/* * * * * * + * + * Declare the gnutls-cli-debug option descriptor. + */ +extern tOptions gnutls_cli_debugOptions; + +#if defined(ENABLE_NLS) +# ifndef _ +# include <stdio.h> +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include <libintl.h> +# endif + +# ifndef ATTRIBUTE_FORMAT_ARG +# define ATTRIBUTE_FORMAT_ARG(_a) +# endif + +static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1); +static inline char* aoGetsText(char const* pz) { + if (pz == NULL) return NULL; + return (char*)gettext(pz); +} +# define _(s) aoGetsText(s) +# endif /* _() */ + +# define OPT_NO_XLAT_CFG_NAMES STMTS(gnutls_cli_debugOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT_CFG;) +# define OPT_NO_XLAT_OPT_NAMES STMTS(gnutls_cli_debugOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) + +# define OPT_XLAT_CFG_NAMES STMTS(gnutls_cli_debugOptions.fOptSet &= \ + ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) +# define OPT_XLAT_OPT_NAMES STMTS(gnutls_cli_debugOptions.fOptSet &= \ + ~OPTPROC_NXLAT_OPT;) + +#else /* ENABLE_NLS */ +# define OPT_NO_XLAT_CFG_NAMES +# define OPT_NO_XLAT_OPT_NAMES + +# define OPT_XLAT_CFG_NAMES +# define OPT_XLAT_OPT_NAMES + +# ifndef _ +# define _(_s) _s +# endif +#endif /* ENABLE_NLS */ + +#ifdef __cplusplus +} +#endif +#endif /* AUTOOPTS_CLI_DEBUG_ARGS_H_GUARD */ + +/* cli-debug-args.h ends here */ diff --git a/src/danetool-args.c.bak b/src/danetool-args.c.bak new file mode 100644 index 0000000000..066f6d2d66 --- /dev/null +++ b/src/danetool-args.c.bak @@ -0,0 +1,1723 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (danetool-args.c) + * + * It has been AutoGen-ed + * From the definitions danetool-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the danetool author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The danetool program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * danetool is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * danetool is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "danetool-args.h" +#include <sys/types.h> + +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> + +#ifdef __cplusplus +extern "C" { +#endif +extern FILE * option_usage_fp; +#define zCopyright (danetool_opt_strs+0) +#define zLicenseDescrip (danetool_opt_strs+289) + + +#ifndef NULL +# define NULL 0 +#endif + +/** + * static const strings for danetool options + */ +static char const danetool_opt_strs[2849] = +/* 0 */ "danetool @VERSION@\n" + "Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n" + "This is free software. It is licensed for use, modification and\n" + "redistribution under the terms of the GNU General Public License,\n" + "version 3 or later <http://gnu.org/licenses/gpl.html>\n\0" +/* 289 */ "danetool is free software: you can redistribute it and/or modify it under\n" + "the terms of the GNU General Public License as published by the Free\n" + "Software Foundation, either version 3 of the License, or (at your option)\n" + "any later version.\n\n" + "danetool is distributed in the hope that it will be useful, but WITHOUT ANY\n" + "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n" + "FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n" + "details.\n\n" + "You should have received a copy of the GNU General Public License along\n" + "with this program. If not, see <http://www.gnu.org/licenses/>.\n\0" +/* 894 */ "Enable debugging\0" +/* 911 */ "DEBUG\0" +/* 917 */ "debug\0" +/* 923 */ "More verbose output\0" +/* 943 */ "VERBOSE\0" +/* 951 */ "verbose\0" +/* 959 */ "Input file\0" +/* 970 */ "INFILE\0" +/* 977 */ "infile\0" +/* 984 */ "Output file\0" +/* 996 */ "OUTFILE\0" +/* 1004 */ "outfile\0" +/* 1012 */ "Loads a public key file\0" +/* 1036 */ "LOAD_PUBKEY\0" +/* 1048 */ "load-pubkey\0" +/* 1060 */ "Loads a certificate file\0" +/* 1085 */ "LOAD_CERTIFICATE\0" +/* 1102 */ "load-certificate\0" +/* 1119 */ "Sets a DLV file\0" +/* 1135 */ "DLV\0" +/* 1139 */ "dlv\0" +/* 1143 */ "Hash algorithm to use for signing\0" +/* 1177 */ "HASH\0" +/* 1182 */ "hash\0" +/* 1187 */ "Check a host's DANE TLSA entry\0" +/* 1218 */ "CHECK\0" +/* 1224 */ "check\0" +/* 1230 */ "Check only the end-entity's certificate\0" +/* 1270 */ "CHECK_EE\0" +/* 1279 */ "check-ee\0" +/* 1288 */ "Check only the CA's certificate\0" +/* 1320 */ "CHECK_CA\0" +/* 1329 */ "check-ca\0" +/* 1338 */ "Print the DANE RR data on a certificate or public key\0" +/* 1392 */ "TLSA_RR\0" +/* 1400 */ "tlsa-rr\0" +/* 1408 */ "Specify the hostname to be used in the DANE RR\0" +/* 1455 */ "HOST\0" +/* 1460 */ "host\0" +/* 1465 */ "The protocol set for DANE data (tcp, udp etc.)\0" +/* 1512 */ "PROTO\0" +/* 1518 */ "proto\0" +/* 1524 */ "The port or service to connect to, for DANE data\0" +/* 1573 */ "PORT\0" +/* 1578 */ "port\0" +/* 1583 */ "an alias for the 'starttls-proto' option\0" +/* 1624 */ "app-proto\0" +/* 1634 */ "The application protocol to be used to obtain the server's certificate\n" + "(https, ftp, smtp, imap, ldap, xmpp)\0" +/* 1742 */ "STARTTLS_PROTO\0" +/* 1757 */ "starttls-proto\0" +/* 1772 */ "Whether the provided certificate or public key is a Certificate\n" + "Authority\0" +/* 1846 */ "CA\0" +/* 1849 */ "ca\0" +/* 1852 */ "Use the hash of the X.509 certificate, rather than the public key\0" +/* 1918 */ "X509\0" +/* 1923 */ "x509\0" +/* 1928 */ "an alias for the 'domain' option\0" +/* 1961 */ "local\0" +/* 1967 */ "The provided certificate or public key is issued by the local domain\0" +/* 2036 */ "DOMAIN\0" +/* 2043 */ "no-domain\0" +/* 2053 */ "no\0" +/* 2056 */ "Use the local DNS server for DNSSEC resolving\0" +/* 2102 */ "LOCAL_DNS\0" +/* 2112 */ "no-local-dns\0" +/* 2125 */ "Do not verify any DNSSEC signature\0" +/* 2160 */ "INSECURE\0" +/* 2169 */ "insecure\0" +/* 2178 */ "Use DER format for input certificates and private keys\0" +/* 2233 */ "INDER\0" +/* 2239 */ "no-inder\0" +/* 2248 */ "an alias for the 'inder' option\0" +/* 2280 */ "inraw\0" +/* 2286 */ "Print the received DANE data in raw format\0" +/* 2329 */ "PRINT_RAW\0" +/* 2339 */ "no-print-raw\0" +/* 2352 */ "Suppress several informational messages\0" +/* 2392 */ "QUIET\0" +/* 2398 */ "quiet\0" +/* 2404 */ "display extended usage information and exit\0" +/* 2448 */ "help\0" +/* 2453 */ "extended usage information passed thru pager\0" +/* 2498 */ "more-help\0" +/* 2508 */ "output version information and exit\0" +/* 2544 */ "version\0" +/* 2552 */ "DANETOOL\0" +/* 2561 */ "danetool - GnuTLS DANE tool\n" + "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0" +/* 2647 */ "@PACKAGE_BUGREPORT@\0" +/* 2667 */ "\n\0" +/* 2669 */ "Tool to generate and check DNS resource records for the DANE protocol.\n\0" +/* 2741 */ "danetool @VERSION@\0" +/* 2760 */ "danetool --[tlsa-rr|check] [options]\n" + "danetool --help for additional usage instructions.\n"; + +/** + * debug option description: + */ +/** Descriptive text for the debug option */ +#define DEBUG_DESC (danetool_opt_strs+894) +/** Upper-cased name for the debug option */ +#define DEBUG_NAME (danetool_opt_strs+911) +/** Name string for the debug option */ +#define DEBUG_name (danetool_opt_strs+917) +/** Compiled in flag settings for the debug option */ +#define DEBUG_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * verbose option description: + */ +/** Descriptive text for the verbose option */ +#define VERBOSE_DESC (danetool_opt_strs+923) +/** Upper-cased name for the verbose option */ +#define VERBOSE_NAME (danetool_opt_strs+943) +/** Name string for the verbose option */ +#define VERBOSE_name (danetool_opt_strs+951) +/** Compiled in flag settings for the verbose option */ +#define VERBOSE_FLAGS (OPTST_DISABLED) + +/** + * infile option description: + */ +/** Descriptive text for the infile option */ +#define INFILE_DESC (danetool_opt_strs+959) +/** Upper-cased name for the infile option */ +#define INFILE_NAME (danetool_opt_strs+970) +/** Name string for the infile option */ +#define INFILE_name (danetool_opt_strs+977) +/** Compiled in flag settings for the infile option */ +#define INFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * outfile option description: + */ +/** Descriptive text for the outfile option */ +#define OUTFILE_DESC (danetool_opt_strs+984) +/** Upper-cased name for the outfile option */ +#define OUTFILE_NAME (danetool_opt_strs+996) +/** Name string for the outfile option */ +#define OUTFILE_name (danetool_opt_strs+1004) +/** Compiled in flag settings for the outfile option */ +#define OUTFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * load-pubkey option description: + */ +/** Descriptive text for the load-pubkey option */ +#define LOAD_PUBKEY_DESC (danetool_opt_strs+1012) +/** Upper-cased name for the load-pubkey option */ +#define LOAD_PUBKEY_NAME (danetool_opt_strs+1036) +/** Name string for the load-pubkey option */ +#define LOAD_PUBKEY_name (danetool_opt_strs+1048) +/** Compiled in flag settings for the load-pubkey option */ +#define LOAD_PUBKEY_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * load-certificate option description: + */ +/** Descriptive text for the load-certificate option */ +#define LOAD_CERTIFICATE_DESC (danetool_opt_strs+1060) +/** Upper-cased name for the load-certificate option */ +#define LOAD_CERTIFICATE_NAME (danetool_opt_strs+1085) +/** Name string for the load-certificate option */ +#define LOAD_CERTIFICATE_name (danetool_opt_strs+1102) +/** Compiled in flag settings for the load-certificate option */ +#define LOAD_CERTIFICATE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * dlv option description: + */ +/** Descriptive text for the dlv option */ +#define DLV_DESC (danetool_opt_strs+1119) +/** Upper-cased name for the dlv option */ +#define DLV_NAME (danetool_opt_strs+1135) +/** Name string for the dlv option */ +#define DLV_name (danetool_opt_strs+1139) +/** Compiled in flag settings for the dlv option */ +#define DLV_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * hash option description: + */ +/** Descriptive text for the hash option */ +#define HASH_DESC (danetool_opt_strs+1143) +/** Upper-cased name for the hash option */ +#define HASH_NAME (danetool_opt_strs+1177) +/** Name string for the hash option */ +#define HASH_name (danetool_opt_strs+1182) +/** Compiled in flag settings for the hash option */ +#define HASH_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * check option description: + */ +/** Descriptive text for the check option */ +#define CHECK_DESC (danetool_opt_strs+1187) +/** Upper-cased name for the check option */ +#define CHECK_NAME (danetool_opt_strs+1218) +/** Name string for the check option */ +#define CHECK_name (danetool_opt_strs+1224) +/** Compiled in flag settings for the check option */ +#define CHECK_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * check-ee option description: + */ +/** Descriptive text for the check-ee option */ +#define CHECK_EE_DESC (danetool_opt_strs+1230) +/** Upper-cased name for the check-ee option */ +#define CHECK_EE_NAME (danetool_opt_strs+1270) +/** Name string for the check-ee option */ +#define CHECK_EE_name (danetool_opt_strs+1279) +/** Compiled in flag settings for the check-ee option */ +#define CHECK_EE_FLAGS (OPTST_DISABLED) + +/** + * check-ca option description: + */ +/** Descriptive text for the check-ca option */ +#define CHECK_CA_DESC (danetool_opt_strs+1288) +/** Upper-cased name for the check-ca option */ +#define CHECK_CA_NAME (danetool_opt_strs+1320) +/** Name string for the check-ca option */ +#define CHECK_CA_name (danetool_opt_strs+1329) +/** Compiled in flag settings for the check-ca option */ +#define CHECK_CA_FLAGS (OPTST_DISABLED) + +/** + * tlsa-rr option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the tlsa-rr option */ +#define TLSA_RR_DESC (danetool_opt_strs+1338) +/** Upper-cased name for the tlsa-rr option */ +#define TLSA_RR_NAME (danetool_opt_strs+1392) +/** Name string for the tlsa-rr option */ +#define TLSA_RR_name (danetool_opt_strs+1400) +/** Other options that are required by the tlsa-rr option */ +static int const aTlsa_RrMustList[] = { + INDEX_OPT_HOST, NO_EQUIVALENT }; +/** Compiled in flag settings for the tlsa-rr option */ +#define TLSA_RR_FLAGS (OPTST_DISABLED) + +/** + * host option description: + */ +/** Descriptive text for the host option */ +#define HOST_DESC (danetool_opt_strs+1408) +/** Upper-cased name for the host option */ +#define HOST_NAME (danetool_opt_strs+1455) +/** Name string for the host option */ +#define HOST_name (danetool_opt_strs+1460) +/** Compiled in flag settings for the host option */ +#define HOST_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * proto option description: + */ +/** Descriptive text for the proto option */ +#define PROTO_DESC (danetool_opt_strs+1465) +/** Upper-cased name for the proto option */ +#define PROTO_NAME (danetool_opt_strs+1512) +/** Name string for the proto option */ +#define PROTO_name (danetool_opt_strs+1518) +/** Compiled in flag settings for the proto option */ +#define PROTO_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * port option description: + */ +/** Descriptive text for the port option */ +#define PORT_DESC (danetool_opt_strs+1524) +/** Upper-cased name for the port option */ +#define PORT_NAME (danetool_opt_strs+1573) +/** Name string for the port option */ +#define PORT_name (danetool_opt_strs+1578) +/** Compiled in flag settings for the port option */ +#define PORT_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * app-proto option description: + */ +/** Descriptive text for the app-proto option */ +#define APP_PROTO_DESC (danetool_opt_strs+1583) +#define APP_PROTO_NAME NULL +/** Unmodified name string for the app-proto option */ +#define APP_PROTO_name (danetool_opt_strs+1624) +/** Compiled in flag settings for the app-proto option */ +#define APP_PROTO_FLAGS (STARTTLS_PROTO_FLAGS | OPTST_ALIAS) + +/** + * starttls-proto option description: + */ +/** Descriptive text for the starttls-proto option */ +#define STARTTLS_PROTO_DESC (danetool_opt_strs+1634) +/** Upper-cased name for the starttls-proto option */ +#define STARTTLS_PROTO_NAME (danetool_opt_strs+1742) +/** Name string for the starttls-proto option */ +#define STARTTLS_PROTO_name (danetool_opt_strs+1757) +/** Compiled in flag settings for the starttls-proto option */ +#define STARTTLS_PROTO_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * ca option description: + */ +/** Descriptive text for the ca option */ +#define CA_DESC (danetool_opt_strs+1772) +/** Upper-cased name for the ca option */ +#define CA_NAME (danetool_opt_strs+1846) +/** Name string for the ca option */ +#define CA_name (danetool_opt_strs+1849) +/** Compiled in flag settings for the ca option */ +#define CA_FLAGS (OPTST_DISABLED) + +/** + * x509 option description: + */ +/** Descriptive text for the x509 option */ +#define X509_DESC (danetool_opt_strs+1852) +/** Upper-cased name for the x509 option */ +#define X509_NAME (danetool_opt_strs+1918) +/** Name string for the x509 option */ +#define X509_name (danetool_opt_strs+1923) +/** Compiled in flag settings for the x509 option */ +#define X509_FLAGS (OPTST_DISABLED) + +/** + * local option description: + */ +/** Descriptive text for the local option */ +#define LOCAL_DESC (danetool_opt_strs+1928) +#define LOCAL_NAME NULL +/** Unmodified name string for the local option */ +#define LOCAL_name (danetool_opt_strs+1961) +/** Compiled in flag settings for the local option */ +#define LOCAL_FLAGS (DOMAIN_FLAGS | OPTST_ALIAS) + +/** + * domain option description: + */ +/** Descriptive text for the domain option */ +#define DOMAIN_DESC (danetool_opt_strs+1967) +/** Upper-cased name for the domain option */ +#define DOMAIN_NAME (danetool_opt_strs+2036) +/** disablement name for the domain option */ +#define NOT_DOMAIN_name (danetool_opt_strs+2043) +/** disablement prefix for the domain option */ +#define NOT_DOMAIN_PFX (danetool_opt_strs+2053) +/** Name string for the domain option */ +#define DOMAIN_name (NOT_DOMAIN_name + 3) +/** Compiled in flag settings for the domain option */ +#define DOMAIN_FLAGS (OPTST_INITENABLED) + +/** + * local-dns option description: + */ +/** Descriptive text for the local-dns option */ +#define LOCAL_DNS_DESC (danetool_opt_strs+2056) +/** Upper-cased name for the local-dns option */ +#define LOCAL_DNS_NAME (danetool_opt_strs+2102) +/** disablement name for the local-dns option */ +#define NOT_LOCAL_DNS_name (danetool_opt_strs+2112) +/** disablement prefix for the local-dns option */ +#define NOT_LOCAL_DNS_PFX (danetool_opt_strs+2053) +/** Name string for the local-dns option */ +#define LOCAL_DNS_name (NOT_LOCAL_DNS_name + 3) +/** Compiled in flag settings for the local-dns option */ +#define LOCAL_DNS_FLAGS (OPTST_DISABLED) + +/** + * insecure option description: + */ +/** Descriptive text for the insecure option */ +#define INSECURE_DESC (danetool_opt_strs+2125) +/** Upper-cased name for the insecure option */ +#define INSECURE_NAME (danetool_opt_strs+2160) +/** Name string for the insecure option */ +#define INSECURE_name (danetool_opt_strs+2169) +/** Compiled in flag settings for the insecure option */ +#define INSECURE_FLAGS (OPTST_DISABLED) + +/** + * inder option description: + */ +/** Descriptive text for the inder option */ +#define INDER_DESC (danetool_opt_strs+2178) +/** Upper-cased name for the inder option */ +#define INDER_NAME (danetool_opt_strs+2233) +/** disablement name for the inder option */ +#define NOT_INDER_name (danetool_opt_strs+2239) +/** disablement prefix for the inder option */ +#define NOT_INDER_PFX (danetool_opt_strs+2053) +/** Name string for the inder option */ +#define INDER_name (NOT_INDER_name + 3) +/** Compiled in flag settings for the inder option */ +#define INDER_FLAGS (OPTST_DISABLED) + +/** + * inraw option description: + */ +/** Descriptive text for the inraw option */ +#define INRAW_DESC (danetool_opt_strs+2248) +#define INRAW_NAME NULL +/** Unmodified name string for the inraw option */ +#define INRAW_name (danetool_opt_strs+2280) +/** Compiled in flag settings for the inraw option */ +#define INRAW_FLAGS (INDER_FLAGS | OPTST_ALIAS) + +/** + * print-raw option description: + */ +/** Descriptive text for the print-raw option */ +#define PRINT_RAW_DESC (danetool_opt_strs+2286) +/** Upper-cased name for the print-raw option */ +#define PRINT_RAW_NAME (danetool_opt_strs+2329) +/** disablement name for the print-raw option */ +#define NOT_PRINT_RAW_name (danetool_opt_strs+2339) +/** disablement prefix for the print-raw option */ +#define NOT_PRINT_RAW_PFX (danetool_opt_strs+2053) +/** Name string for the print-raw option */ +#define PRINT_RAW_name (NOT_PRINT_RAW_name + 3) +/** Compiled in flag settings for the print-raw option */ +#define PRINT_RAW_FLAGS (OPTST_DISABLED) + +/** + * quiet option description: + */ +/** Descriptive text for the quiet option */ +#define QUIET_DESC (danetool_opt_strs+2352) +/** Upper-cased name for the quiet option */ +#define QUIET_NAME (danetool_opt_strs+2392) +/** Name string for the quiet option */ +#define QUIET_name (danetool_opt_strs+2398) +/** Compiled in flag settings for the quiet option */ +#define QUIET_FLAGS (OPTST_DISABLED) + +/* + * Help/More_Help/Version option descriptions: + */ +#define HELP_DESC (danetool_opt_strs+2404) +#define HELP_name (danetool_opt_strs+2448) +#ifdef HAVE_WORKING_FORK +#define MORE_HELP_DESC (danetool_opt_strs+2453) +#define MORE_HELP_name (danetool_opt_strs+2498) +#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +#define MORE_HELP_DESC HELP_DESC +#define MORE_HELP_name HELP_name +#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#endif +#ifdef NO_OPTIONAL_OPT_ARGS +# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ + OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) +#endif +#define VER_DESC (danetool_opt_strs+2508) +#define VER_name (danetool_opt_strs+2544) +/** + * Declare option callback procedures + */ +extern tOptProc + optionBooleanVal, optionNestedVal, optionNumericVal, + optionPagedUsage, optionPrintVersion, optionResetOpt, + optionStackArg, optionTimeDate, optionTimeVal, + optionUnstackArg, optionVendorOption; +static tOptProc + doOptApp_Proto, doOptDebug, doOptInfile, doOptInraw, + doOptLocal, doUsageOpt; +#define VER_PROC optionPrintVersion + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the danetool Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the danetool program responds to. + */ +static tOptDesc optDesc[OPTION_CT] = { + { /* entry idx, value */ 0, VALUE_OPT_DEBUG, + /* equiv idx, value */ 0, VALUE_OPT_DEBUG, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DEBUG_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --debug */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptDebug, + /* desc, NAME, name */ DEBUG_DESC, DEBUG_NAME, DEBUG_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 1, VALUE_OPT_VERBOSE, + /* equiv idx, value */ 1, VALUE_OPT_VERBOSE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, NOLIMIT, 0, + /* opt state flags */ VERBOSE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --verbose */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ VERBOSE_DESC, VERBOSE_NAME, VERBOSE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 2, VALUE_OPT_INFILE, + /* equiv idx, value */ 2, VALUE_OPT_INFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --infile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptInfile, + /* desc, NAME, name */ INFILE_DESC, INFILE_NAME, INFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 3, VALUE_OPT_OUTFILE, + /* equiv idx, value */ 3, VALUE_OPT_OUTFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OUTFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --outfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ OUTFILE_DESC, OUTFILE_NAME, OUTFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 4, VALUE_OPT_LOAD_PUBKEY, + /* equiv idx, value */ 4, VALUE_OPT_LOAD_PUBKEY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_PUBKEY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-pubkey */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LOAD_PUBKEY_DESC, LOAD_PUBKEY_NAME, LOAD_PUBKEY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 5, VALUE_OPT_LOAD_CERTIFICATE, + /* equiv idx, value */ 5, VALUE_OPT_LOAD_CERTIFICATE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_CERTIFICATE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-certificate */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LOAD_CERTIFICATE_DESC, LOAD_CERTIFICATE_NAME, LOAD_CERTIFICATE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 6, VALUE_OPT_DLV, + /* equiv idx, value */ 6, VALUE_OPT_DLV, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DLV_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --dlv */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ DLV_DESC, DLV_NAME, DLV_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 7, VALUE_OPT_HASH, + /* equiv idx, value */ 7, VALUE_OPT_HASH, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ HASH_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --hash */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ HASH_DESC, HASH_NAME, HASH_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 8, VALUE_OPT_CHECK, + /* equiv idx, value */ 8, VALUE_OPT_CHECK, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ CHECK_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --check */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ CHECK_DESC, CHECK_NAME, CHECK_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 9, VALUE_OPT_CHECK_EE, + /* equiv idx, value */ 9, VALUE_OPT_CHECK_EE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ CHECK_EE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --check-ee */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ CHECK_EE_DESC, CHECK_EE_NAME, CHECK_EE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 10, VALUE_OPT_CHECK_CA, + /* equiv idx, value */ 10, VALUE_OPT_CHECK_CA, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ CHECK_CA_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --check-ca */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ CHECK_CA_DESC, CHECK_CA_NAME, CHECK_CA_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 11, VALUE_OPT_TLSA_RR, + /* equiv idx, value */ 11, VALUE_OPT_TLSA_RR, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ TLSA_RR_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --tlsa-rr */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ aTlsa_RrMustList, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ TLSA_RR_DESC, TLSA_RR_NAME, TLSA_RR_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 12, VALUE_OPT_HOST, + /* equiv idx, value */ 12, VALUE_OPT_HOST, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ HOST_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --host */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ HOST_DESC, HOST_NAME, HOST_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 13, VALUE_OPT_PROTO, + /* equiv idx, value */ 13, VALUE_OPT_PROTO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PROTO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --proto */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PROTO_DESC, PROTO_NAME, PROTO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 14, VALUE_OPT_PORT, + /* equiv idx, value */ 14, VALUE_OPT_PORT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PORT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --port */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PORT_DESC, PORT_NAME, PORT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 15, VALUE_OPT_APP_PROTO, + /* equiv idx, value */ 15, VALUE_OPT_APP_PROTO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ APP_PROTO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --app-proto */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptApp_Proto, + /* desc, NAME, name */ APP_PROTO_DESC, APP_PROTO_NAME, APP_PROTO_name, + /* disablement strs */ 0, 0 }, + + { /* entry idx, value */ 16, VALUE_OPT_STARTTLS_PROTO, + /* equiv idx, value */ 16, VALUE_OPT_STARTTLS_PROTO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ STARTTLS_PROTO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --starttls-proto */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ STARTTLS_PROTO_DESC, STARTTLS_PROTO_NAME, STARTTLS_PROTO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 17, VALUE_OPT_CA, + /* equiv idx, value */ 17, VALUE_OPT_CA, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ CA_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --ca */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ CA_DESC, CA_NAME, CA_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 18, VALUE_OPT_X509, + /* equiv idx, value */ 18, VALUE_OPT_X509, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ X509_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --x509 */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ X509_DESC, X509_NAME, X509_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 19, VALUE_OPT_LOCAL, + /* equiv idx, value */ 19, VALUE_OPT_LOCAL, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOCAL_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --local */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptLocal, + /* desc, NAME, name */ LOCAL_DESC, LOCAL_NAME, LOCAL_name, + /* disablement strs */ 0, 0 }, + + { /* entry idx, value */ 20, VALUE_OPT_DOMAIN, + /* equiv idx, value */ 20, VALUE_OPT_DOMAIN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DOMAIN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --domain */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ DOMAIN_DESC, DOMAIN_NAME, DOMAIN_name, + /* disablement strs */ NOT_DOMAIN_name, NOT_DOMAIN_PFX }, + + { /* entry idx, value */ 21, VALUE_OPT_LOCAL_DNS, + /* equiv idx, value */ 21, VALUE_OPT_LOCAL_DNS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOCAL_DNS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --local-dns */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LOCAL_DNS_DESC, LOCAL_DNS_NAME, LOCAL_DNS_name, + /* disablement strs */ NOT_LOCAL_DNS_name, NOT_LOCAL_DNS_PFX }, + + { /* entry idx, value */ 22, VALUE_OPT_INSECURE, + /* equiv idx, value */ 22, VALUE_OPT_INSECURE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INSECURE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --insecure */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ INSECURE_DESC, INSECURE_NAME, INSECURE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 23, VALUE_OPT_INDER, + /* equiv idx, value */ 23, VALUE_OPT_INDER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INDER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --inder */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ INDER_DESC, INDER_NAME, INDER_name, + /* disablement strs */ NOT_INDER_name, NOT_INDER_PFX }, + + { /* entry idx, value */ 24, VALUE_OPT_INRAW, + /* equiv idx, value */ 24, VALUE_OPT_INRAW, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INRAW_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --inraw */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptInraw, + /* desc, NAME, name */ INRAW_DESC, INRAW_NAME, INRAW_name, + /* disablement strs */ 0, 0 }, + + { /* entry idx, value */ 25, VALUE_OPT_PRINT_RAW, + /* equiv idx, value */ 25, VALUE_OPT_PRINT_RAW, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PRINT_RAW_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --print-raw */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PRINT_RAW_DESC, PRINT_RAW_NAME, PRINT_RAW_name, + /* disablement strs */ NOT_PRINT_RAW_name, NOT_PRINT_RAW_PFX }, + + { /* entry idx, value */ 26, VALUE_OPT_QUIET, + /* equiv idx, value */ 26, VALUE_OPT_QUIET, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ QUIET_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --quiet */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ QUIET_DESC, QUIET_NAME, QUIET_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VER_FLAGS, AOUSE_VERSION, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ VER_PROC, + /* desc, NAME, name */ VER_DESC, NULL, VER_name, + /* disablement strs */ NULL, NULL }, + + + + { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doUsageOpt, + /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionPagedUsage, + /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, + /* disablement strs */ NULL, NULL } +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** Reference to the upper cased version of danetool. */ +#define zPROGNAME (danetool_opt_strs+2552) +/** Reference to the title line for danetool usage. */ +#define zUsageTitle (danetool_opt_strs+2561) +/** There is no danetool configuration file. */ +#define zRcName NULL +/** There are no directories to search for danetool config files. */ +#define apzHomeList NULL +/** The danetool program bug email address. */ +#define zBugsAddr (danetool_opt_strs+2647) +/** Clarification/explanation of what danetool does. */ +#define zExplain (danetool_opt_strs+2667) +/** Extra detail explaining what danetool does. */ +#define zDetail (danetool_opt_strs+2669) +/** The full version string for danetool. */ +#define zFullVersion (danetool_opt_strs+2741) +/* extracted from optcode.tlib near line 364 */ + +#if defined(ENABLE_NLS) +# define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT + static tOptionXlateProc translate_option_strings; +#else +# define OPTPROC_BASE OPTPROC_NONE +# define translate_option_strings NULL +#endif /* ENABLE_NLS */ + +#define danetool_full_usage (NULL) +#define danetool_short_usage (danetool_opt_strs+2760) + +#endif /* not defined __doxygen__ */ + +/* + * Create the static procedure(s) declared above. + */ +/** + * The callout function that invokes the optionUsage function. + * + * @param[in] opts the AutoOpts option description structure + * @param[in] od the descriptor for the "help" (usage) option. + * @noreturn + */ +static void +doUsageOpt(tOptions * opts, tOptDesc * od) +{ + int ex_code; + ex_code = DANETOOL_EXIT_SUCCESS; + optionUsage(&danetoolOptions, ex_code); + /* NOTREACHED */ + exit(DANETOOL_EXIT_FAILURE); + (void)opts; + (void)od; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the debug option. + * Specifies the debug level. + * @param[in] pOptions the danetool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptDebug(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[1] = { + { 0 , 9999 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 1; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + + emit_ranges: +optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the infile option. + * + * @param[in] pOptions the danetool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptInfile(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the app-proto option. + * + * @param[in] pOptions the danetool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptApp_Proto(tOptions* pOptions, tOptDesc* pOptDesc) +{ + int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_STARTTLS_PROTO); + if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0)) + USAGE(DANETOOL_EXIT_USAGE_ERROR); + +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the local option. + * + * @param[in] pOptions the danetool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptLocal(tOptions* pOptions, tOptDesc* pOptDesc) +{ + int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_DOMAIN); + if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0)) + USAGE(DANETOOL_EXIT_USAGE_ERROR); + +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the inraw option. + * + * @param[in] pOptions the danetool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptInraw(tOptions* pOptions, tOptDesc* pOptDesc) +{ + int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_INDER); + if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0)) + USAGE(DANETOOL_EXIT_USAGE_ERROR); + +} +/* extracted from optmain.tlib near line 1250 */ + +/** + * The directory containing the data associated with danetool. + */ +#ifndef PKGDATADIR +# define PKGDATADIR "" +#endif + +/** + * Information about the person or institution that packaged danetool + * for the current distribution. + */ +#ifndef WITH_PACKAGER +# define danetool_packager_info NULL +#else +/** Packager information for danetool. */ +static char const danetool_packager_info[] = + "Packaged by " WITH_PACKAGER + +# ifdef WITH_PACKAGER_VERSION + " ("WITH_PACKAGER_VERSION")" +# endif + +# ifdef WITH_PACKAGER_BUG_REPORTS + "\nReport danetool bugs to " WITH_PACKAGER_BUG_REPORTS +# endif + "\n"; +#endif +#ifndef __doxygen__ + +#endif /* __doxygen__ */ +/** + * The option definitions for danetool. The one structure that + * binds them all. + */ +tOptions danetoolOptions = { + OPTIONS_STRUCT_VERSION, + 0, NULL, /* original argc + argv */ + ( OPTPROC_BASE + + OPTPROC_ERRSTOP + + OPTPROC_SHORTOPT + + OPTPROC_LONGOPT + + OPTPROC_NO_REQ_OPT + + OPTPROC_NEGATIONS + + OPTPROC_NO_ARGS + + OPTPROC_GNUUSAGE + + OPTPROC_MISUSE ), + 0, NULL, /* current option index, current option */ + NULL, NULL, zPROGNAME, + zRcName, zCopyright, zLicenseDescrip, + zFullVersion, apzHomeList, zUsageTitle, + zExplain, zDetail, optDesc, + zBugsAddr, /* address to send bugs to */ + NULL, NULL, /* extensions/saved state */ + optionUsage, /* usage procedure */ + translate_option_strings, /* translation procedure */ + /* + * Indexes to special options + */ + { INDEX_OPT_MORE_HELP, /* more-help option index */ + NO_EQUIVALENT, /* save option index */ + NO_EQUIVALENT, /* '-#' option index */ + NO_EQUIVALENT /* index of default opt */ + }, + 30 /* full option count */, 27 /* user option count */, + danetool_full_usage, danetool_short_usage, + NULL, NULL, + PKGDATADIR, danetool_packager_info +}; + +#if ENABLE_NLS +/** + * This code is designed to translate translatable option text for the + * danetool program. These translations happen upon entry + * to optionProcess(). + */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#ifdef HAVE_DCGETTEXT +# include <gettext.h> +#endif +#include <autoopts/usage-txt.h> + +static char * AO_gettext(char const * pz); +static void coerce_it(void ** s); + +/** + * AutoGen specific wrapper function for gettext. It relies on the macro _() + * to convert from English to the target language, then strdup-duplicates the + * result string. It tries the "libopts" domain first, then whatever has been + * set via the \a textdomain(3) call. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * +AO_gettext(char const * pz) +{ + char * res; + if (pz == NULL) + return NULL; +#ifdef HAVE_DCGETTEXT + /* + * While processing the option_xlateable_txt data, try to use the + * "libopts" domain. Once we switch to the option descriptor data, + * do *not* use that domain. + */ + if (option_xlateable_txt.field_ct != 0) { + res = dgettext("libopts", pz); + if (res == pz) + res = (char *)VOIDP(_(pz)); + } else + res = (char *)VOIDP(_(pz)); +#else + res = (char *)VOIDP(_(pz)); +#endif + if (res == pz) + return res; + res = strdup(res); + if (res == NULL) { + fputs(_("No memory for duping translated strings\n"), stderr); + exit(DANETOOL_EXIT_FAILURE); + } + return res; +} + +/** + * All the pointers we use are marked "* const", but they are stored in + * writable memory. Coerce the mutability and set the pointer. + */ +static void coerce_it(void ** s) { *s = AO_gettext(*s); +} + +/** + * Translate all the translatable strings in the danetoolOptions + * structure defined above. This is done only once. + */ +static void +translate_option_strings(void) +{ + tOptions * const opts = &danetoolOptions; + + /* + * Guard against re-translation. It won't work. The strings will have + * been changed by the first pass through this code. One shot only. + */ + if (option_xlateable_txt.field_ct != 0) { + /* + * Do the translations. The first pointer follows the field count + * field. The field count field is the size of a pointer. + */ + char ** ppz = (char**)VOIDP(&(option_xlateable_txt)); + int ix = option_xlateable_txt.field_ct; + + do { + ppz++; /* skip over field_ct */ + *ppz = AO_gettext(*ppz); + } while (--ix > 0); + /* prevent re-translation and disable "libopts" domain lookup */ + option_xlateable_txt.field_ct = 0; + + coerce_it(VOIDP(&(opts->pzCopyright))); + coerce_it(VOIDP(&(opts->pzCopyNotice))); + coerce_it(VOIDP(&(opts->pzFullVersion))); + coerce_it(VOIDP(&(opts->pzUsageTitle))); + coerce_it(VOIDP(&(opts->pzExplain))); + coerce_it(VOIDP(&(opts->pzDetail))); + { + tOptDesc * od = opts->pOptDesc; + for (ix = opts->optCt; ix > 0; ix--, od++) + coerce_it(VOIDP(&(od->pzText))); + } + } +} +#endif /* ENABLE_NLS */ + +#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT +/** I18N function strictly for xgettext. Do not compile. */ +static void bogus_function(void) { + /* TRANSLATORS: + + The following dummy function was crated solely so that xgettext can + extract the correct strings. These strings are actually referenced + by a field name in the danetoolOptions structure noted in the + comments below. The literal text is defined in danetool_opt_strs. + + NOTE: the strings below are segmented with respect to the source string + danetool_opt_strs. The strings above are handed off for translation + at run time a paragraph at a time. Consequently, they are presented here + for translation a paragraph at a time. + + ALSO: often the description for an option will reference another option + by name. These are set off with apostrophe quotes (I hope). Do not + translate option names. + */ + /* referenced via danetoolOptions.pzCopyright */ + puts(_("danetool @VERSION@\n\ +Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n\ +This is free software. It is licensed for use, modification and\n\ +redistribution under the terms of the GNU General Public License,\n\ +version 3 or later <http://gnu.org/licenses/gpl.html>\n")); + + /* referenced via danetoolOptions.pzCopyNotice */ + puts(_("danetool is free software: you can redistribute it and/or modify it under\n\ +the terms of the GNU General Public License as published by the Free\n\ +Software Foundation, either version 3 of the License, or (at your option)\n\ +any later version.\n\n")); + puts(_("danetool is distributed in the hope that it will be useful, but WITHOUT ANY\n\ +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n\ +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n\ +details.\n\n")); + puts(_("You should have received a copy of the GNU General Public License along\n\ +with this program. If not, see <http://www.gnu.org/licenses/>.\n")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Enable debugging")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("More verbose output")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Input file")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Output file")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Loads a public key file")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Loads a certificate file")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Sets a DLV file")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Hash algorithm to use for signing")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Check a host's DANE TLSA entry")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Check only the end-entity's certificate")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Check only the CA's certificate")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Print the DANE RR data on a certificate or public key")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Specify the hostname to be used in the DANE RR")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("The protocol set for DANE data (tcp, udp etc.)")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("The port or service to connect to, for DANE data")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("an alias for the 'starttls-proto' option")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("The application protocol to be used to obtain the server's certificate\n\ +(https, ftp, smtp, imap, ldap, xmpp)")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Whether the provided certificate or public key is a Certificate\n\ +Authority")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Use the hash of the X.509 certificate, rather than the public key")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("an alias for the 'domain' option")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("The provided certificate or public key is issued by the local domain")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Use the local DNS server for DNSSEC resolving")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Do not verify any DNSSEC signature")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Use DER format for input certificates and private keys")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("an alias for the 'inder' option")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Print the received DANE data in raw format")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("Suppress several informational messages")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("display extended usage information and exit")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("extended usage information passed thru pager")); + + /* referenced via danetoolOptions.pOptDesc->pzText */ + puts(_("output version information and exit")); + + /* referenced via danetoolOptions.pzUsageTitle */ + puts(_("danetool - GnuTLS DANE tool\n\ +Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n")); + + /* referenced via danetoolOptions.pzExplain */ + puts(_("\n")); + + /* referenced via danetoolOptions.pzDetail */ + puts(_("Tool to generate and check DNS resource records for the DANE protocol.\n")); + + /* referenced via danetoolOptions.pzFullVersion */ + puts(_("danetool @VERSION@")); + + /* referenced via danetoolOptions.pzFullUsage */ + puts(_("<<<NOT-FOUND>>>")); + + /* referenced via danetoolOptions.pzShortUsage */ + puts(_("danetool --[tlsa-rr|check] [options]\n\ +danetool --help for additional usage instructions.\n")); + /* LIBOPTS-MESSAGES: */ +#line 67 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 93 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 53 "../init.c" + puts(_("AutoOpts function called without option descriptor\n")); +#line 86 "../init.c" + puts(_("\tThis exceeds the compiled library version: ")); +#line 84 "../init.c" + puts(_("Automated Options Processing Error!\n" + "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); +#line 80 "../autoopts.c" + puts(_("realloc of %d bytes at 0x%p failed\n")); +#line 88 "../init.c" + puts(_("\tThis is less than the minimum library version: ")); +#line 121 "../version.c" + puts(_("Automated Options version %s\n" + "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); +#line 87 "../makeshell.c" + puts(_("(AutoOpts bug): %s.\n")); +#line 90 "../reset.c" + puts(_("optionResetOpt() called, but reset-option not configured")); +#line 295 "../usage.c" + puts(_("could not locate the 'help' option")); +#line 336 "../autoopts.c" + puts(_("optionProcess() was called with invalid data")); +#line 751 "../usage.c" + puts(_("invalid argument type specified")); +#line 598 "../find.c" + puts(_("defaulted to option with optional arg")); +#line 76 "../alias.c" + puts(_("aliasing option is out of range.")); +#line 235 "../enum.c" + puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); +#line 108 "../find.c" + puts(_(" The following options match:\n")); +#line 293 "../find.c" + puts(_("%s: ambiguous option name: %s (matches %d options)\n")); +#line 161 "../check.c" + puts(_("%s: Command line arguments required\n")); +#line 43 "../alias.c" + puts(_("%d %s%s options allowed\n")); +#line 94 "../makeshell.c" + puts(_("%s error %d (%s) calling %s for '%s'\n")); +#line 306 "../makeshell.c" + puts(_("interprocess pipe")); +#line 168 "../version.c" + puts(_("error: version option argument '%c' invalid. Use:\n" + "\t'v' - version only\n" + "\t'c' - version and copyright\n" + "\t'n' - version and full copyright notice\n")); +#line 58 "../check.c" + puts(_("%s error: the '%s' and '%s' options conflict\n")); +#line 217 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 430 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 38 "../alias.c" + puts(_("-equivalence")); +#line 469 "../find.c" + puts(_("%s: illegal option -- %c\n")); +#line 110 "../reset.c" + puts(_("%s: illegal option -- %c\n")); +#line 271 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 755 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 118 "../reset.c" + puts(_("%s: illegal option -- %s\n")); +#line 335 "../find.c" + puts(_("%s: unknown vendor extension option -- %s\n")); +#line 160 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 170 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 750 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 1084 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 385 "../find.c" + puts(_("%s: invalid option name: %s\n")); +#line 527 "../find.c" + puts(_("%s: The '%s' option requires an argument.\n")); +#line 156 "../autoopts.c" + puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" + "\t'%s' and '%s'.")); +#line 94 "../check.c" + puts(_("%s error: The %s option is required\n")); +#line 632 "../find.c" + puts(_("%s: The '%s' option cannot have an argument.\n")); +#line 151 "../check.c" + puts(_("%s: Command line arguments are not allowed.\n")); +#line 536 "../save.c" + puts(_("error %d (%s) creating %s\n")); +#line 235 "../enum.c" + puts(_("%s error: '%s' does not match any %s keywords.\n")); +#line 93 "../reset.c" + puts(_("%s error: The '%s' option requires an argument.\n")); +#line 186 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 239 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 143 "../restore.c" + puts(_("%s error: no saved option state\n")); +#line 231 "../autoopts.c" + puts(_("'%s' is not a command line option.\n")); +#line 113 "../time.c" + puts(_("%s error: '%s' is not a recognizable date/time.\n")); +#line 131 "../save.c" + puts(_("'%s' not defined\n")); +#line 50 "../time.c" + puts(_("%s error: '%s' is not a recognizable time duration.\n")); +#line 92 "../check.c" + puts(_("%s error: The %s option must appear %d times.\n")); +#line 165 "../numeric.c" + puts(_("%s error: '%s' is not a recognizable number.\n")); +#line 201 "../enum.c" + puts(_("%s error: %s exceeds %s keyword count\n")); +#line 333 "../usage.c" + puts(_("Try '%s %s' for more information.\n")); +#line 45 "../alias.c" + puts(_("one %s%s option allowed\n")); +#line 208 "../makeshell.c" + puts(_("standard output")); +#line 943 "../makeshell.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard output")); +#line 418 "../usage.c" + puts(_("standard output")); +#line 628 "../usage.c" + puts(_("standard output")); +#line 175 "../version.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard error")); +#line 418 "../usage.c" + puts(_("standard error")); +#line 628 "../usage.c" + puts(_("standard error")); +#line 175 "../version.c" + puts(_("standard error")); +#line 208 "../makeshell.c" + puts(_("write")); +#line 943 "../makeshell.c" + puts(_("write")); +#line 276 "../usage.c" + puts(_("write")); +#line 417 "../usage.c" + puts(_("write")); +#line 627 "../usage.c" + puts(_("write")); +#line 174 "../version.c" + puts(_("write")); +#line 60 "../numeric.c" + puts(_("%s error: %s option value %ld is out of range.\n")); +#line 44 "../check.c" + puts(_("%s error: %s option requires the %s option\n")); +#line 130 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 185 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 238 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 257 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 535 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); + /* END-LIBOPTS-MESSAGES */ + + /* USAGE-TEXT: */ +#line 876 "../usage.c" + puts(_("\t\t\t\t- an alternate for '%s'\n")); +#line 1151 "../usage.c" + puts(_("Version, usage and configuration options:")); +#line 927 "../usage.c" + puts(_("\t\t\t\t- default option for unnamed options\n")); +#line 840 "../usage.c" + puts(_("\t\t\t\t- disabled as '--%s'\n")); +#line 1120 "../usage.c" + puts(_(" --- %-14s %s\n")); +#line 1118 "../usage.c" + puts(_("This option has been disabled")); +#line 867 "../usage.c" + puts(_("\t\t\t\t- enabled by default\n")); +#line 40 "../alias.c" + puts(_("%s error: only ")); +#line 1197 "../usage.c" + puts(_(" - examining environment variables named %s_*\n")); +#line 168 "../file.c" + puts(_("\t\t\t\t- file must not pre-exist\n")); +#line 172 "../file.c" + puts(_("\t\t\t\t- file must pre-exist\n")); +#line 383 "../usage.c" + puts(_("Options are specified by doubled hyphens and their name or by a single\n" + "hyphen and the flag character.\n")); +#line 921 "../makeshell.c" + puts(_("\n" + "= = = = = = = =\n\n" + "This incarnation of genshell will produce\n" + "a shell script to parse the options for %s:\n\n")); +#line 167 "../enum.c" + puts(_(" or an integer mask with any of the lower %d bits set\n")); +#line 900 "../usage.c" + puts(_("\t\t\t\t- is a set membership option\n")); +#line 921 "../usage.c" + puts(_("\t\t\t\t- must appear between %d and %d times\n")); +#line 385 "../usage.c" + puts(_("Options are specified by single or double hyphens and their name.\n")); +#line 907 "../usage.c" + puts(_("\t\t\t\t- may appear multiple times\n")); +#line 894 "../usage.c" + puts(_("\t\t\t\t- may not be preset\n")); +#line 1312 "../usage.c" + puts(_(" Arg Option-Name Description\n")); +#line 1248 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1306 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1307 "../usage.c" + puts(_(" %3s %s")); +#line 1313 "../usage.c" + puts(_(" %3s %s")); +#line 390 "../usage.c" + puts(_("The '-#<number>' option may omit the hash char\n")); +#line 386 "../usage.c" + puts(_("All arguments are named options.\n")); +#line 974 "../usage.c" + puts(_(" - reading file %s")); +#line 412 "../usage.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 100 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 129 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 906 "../usage.c" + puts(_("\t\t\t\t- may NOT appear - preset only\n")); +#line 947 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 1195 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 685 "../usage.c" + puts(_("prohibits these options:\n")); +#line 680 "../usage.c" + puts(_("prohibits the option '%s'\n")); +#line 81 "../numeric.c" + puts(_("%s%ld to %ld")); +#line 79 "../numeric.c" + puts(_("%sgreater than or equal to %ld")); +#line 75 "../numeric.c" + puts(_("%s%ld exactly")); +#line 68 "../numeric.c" + puts(_("%sit must lie in one of the ranges:\n")); +#line 68 "../numeric.c" + puts(_("%sit must be in the range:\n")); +#line 88 "../numeric.c" + puts(_(", or\n")); +#line 66 "../numeric.c" + puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); +#line 77 "../numeric.c" + puts(_("%sless than or equal to %ld")); +#line 393 "../usage.c" + puts(_("Operands and options may be intermixed. They will be reordered.\n")); +#line 655 "../usage.c" + puts(_("requires the option '%s'\n")); +#line 658 "../usage.c" + puts(_("requires these options:\n")); +#line 1324 "../usage.c" + puts(_(" Arg Option-Name Req? Description\n")); +#line 1318 "../usage.c" + puts(_(" Flg Arg Option-Name Req? Description\n")); +#line 168 "../enum.c" + puts(_("or you may use a numeric representation. Preceding these with a '!'\n" + "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" + "will set them all. Multiple entries may be passed as an option\n" + "argument list.\n")); +#line 913 "../usage.c" + puts(_("\t\t\t\t- may appear up to %d times\n")); +#line 77 "../enum.c" + puts(_("The valid \"%s\" option keywords are:\n")); +#line 1155 "../usage.c" + puts(_("The next option supports vendor supported extra options:")); +#line 776 "../usage.c" + puts(_("These additional options are:")); + /* END-USAGE-TEXT */ +} +#endif /* uncompilable code */ +#ifdef __cplusplus +} +#endif +/* danetool-args.c ends here */ diff --git a/src/danetool-args.h.bak b/src/danetool-args.h.bak new file mode 100644 index 0000000000..f7717dbea7 --- /dev/null +++ b/src/danetool-args.h.bak @@ -0,0 +1,265 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (danetool-args.h) + * + * It has been AutoGen-ed + * From the definitions danetool-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the danetool author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The danetool program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * danetool is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * danetool is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ +/** + * This file contains the programmatic interface to the Automated + * Options generated for the danetool program. + * These macros are documented in the AutoGen info file in the + * "AutoOpts" chapter. Please refer to that doc for usage help. + */ +#ifndef AUTOOPTS_DANETOOL_ARGS_H_GUARD +#define AUTOOPTS_DANETOOL_ARGS_H_GUARD 1 +#include "config.h" +#include <autoopts/options.h> + +/** + * Ensure that the library used for compiling this generated header is at + * least as new as the version current when the header template was released + * (not counting patch version increments). Also ensure that the oldest + * tolerable version is at least as old as what was current when the header + * template was released. + */ +#define AO_TEMPLATE_VERSION 167937 +#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ + || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) +# error option template version mismatches autoopts/options.h header + Choke Me. +#endif + +/** + * Enumeration of each option type for danetool + */ +typedef enum { + INDEX_OPT_DEBUG = 0, + INDEX_OPT_VERBOSE = 1, + INDEX_OPT_INFILE = 2, + INDEX_OPT_OUTFILE = 3, + INDEX_OPT_LOAD_PUBKEY = 4, + INDEX_OPT_LOAD_CERTIFICATE = 5, + INDEX_OPT_DLV = 6, + INDEX_OPT_HASH = 7, + INDEX_OPT_CHECK = 8, + INDEX_OPT_CHECK_EE = 9, + INDEX_OPT_CHECK_CA = 10, + INDEX_OPT_TLSA_RR = 11, + INDEX_OPT_HOST = 12, + INDEX_OPT_PROTO = 13, + INDEX_OPT_PORT = 14, + INDEX_OPT_APP_PROTO = 15, + INDEX_OPT_STARTTLS_PROTO = 16, + INDEX_OPT_CA = 17, + INDEX_OPT_X509 = 18, + INDEX_OPT_LOCAL = 19, + INDEX_OPT_DOMAIN = 20, + INDEX_OPT_LOCAL_DNS = 21, + INDEX_OPT_INSECURE = 22, + INDEX_OPT_INDER = 23, + INDEX_OPT_INRAW = 24, + INDEX_OPT_PRINT_RAW = 25, + INDEX_OPT_QUIET = 26, + INDEX_OPT_VERSION = 27, + INDEX_OPT_HELP = 28, + INDEX_OPT_MORE_HELP = 29 +} teOptIndex; +/** count of all options for danetool */ +#define OPTION_CT 30 +/** danetool version */ +#define DANETOOL_VERSION "@VERSION@" +/** Full danetool version text */ +#define DANETOOL_FULL_VERSION "danetool @VERSION@" + +/** + * Interface defines for all options. Replace "n" with the UPPER_CASED + * option name (as in the teOptIndex enumeration above). + * e.g. HAVE_OPT(DEBUG) + */ +#define DESC(n) (danetoolOptions.pOptDesc[INDEX_OPT_## n]) +/** 'true' if an option has been specified in any way */ +#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) +/** The string argument to an option. The argument type must be \"string\". */ +#define OPT_ARG(n) (DESC(n).optArg.argString) +/** Mask the option state revealing how an option was specified. + * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET, + * \a OPTST_DEFINED, \a OPTST_RESET or zero. + */ +#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) +/** Count of option's occurrances *on the command line*. */ +#define COUNT_OPT(n) (DESC(n).optOccCt) +/** mask of \a OPTST_SET and \a OPTST_DEFINED. */ +#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) +/** 'true' if \a HAVE_OPT would yield 'false'. */ +#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) +/** 'true' if OPTST_DISABLED bit not set. */ +#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) +/** number of stacked option arguments. + * Valid only for stacked option arguments. */ +#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) +/** stacked argument vector. + * Valid only for stacked option arguments. */ +#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) +/** Reset an option. */ +#define CLEAR_OPT(n) STMTS( \ + DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + DESC(n).fOptState |= OPTST_DISABLED; \ + DESC(n).optCookie = NULL ) +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Enumeration of danetool exit codes + */ +typedef enum { + DANETOOL_EXIT_SUCCESS = 0, + DANETOOL_EXIT_FAILURE = 1, + DANETOOL_EXIT_USAGE_ERROR = 64, + DANETOOL_EXIT_LIBOPTS_FAILURE = 70 +} danetool_exit_code_t; +/** + * Interface defines for specific options. + * @{ + */ +#define VALUE_OPT_DEBUG 'd' + +#define OPT_VALUE_DEBUG (DESC(DEBUG).optArg.argInt) +#define VALUE_OPT_VERBOSE 'V' +#define VALUE_OPT_INFILE 0x1001 +#define VALUE_OPT_OUTFILE 0x1002 +#define VALUE_OPT_LOAD_PUBKEY 0x1003 +#define VALUE_OPT_LOAD_CERTIFICATE 0x1004 +#define VALUE_OPT_DLV 0x1005 +#define VALUE_OPT_HASH 0x1006 +#define VALUE_OPT_CHECK 0x1007 +#define VALUE_OPT_CHECK_EE 0x1008 +#define VALUE_OPT_CHECK_CA 0x1009 +#define VALUE_OPT_TLSA_RR 0x100A +#define VALUE_OPT_HOST 0x100B +#define VALUE_OPT_PROTO 0x100C +#define VALUE_OPT_PORT 0x100D +#define VALUE_OPT_APP_PROTO 0x100E +#define VALUE_OPT_STARTTLS_PROTO 0x100F +#define VALUE_OPT_CA 0x1010 +#define VALUE_OPT_X509 0x1011 +#define VALUE_OPT_LOCAL 0x1012 +#define VALUE_OPT_DOMAIN 0x1013 +#define VALUE_OPT_LOCAL_DNS 0x1014 +#define VALUE_OPT_INSECURE 0x1015 +#define VALUE_OPT_INDER 0x1016 +#define VALUE_OPT_INRAW 0x1017 +#define VALUE_OPT_PRINT_RAW 0x1018 +#define VALUE_OPT_QUIET 0x1019 +/** option flag (value) for help-value option */ +#define VALUE_OPT_HELP 'h' +/** option flag (value) for more-help-value option */ +#define VALUE_OPT_MORE_HELP '!' +/** option flag (value) for version-value option */ +#define VALUE_OPT_VERSION 'v' +/* + * Interface defines not associated with particular options + */ +#define ERRSKIP_OPTERR STMTS(danetoolOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(danetoolOptions.fOptSet |= OPTPROC_ERRSTOP) +#define RESTART_OPT(n) STMTS( \ + danetoolOptions.curOptIdx = (n); \ + danetoolOptions.pzCurOpt = NULL ) +#define START_OPT RESTART_OPT(1) +#define USAGE(c) (*danetoolOptions.pUsageProc)(&danetoolOptions, c) + +#ifdef __cplusplus +extern "C" { +#endif +/* + * global exported definitions + */ +#include <gettext.h> + + +/* * * * * * + * + * Declare the danetool option descriptor. + */ +extern tOptions danetoolOptions; + +#if defined(ENABLE_NLS) +# ifndef _ +# include <stdio.h> +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include <libintl.h> +# endif + +# ifndef ATTRIBUTE_FORMAT_ARG +# define ATTRIBUTE_FORMAT_ARG(_a) +# endif + +static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1); +static inline char* aoGetsText(char const* pz) { + if (pz == NULL) return NULL; + return (char*)gettext(pz); +} +# define _(s) aoGetsText(s) +# endif /* _() */ + +# define OPT_NO_XLAT_CFG_NAMES STMTS(danetoolOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT_CFG;) +# define OPT_NO_XLAT_OPT_NAMES STMTS(danetoolOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) + +# define OPT_XLAT_CFG_NAMES STMTS(danetoolOptions.fOptSet &= \ + ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) +# define OPT_XLAT_OPT_NAMES STMTS(danetoolOptions.fOptSet &= \ + ~OPTPROC_NXLAT_OPT;) + +#else /* ENABLE_NLS */ +# define OPT_NO_XLAT_CFG_NAMES +# define OPT_NO_XLAT_OPT_NAMES + +# define OPT_XLAT_CFG_NAMES +# define OPT_XLAT_OPT_NAMES + +# ifndef _ +# define _(_s) _s +# endif +#endif /* ENABLE_NLS */ + +#ifdef __cplusplus +} +#endif +#endif /* AUTOOPTS_DANETOOL_ARGS_H_GUARD */ + +/* danetool-args.h ends here */ diff --git a/src/ocsptool-args.c.bak b/src/ocsptool-args.c.bak new file mode 100644 index 0000000000..5082df7925 --- /dev/null +++ b/src/ocsptool-args.c.bak @@ -0,0 +1,1553 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (ocsptool-args.c) + * + * It has been AutoGen-ed + * From the definitions ocsptool-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the ocsptool author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The ocsptool program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * ocsptool is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ocsptool is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "ocsptool-args.h" +#include <sys/types.h> + +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> + +#ifdef __cplusplus +extern "C" { +#endif +extern FILE * option_usage_fp; +#define zCopyright (ocsptool_opt_strs+0) +#define zLicenseDescrip (ocsptool_opt_strs+289) + + +#ifndef NULL +# define NULL 0 +#endif + +/** + * static const strings for ocsptool options + */ +static char const ocsptool_opt_strs[2328] = +/* 0 */ "ocsptool @VERSION@\n" + "Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n" + "This is free software. It is licensed for use, modification and\n" + "redistribution under the terms of the GNU General Public License,\n" + "version 3 or later <http://gnu.org/licenses/gpl.html>\n\0" +/* 289 */ "ocsptool is free software: you can redistribute it and/or modify it under\n" + "the terms of the GNU General Public License as published by the Free\n" + "Software Foundation, either version 3 of the License, or (at your option)\n" + "any later version.\n\n" + "ocsptool is distributed in the hope that it will be useful, but WITHOUT ANY\n" + "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n" + "FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n" + "details.\n\n" + "You should have received a copy of the GNU General Public License along\n" + "with this program. If not, see <http://www.gnu.org/licenses/>.\n\0" +/* 894 */ "Enable debugging\0" +/* 911 */ "DEBUG\0" +/* 917 */ "debug\0" +/* 923 */ "More verbose output\0" +/* 943 */ "VERBOSE\0" +/* 951 */ "verbose\0" +/* 959 */ "Input file\0" +/* 970 */ "INFILE\0" +/* 977 */ "infile\0" +/* 984 */ "Output file\0" +/* 996 */ "OUTFILE\0" +/* 1004 */ "outfile\0" +/* 1012 */ "Ask an OCSP/HTTP server on a certificate validity\0" +/* 1062 */ "ASK\0" +/* 1066 */ "ask\0" +/* 1070 */ "Verify response\0" +/* 1086 */ "VERIFY_RESPONSE\0" +/* 1102 */ "verify-response\0" +/* 1118 */ "Print information on a OCSP request\0" +/* 1154 */ "REQUEST_INFO\0" +/* 1167 */ "request-info\0" +/* 1180 */ "Print information on a OCSP response\0" +/* 1217 */ "RESPONSE_INFO\0" +/* 1231 */ "response-info\0" +/* 1245 */ "Generate an OCSP request\0" +/* 1270 */ "GENERATE_REQUEST\0" +/* 1287 */ "generate-request\0" +/* 1304 */ "Use (or not) a nonce to OCSP request\0" +/* 1341 */ "NONCE\0" +/* 1347 */ "no-nonce\0" +/* 1356 */ "no\0" +/* 1359 */ "Read issuer certificate from file\0" +/* 1393 */ "LOAD_ISSUER\0" +/* 1405 */ "load-issuer\0" +/* 1417 */ "Read certificate to check from file\0" +/* 1453 */ "LOAD_CERT\0" +/* 1463 */ "load-cert\0" +/* 1473 */ "Read OCSP trust anchors from file\0" +/* 1507 */ "LOAD_TRUST\0" +/* 1518 */ "load-trust\0" +/* 1529 */ "Read OCSP response signer from file\0" +/* 1565 */ "LOAD_SIGNER\0" +/* 1577 */ "load-signer\0" +/* 1589 */ "Use DER format for input certificates and private keys\0" +/* 1644 */ "INDER\0" +/* 1650 */ "no-inder\0" +/* 1659 */ "Read DER encoded OCSP request from file\0" +/* 1699 */ "LOAD_REQUEST\0" +/* 1712 */ "load-request\0" +/* 1725 */ "Read DER encoded OCSP response from file\0" +/* 1766 */ "LOAD_RESPONSE\0" +/* 1780 */ "load-response\0" +/* 1794 */ "Ignore any verification errors\0" +/* 1825 */ "IGNORE_ERRORS\0" +/* 1839 */ "ignore-errors\0" +/* 1853 */ "display extended usage information and exit\0" +/* 1897 */ "help\0" +/* 1902 */ "extended usage information passed thru pager\0" +/* 1947 */ "more-help\0" +/* 1957 */ "output version information and exit\0" +/* 1993 */ "version\0" +/* 2001 */ "OCSPTOOL\0" +/* 2010 */ "ocsptool - GnuTLS OCSP tool\n" + "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0" +/* 2096 */ "@PACKAGE_BUGREPORT@\0" +/* 2116 */ "\n\0" +/* 2118 */ "Ocsptool is a program that can parse and print information about OCSP\n" + "requests/responses, generate requests and verify responses.\n\0" +/* 2249 */ "ocsptool @VERSION@\0" +/* 2268 */ "ocsptool [options]\n" + "ocsptool --help for usage instructions.\n"; + +/** + * debug option description: + */ +/** Descriptive text for the debug option */ +#define DEBUG_DESC (ocsptool_opt_strs+894) +/** Upper-cased name for the debug option */ +#define DEBUG_NAME (ocsptool_opt_strs+911) +/** Name string for the debug option */ +#define DEBUG_name (ocsptool_opt_strs+917) +/** Compiled in flag settings for the debug option */ +#define DEBUG_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * verbose option description: + */ +/** Descriptive text for the verbose option */ +#define VERBOSE_DESC (ocsptool_opt_strs+923) +/** Upper-cased name for the verbose option */ +#define VERBOSE_NAME (ocsptool_opt_strs+943) +/** Name string for the verbose option */ +#define VERBOSE_name (ocsptool_opt_strs+951) +/** Compiled in flag settings for the verbose option */ +#define VERBOSE_FLAGS (OPTST_DISABLED) + +/** + * infile option description: + */ +/** Descriptive text for the infile option */ +#define INFILE_DESC (ocsptool_opt_strs+959) +/** Upper-cased name for the infile option */ +#define INFILE_NAME (ocsptool_opt_strs+970) +/** Name string for the infile option */ +#define INFILE_name (ocsptool_opt_strs+977) +/** Compiled in flag settings for the infile option */ +#define INFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * outfile option description: + */ +/** Descriptive text for the outfile option */ +#define OUTFILE_DESC (ocsptool_opt_strs+984) +/** Upper-cased name for the outfile option */ +#define OUTFILE_NAME (ocsptool_opt_strs+996) +/** Name string for the outfile option */ +#define OUTFILE_name (ocsptool_opt_strs+1004) +/** Compiled in flag settings for the outfile option */ +#define OUTFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * ask option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the ask option */ +#define ASK_DESC (ocsptool_opt_strs+1012) +/** Upper-cased name for the ask option */ +#define ASK_NAME (ocsptool_opt_strs+1062) +/** Name string for the ask option */ +#define ASK_name (ocsptool_opt_strs+1066) +/** Other options that are required by the ask option */ +static int const aAskMustList[] = { + INDEX_OPT_LOAD_CERT, + INDEX_OPT_LOAD_ISSUER, NO_EQUIVALENT }; +/** Compiled in flag settings for the ask option */ +#define ASK_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | OPTST_ARG_OPTIONAL) + +/** + * verify-response option description: + */ +/** Descriptive text for the verify-response option */ +#define VERIFY_RESPONSE_DESC (ocsptool_opt_strs+1070) +/** Upper-cased name for the verify-response option */ +#define VERIFY_RESPONSE_NAME (ocsptool_opt_strs+1086) +/** Name string for the verify-response option */ +#define VERIFY_RESPONSE_name (ocsptool_opt_strs+1102) +/** Compiled in flag settings for the verify-response option */ +#define VERIFY_RESPONSE_FLAGS (OPTST_DISABLED) + +/** + * request-info option description: + */ +/** Descriptive text for the request-info option */ +#define REQUEST_INFO_DESC (ocsptool_opt_strs+1118) +/** Upper-cased name for the request-info option */ +#define REQUEST_INFO_NAME (ocsptool_opt_strs+1154) +/** Name string for the request-info option */ +#define REQUEST_INFO_name (ocsptool_opt_strs+1167) +/** Compiled in flag settings for the request-info option */ +#define REQUEST_INFO_FLAGS (OPTST_DISABLED) + +/** + * response-info option description: + */ +/** Descriptive text for the response-info option */ +#define RESPONSE_INFO_DESC (ocsptool_opt_strs+1180) +/** Upper-cased name for the response-info option */ +#define RESPONSE_INFO_NAME (ocsptool_opt_strs+1217) +/** Name string for the response-info option */ +#define RESPONSE_INFO_name (ocsptool_opt_strs+1231) +/** Compiled in flag settings for the response-info option */ +#define RESPONSE_INFO_FLAGS (OPTST_DISABLED) + +/** + * generate-request option description: + */ +/** Descriptive text for the generate-request option */ +#define GENERATE_REQUEST_DESC (ocsptool_opt_strs+1245) +/** Upper-cased name for the generate-request option */ +#define GENERATE_REQUEST_NAME (ocsptool_opt_strs+1270) +/** Name string for the generate-request option */ +#define GENERATE_REQUEST_name (ocsptool_opt_strs+1287) +/** Compiled in flag settings for the generate-request option */ +#define GENERATE_REQUEST_FLAGS (OPTST_DISABLED) + +/** + * nonce option description: + */ +/** Descriptive text for the nonce option */ +#define NONCE_DESC (ocsptool_opt_strs+1304) +/** Upper-cased name for the nonce option */ +#define NONCE_NAME (ocsptool_opt_strs+1341) +/** disablement name for the nonce option */ +#define NOT_NONCE_name (ocsptool_opt_strs+1347) +/** disablement prefix for the nonce option */ +#define NOT_NONCE_PFX (ocsptool_opt_strs+1356) +/** Name string for the nonce option */ +#define NONCE_name (NOT_NONCE_name + 3) +/** Compiled in flag settings for the nonce option */ +#define NONCE_FLAGS (OPTST_DISABLED) + +/** + * load-issuer option description: + */ +/** Descriptive text for the load-issuer option */ +#define LOAD_ISSUER_DESC (ocsptool_opt_strs+1359) +/** Upper-cased name for the load-issuer option */ +#define LOAD_ISSUER_NAME (ocsptool_opt_strs+1393) +/** Name string for the load-issuer option */ +#define LOAD_ISSUER_name (ocsptool_opt_strs+1405) +/** Compiled in flag settings for the load-issuer option */ +#define LOAD_ISSUER_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * load-cert option description: + */ +/** Descriptive text for the load-cert option */ +#define LOAD_CERT_DESC (ocsptool_opt_strs+1417) +/** Upper-cased name for the load-cert option */ +#define LOAD_CERT_NAME (ocsptool_opt_strs+1453) +/** Name string for the load-cert option */ +#define LOAD_CERT_name (ocsptool_opt_strs+1463) +/** Compiled in flag settings for the load-cert option */ +#define LOAD_CERT_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * load-trust option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the load-trust option */ +#define LOAD_TRUST_DESC (ocsptool_opt_strs+1473) +/** Upper-cased name for the load-trust option */ +#define LOAD_TRUST_NAME (ocsptool_opt_strs+1507) +/** Name string for the load-trust option */ +#define LOAD_TRUST_name (ocsptool_opt_strs+1518) +/** Other options that appear in conjunction with the load-trust option */ +static int const aLoad_TrustCantList[] = { + INDEX_OPT_LOAD_SIGNER, NO_EQUIVALENT }; +/** Compiled in flag settings for the load-trust option */ +#define LOAD_TRUST_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * load-signer option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the load-signer option */ +#define LOAD_SIGNER_DESC (ocsptool_opt_strs+1529) +/** Upper-cased name for the load-signer option */ +#define LOAD_SIGNER_NAME (ocsptool_opt_strs+1565) +/** Name string for the load-signer option */ +#define LOAD_SIGNER_name (ocsptool_opt_strs+1577) +/** Other options that appear in conjunction with the load-signer option */ +static int const aLoad_SignerCantList[] = { + INDEX_OPT_LOAD_TRUST, NO_EQUIVALENT }; +/** Compiled in flag settings for the load-signer option */ +#define LOAD_SIGNER_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * inder option description: + */ +/** Descriptive text for the inder option */ +#define INDER_DESC (ocsptool_opt_strs+1589) +/** Upper-cased name for the inder option */ +#define INDER_NAME (ocsptool_opt_strs+1644) +/** disablement name for the inder option */ +#define NOT_INDER_name (ocsptool_opt_strs+1650) +/** disablement prefix for the inder option */ +#define NOT_INDER_PFX (ocsptool_opt_strs+1356) +/** Name string for the inder option */ +#define INDER_name (NOT_INDER_name + 3) +/** Compiled in flag settings for the inder option */ +#define INDER_FLAGS (OPTST_DISABLED) + +/** + * load-request option description: + */ +/** Descriptive text for the load-request option */ +#define LOAD_REQUEST_DESC (ocsptool_opt_strs+1659) +/** Upper-cased name for the load-request option */ +#define LOAD_REQUEST_NAME (ocsptool_opt_strs+1699) +/** Name string for the load-request option */ +#define LOAD_REQUEST_name (ocsptool_opt_strs+1712) +/** Compiled in flag settings for the load-request option */ +#define LOAD_REQUEST_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * load-response option description: + */ +/** Descriptive text for the load-response option */ +#define LOAD_RESPONSE_DESC (ocsptool_opt_strs+1725) +/** Upper-cased name for the load-response option */ +#define LOAD_RESPONSE_NAME (ocsptool_opt_strs+1766) +/** Name string for the load-response option */ +#define LOAD_RESPONSE_name (ocsptool_opt_strs+1780) +/** Compiled in flag settings for the load-response option */ +#define LOAD_RESPONSE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * ignore-errors option description: + */ +/** Descriptive text for the ignore-errors option */ +#define IGNORE_ERRORS_DESC (ocsptool_opt_strs+1794) +/** Upper-cased name for the ignore-errors option */ +#define IGNORE_ERRORS_NAME (ocsptool_opt_strs+1825) +/** Name string for the ignore-errors option */ +#define IGNORE_ERRORS_name (ocsptool_opt_strs+1839) +/** Compiled in flag settings for the ignore-errors option */ +#define IGNORE_ERRORS_FLAGS (OPTST_DISABLED) + +/* + * Help/More_Help/Version option descriptions: + */ +#define HELP_DESC (ocsptool_opt_strs+1853) +#define HELP_name (ocsptool_opt_strs+1897) +#ifdef HAVE_WORKING_FORK +#define MORE_HELP_DESC (ocsptool_opt_strs+1902) +#define MORE_HELP_name (ocsptool_opt_strs+1947) +#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +#define MORE_HELP_DESC HELP_DESC +#define MORE_HELP_name HELP_name +#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#endif +#ifdef NO_OPTIONAL_OPT_ARGS +# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ + OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) +#endif +#define VER_DESC (ocsptool_opt_strs+1957) +#define VER_name (ocsptool_opt_strs+1993) +/** + * Declare option callback procedures + */ +extern tOptProc + optionBooleanVal, optionNestedVal, optionNumericVal, + optionPagedUsage, optionPrintVersion, optionResetOpt, + optionStackArg, optionTimeDate, optionTimeVal, + optionUnstackArg, optionVendorOption; +static tOptProc + doOptDebug, doOptInfile, doOptLoad_Cert, + doOptLoad_Issuer, doOptLoad_Request, doOptLoad_Response, + doOptLoad_Signer, doOptLoad_Trust, doUsageOpt; +#define VER_PROC optionPrintVersion + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the ocsptool Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the ocsptool program responds to. + */ +static tOptDesc optDesc[OPTION_CT] = { + { /* entry idx, value */ 0, VALUE_OPT_DEBUG, + /* equiv idx, value */ 0, VALUE_OPT_DEBUG, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DEBUG_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --debug */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptDebug, + /* desc, NAME, name */ DEBUG_DESC, DEBUG_NAME, DEBUG_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 1, VALUE_OPT_VERBOSE, + /* equiv idx, value */ 1, VALUE_OPT_VERBOSE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, NOLIMIT, 0, + /* opt state flags */ VERBOSE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --verbose */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ VERBOSE_DESC, VERBOSE_NAME, VERBOSE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 2, VALUE_OPT_INFILE, + /* equiv idx, value */ 2, VALUE_OPT_INFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --infile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptInfile, + /* desc, NAME, name */ INFILE_DESC, INFILE_NAME, INFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 3, VALUE_OPT_OUTFILE, + /* equiv idx, value */ 3, VALUE_OPT_OUTFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OUTFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --outfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ OUTFILE_DESC, OUTFILE_NAME, OUTFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 4, VALUE_OPT_ASK, + /* equiv idx, value */ 4, VALUE_OPT_ASK, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ ASK_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --ask */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ aAskMustList, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ ASK_DESC, ASK_NAME, ASK_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 5, VALUE_OPT_VERIFY_RESPONSE, + /* equiv idx, value */ 5, VALUE_OPT_VERIFY_RESPONSE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VERIFY_RESPONSE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --verify-response */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ VERIFY_RESPONSE_DESC, VERIFY_RESPONSE_NAME, VERIFY_RESPONSE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 6, VALUE_OPT_REQUEST_INFO, + /* equiv idx, value */ 6, VALUE_OPT_REQUEST_INFO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ REQUEST_INFO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --request-info */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ REQUEST_INFO_DESC, REQUEST_INFO_NAME, REQUEST_INFO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 7, VALUE_OPT_RESPONSE_INFO, + /* equiv idx, value */ 7, VALUE_OPT_RESPONSE_INFO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ RESPONSE_INFO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --response-info */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ RESPONSE_INFO_DESC, RESPONSE_INFO_NAME, RESPONSE_INFO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 8, VALUE_OPT_GENERATE_REQUEST, + /* equiv idx, value */ 8, VALUE_OPT_GENERATE_REQUEST, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ GENERATE_REQUEST_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --generate-request */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ GENERATE_REQUEST_DESC, GENERATE_REQUEST_NAME, GENERATE_REQUEST_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 9, VALUE_OPT_NONCE, + /* equiv idx, value */ 9, VALUE_OPT_NONCE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ NONCE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --nonce */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ NONCE_DESC, NONCE_NAME, NONCE_name, + /* disablement strs */ NOT_NONCE_name, NOT_NONCE_PFX }, + + { /* entry idx, value */ 10, VALUE_OPT_LOAD_ISSUER, + /* equiv idx, value */ 10, VALUE_OPT_LOAD_ISSUER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_ISSUER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-issuer */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptLoad_Issuer, + /* desc, NAME, name */ LOAD_ISSUER_DESC, LOAD_ISSUER_NAME, LOAD_ISSUER_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 11, VALUE_OPT_LOAD_CERT, + /* equiv idx, value */ 11, VALUE_OPT_LOAD_CERT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_CERT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-cert */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptLoad_Cert, + /* desc, NAME, name */ LOAD_CERT_DESC, LOAD_CERT_NAME, LOAD_CERT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 12, VALUE_OPT_LOAD_TRUST, + /* equiv idx, value */ 12, VALUE_OPT_LOAD_TRUST, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_TRUST_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-trust */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, aLoad_TrustCantList, + /* option proc */ doOptLoad_Trust, + /* desc, NAME, name */ LOAD_TRUST_DESC, LOAD_TRUST_NAME, LOAD_TRUST_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 13, VALUE_OPT_LOAD_SIGNER, + /* equiv idx, value */ 13, VALUE_OPT_LOAD_SIGNER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_SIGNER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-signer */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, aLoad_SignerCantList, + /* option proc */ doOptLoad_Signer, + /* desc, NAME, name */ LOAD_SIGNER_DESC, LOAD_SIGNER_NAME, LOAD_SIGNER_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 14, VALUE_OPT_INDER, + /* equiv idx, value */ 14, VALUE_OPT_INDER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INDER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --inder */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ INDER_DESC, INDER_NAME, INDER_name, + /* disablement strs */ NOT_INDER_name, NOT_INDER_PFX }, + + { /* entry idx, value */ 15, VALUE_OPT_LOAD_REQUEST, + /* equiv idx, value */ 15, VALUE_OPT_LOAD_REQUEST, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_REQUEST_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-request */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptLoad_Request, + /* desc, NAME, name */ LOAD_REQUEST_DESC, LOAD_REQUEST_NAME, LOAD_REQUEST_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 16, VALUE_OPT_LOAD_RESPONSE, + /* equiv idx, value */ 16, VALUE_OPT_LOAD_RESPONSE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_RESPONSE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-response */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptLoad_Response, + /* desc, NAME, name */ LOAD_RESPONSE_DESC, LOAD_RESPONSE_NAME, LOAD_RESPONSE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 17, VALUE_OPT_IGNORE_ERRORS, + /* equiv idx, value */ 17, VALUE_OPT_IGNORE_ERRORS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ IGNORE_ERRORS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --ignore-errors */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ IGNORE_ERRORS_DESC, IGNORE_ERRORS_NAME, IGNORE_ERRORS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VER_FLAGS, AOUSE_VERSION, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ VER_PROC, + /* desc, NAME, name */ VER_DESC, NULL, VER_name, + /* disablement strs */ NULL, NULL }, + + + + { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doUsageOpt, + /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionPagedUsage, + /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, + /* disablement strs */ NULL, NULL } +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** Reference to the upper cased version of ocsptool. */ +#define zPROGNAME (ocsptool_opt_strs+2001) +/** Reference to the title line for ocsptool usage. */ +#define zUsageTitle (ocsptool_opt_strs+2010) +/** There is no ocsptool configuration file. */ +#define zRcName NULL +/** There are no directories to search for ocsptool config files. */ +#define apzHomeList NULL +/** The ocsptool program bug email address. */ +#define zBugsAddr (ocsptool_opt_strs+2096) +/** Clarification/explanation of what ocsptool does. */ +#define zExplain (ocsptool_opt_strs+2116) +/** Extra detail explaining what ocsptool does. */ +#define zDetail (ocsptool_opt_strs+2118) +/** The full version string for ocsptool. */ +#define zFullVersion (ocsptool_opt_strs+2249) +/* extracted from optcode.tlib near line 364 */ + +#if defined(ENABLE_NLS) +# define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT + static tOptionXlateProc translate_option_strings; +#else +# define OPTPROC_BASE OPTPROC_NONE +# define translate_option_strings NULL +#endif /* ENABLE_NLS */ + +#define ocsptool_full_usage (NULL) +#define ocsptool_short_usage (ocsptool_opt_strs+2268) + +#endif /* not defined __doxygen__ */ + +/* + * Create the static procedure(s) declared above. + */ +/** + * The callout function that invokes the optionUsage function. + * + * @param[in] opts the AutoOpts option description structure + * @param[in] od the descriptor for the "help" (usage) option. + * @noreturn + */ +static void +doUsageOpt(tOptions * opts, tOptDesc * od) +{ + int ex_code; + ex_code = OCSPTOOL_EXIT_SUCCESS; + optionUsage(&ocsptoolOptions, ex_code); + /* NOTREACHED */ + exit(OCSPTOOL_EXIT_FAILURE); + (void)opts; + (void)od; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the debug option. + * Specifies the debug level. + * @param[in] pOptions the ocsptool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptDebug(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[1] = { + { 0 , 9999 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 1; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + + emit_ranges: +optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the infile option. + * + * @param[in] pOptions the ocsptool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptInfile(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the load-issuer option. + * + * @param[in] pOptions the ocsptool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptLoad_Issuer(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the load-cert option. + * + * @param[in] pOptions the ocsptool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptLoad_Cert(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the load-trust option. + * + * @param[in] pOptions the ocsptool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptLoad_Trust(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the load-signer option. + * + * @param[in] pOptions the ocsptool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptLoad_Signer(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the load-request option. + * + * @param[in] pOptions the ocsptool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptLoad_Request(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the load-response option. + * + * @param[in] pOptions the ocsptool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptLoad_Response(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} +/* extracted from optmain.tlib near line 1250 */ + +/** + * The directory containing the data associated with ocsptool. + */ +#ifndef PKGDATADIR +# define PKGDATADIR "" +#endif + +/** + * Information about the person or institution that packaged ocsptool + * for the current distribution. + */ +#ifndef WITH_PACKAGER +# define ocsptool_packager_info NULL +#else +/** Packager information for ocsptool. */ +static char const ocsptool_packager_info[] = + "Packaged by " WITH_PACKAGER + +# ifdef WITH_PACKAGER_VERSION + " ("WITH_PACKAGER_VERSION")" +# endif + +# ifdef WITH_PACKAGER_BUG_REPORTS + "\nReport ocsptool bugs to " WITH_PACKAGER_BUG_REPORTS +# endif + "\n"; +#endif +#ifndef __doxygen__ + +#endif /* __doxygen__ */ +/** + * The option definitions for ocsptool. The one structure that + * binds them all. + */ +tOptions ocsptoolOptions = { + OPTIONS_STRUCT_VERSION, + 0, NULL, /* original argc + argv */ + ( OPTPROC_BASE + + OPTPROC_ERRSTOP + + OPTPROC_SHORTOPT + + OPTPROC_LONGOPT + + OPTPROC_NO_REQ_OPT + + OPTPROC_NEGATIONS + + OPTPROC_NO_ARGS + + OPTPROC_GNUUSAGE + + OPTPROC_MISUSE ), + 0, NULL, /* current option index, current option */ + NULL, NULL, zPROGNAME, + zRcName, zCopyright, zLicenseDescrip, + zFullVersion, apzHomeList, zUsageTitle, + zExplain, zDetail, optDesc, + zBugsAddr, /* address to send bugs to */ + NULL, NULL, /* extensions/saved state */ + optionUsage, /* usage procedure */ + translate_option_strings, /* translation procedure */ + /* + * Indexes to special options + */ + { INDEX_OPT_MORE_HELP, /* more-help option index */ + NO_EQUIVALENT, /* save option index */ + NO_EQUIVALENT, /* '-#' option index */ + NO_EQUIVALENT /* index of default opt */ + }, + 21 /* full option count */, 18 /* user option count */, + ocsptool_full_usage, ocsptool_short_usage, + NULL, NULL, + PKGDATADIR, ocsptool_packager_info +}; + +#if ENABLE_NLS +/** + * This code is designed to translate translatable option text for the + * ocsptool program. These translations happen upon entry + * to optionProcess(). + */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#ifdef HAVE_DCGETTEXT +# include <gettext.h> +#endif +#include <autoopts/usage-txt.h> + +static char * AO_gettext(char const * pz); +static void coerce_it(void ** s); + +/** + * AutoGen specific wrapper function for gettext. It relies on the macro _() + * to convert from English to the target language, then strdup-duplicates the + * result string. It tries the "libopts" domain first, then whatever has been + * set via the \a textdomain(3) call. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * +AO_gettext(char const * pz) +{ + char * res; + if (pz == NULL) + return NULL; +#ifdef HAVE_DCGETTEXT + /* + * While processing the option_xlateable_txt data, try to use the + * "libopts" domain. Once we switch to the option descriptor data, + * do *not* use that domain. + */ + if (option_xlateable_txt.field_ct != 0) { + res = dgettext("libopts", pz); + if (res == pz) + res = (char *)VOIDP(_(pz)); + } else + res = (char *)VOIDP(_(pz)); +#else + res = (char *)VOIDP(_(pz)); +#endif + if (res == pz) + return res; + res = strdup(res); + if (res == NULL) { + fputs(_("No memory for duping translated strings\n"), stderr); + exit(OCSPTOOL_EXIT_FAILURE); + } + return res; +} + +/** + * All the pointers we use are marked "* const", but they are stored in + * writable memory. Coerce the mutability and set the pointer. + */ +static void coerce_it(void ** s) { *s = AO_gettext(*s); +} + +/** + * Translate all the translatable strings in the ocsptoolOptions + * structure defined above. This is done only once. + */ +static void +translate_option_strings(void) +{ + tOptions * const opts = &ocsptoolOptions; + + /* + * Guard against re-translation. It won't work. The strings will have + * been changed by the first pass through this code. One shot only. + */ + if (option_xlateable_txt.field_ct != 0) { + /* + * Do the translations. The first pointer follows the field count + * field. The field count field is the size of a pointer. + */ + char ** ppz = (char**)VOIDP(&(option_xlateable_txt)); + int ix = option_xlateable_txt.field_ct; + + do { + ppz++; /* skip over field_ct */ + *ppz = AO_gettext(*ppz); + } while (--ix > 0); + /* prevent re-translation and disable "libopts" domain lookup */ + option_xlateable_txt.field_ct = 0; + + coerce_it(VOIDP(&(opts->pzCopyright))); + coerce_it(VOIDP(&(opts->pzCopyNotice))); + coerce_it(VOIDP(&(opts->pzFullVersion))); + coerce_it(VOIDP(&(opts->pzUsageTitle))); + coerce_it(VOIDP(&(opts->pzExplain))); + coerce_it(VOIDP(&(opts->pzDetail))); + { + tOptDesc * od = opts->pOptDesc; + for (ix = opts->optCt; ix > 0; ix--, od++) + coerce_it(VOIDP(&(od->pzText))); + } + } +} +#endif /* ENABLE_NLS */ + +#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT +/** I18N function strictly for xgettext. Do not compile. */ +static void bogus_function(void) { + /* TRANSLATORS: + + The following dummy function was crated solely so that xgettext can + extract the correct strings. These strings are actually referenced + by a field name in the ocsptoolOptions structure noted in the + comments below. The literal text is defined in ocsptool_opt_strs. + + NOTE: the strings below are segmented with respect to the source string + ocsptool_opt_strs. The strings above are handed off for translation + at run time a paragraph at a time. Consequently, they are presented here + for translation a paragraph at a time. + + ALSO: often the description for an option will reference another option + by name. These are set off with apostrophe quotes (I hope). Do not + translate option names. + */ + /* referenced via ocsptoolOptions.pzCopyright */ + puts(_("ocsptool @VERSION@\n\ +Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n\ +This is free software. It is licensed for use, modification and\n\ +redistribution under the terms of the GNU General Public License,\n\ +version 3 or later <http://gnu.org/licenses/gpl.html>\n")); + + /* referenced via ocsptoolOptions.pzCopyNotice */ + puts(_("ocsptool is free software: you can redistribute it and/or modify it under\n\ +the terms of the GNU General Public License as published by the Free\n\ +Software Foundation, either version 3 of the License, or (at your option)\n\ +any later version.\n\n")); + puts(_("ocsptool is distributed in the hope that it will be useful, but WITHOUT ANY\n\ +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n\ +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n\ +details.\n\n")); + puts(_("You should have received a copy of the GNU General Public License along\n\ +with this program. If not, see <http://www.gnu.org/licenses/>.\n")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("Enable debugging")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("More verbose output")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("Input file")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("Output file")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("Ask an OCSP/HTTP server on a certificate validity")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("Verify response")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("Print information on a OCSP request")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("Print information on a OCSP response")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("Generate an OCSP request")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("Use (or not) a nonce to OCSP request")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("Read issuer certificate from file")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("Read certificate to check from file")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("Read OCSP trust anchors from file")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("Read OCSP response signer from file")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("Use DER format for input certificates and private keys")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("Read DER encoded OCSP request from file")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("Read DER encoded OCSP response from file")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("Ignore any verification errors")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("display extended usage information and exit")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("extended usage information passed thru pager")); + + /* referenced via ocsptoolOptions.pOptDesc->pzText */ + puts(_("output version information and exit")); + + /* referenced via ocsptoolOptions.pzUsageTitle */ + puts(_("ocsptool - GnuTLS OCSP tool\n\ +Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n")); + + /* referenced via ocsptoolOptions.pzExplain */ + puts(_("\n")); + + /* referenced via ocsptoolOptions.pzDetail */ + puts(_("Ocsptool is a program that can parse and print information about OCSP\n\ +requests/responses, generate requests and verify responses.\n")); + + /* referenced via ocsptoolOptions.pzFullVersion */ + puts(_("ocsptool @VERSION@")); + + /* referenced via ocsptoolOptions.pzFullUsage */ + puts(_("<<<NOT-FOUND>>>")); + + /* referenced via ocsptoolOptions.pzShortUsage */ + puts(_("ocsptool [options]\n\ +ocsptool --help for usage instructions.\n")); + /* LIBOPTS-MESSAGES: */ +#line 67 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 93 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 53 "../init.c" + puts(_("AutoOpts function called without option descriptor\n")); +#line 86 "../init.c" + puts(_("\tThis exceeds the compiled library version: ")); +#line 84 "../init.c" + puts(_("Automated Options Processing Error!\n" + "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); +#line 80 "../autoopts.c" + puts(_("realloc of %d bytes at 0x%p failed\n")); +#line 88 "../init.c" + puts(_("\tThis is less than the minimum library version: ")); +#line 121 "../version.c" + puts(_("Automated Options version %s\n" + "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); +#line 87 "../makeshell.c" + puts(_("(AutoOpts bug): %s.\n")); +#line 90 "../reset.c" + puts(_("optionResetOpt() called, but reset-option not configured")); +#line 295 "../usage.c" + puts(_("could not locate the 'help' option")); +#line 336 "../autoopts.c" + puts(_("optionProcess() was called with invalid data")); +#line 751 "../usage.c" + puts(_("invalid argument type specified")); +#line 598 "../find.c" + puts(_("defaulted to option with optional arg")); +#line 76 "../alias.c" + puts(_("aliasing option is out of range.")); +#line 235 "../enum.c" + puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); +#line 108 "../find.c" + puts(_(" The following options match:\n")); +#line 293 "../find.c" + puts(_("%s: ambiguous option name: %s (matches %d options)\n")); +#line 161 "../check.c" + puts(_("%s: Command line arguments required\n")); +#line 43 "../alias.c" + puts(_("%d %s%s options allowed\n")); +#line 94 "../makeshell.c" + puts(_("%s error %d (%s) calling %s for '%s'\n")); +#line 306 "../makeshell.c" + puts(_("interprocess pipe")); +#line 168 "../version.c" + puts(_("error: version option argument '%c' invalid. Use:\n" + "\t'v' - version only\n" + "\t'c' - version and copyright\n" + "\t'n' - version and full copyright notice\n")); +#line 58 "../check.c" + puts(_("%s error: the '%s' and '%s' options conflict\n")); +#line 217 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 430 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 38 "../alias.c" + puts(_("-equivalence")); +#line 469 "../find.c" + puts(_("%s: illegal option -- %c\n")); +#line 110 "../reset.c" + puts(_("%s: illegal option -- %c\n")); +#line 271 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 755 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 118 "../reset.c" + puts(_("%s: illegal option -- %s\n")); +#line 335 "../find.c" + puts(_("%s: unknown vendor extension option -- %s\n")); +#line 160 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 170 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 750 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 1084 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 385 "../find.c" + puts(_("%s: invalid option name: %s\n")); +#line 527 "../find.c" + puts(_("%s: The '%s' option requires an argument.\n")); +#line 156 "../autoopts.c" + puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" + "\t'%s' and '%s'.")); +#line 94 "../check.c" + puts(_("%s error: The %s option is required\n")); +#line 632 "../find.c" + puts(_("%s: The '%s' option cannot have an argument.\n")); +#line 151 "../check.c" + puts(_("%s: Command line arguments are not allowed.\n")); +#line 536 "../save.c" + puts(_("error %d (%s) creating %s\n")); +#line 235 "../enum.c" + puts(_("%s error: '%s' does not match any %s keywords.\n")); +#line 93 "../reset.c" + puts(_("%s error: The '%s' option requires an argument.\n")); +#line 186 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 239 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 143 "../restore.c" + puts(_("%s error: no saved option state\n")); +#line 231 "../autoopts.c" + puts(_("'%s' is not a command line option.\n")); +#line 113 "../time.c" + puts(_("%s error: '%s' is not a recognizable date/time.\n")); +#line 131 "../save.c" + puts(_("'%s' not defined\n")); +#line 50 "../time.c" + puts(_("%s error: '%s' is not a recognizable time duration.\n")); +#line 92 "../check.c" + puts(_("%s error: The %s option must appear %d times.\n")); +#line 165 "../numeric.c" + puts(_("%s error: '%s' is not a recognizable number.\n")); +#line 201 "../enum.c" + puts(_("%s error: %s exceeds %s keyword count\n")); +#line 333 "../usage.c" + puts(_("Try '%s %s' for more information.\n")); +#line 45 "../alias.c" + puts(_("one %s%s option allowed\n")); +#line 208 "../makeshell.c" + puts(_("standard output")); +#line 943 "../makeshell.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard output")); +#line 418 "../usage.c" + puts(_("standard output")); +#line 628 "../usage.c" + puts(_("standard output")); +#line 175 "../version.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard error")); +#line 418 "../usage.c" + puts(_("standard error")); +#line 628 "../usage.c" + puts(_("standard error")); +#line 175 "../version.c" + puts(_("standard error")); +#line 208 "../makeshell.c" + puts(_("write")); +#line 943 "../makeshell.c" + puts(_("write")); +#line 276 "../usage.c" + puts(_("write")); +#line 417 "../usage.c" + puts(_("write")); +#line 627 "../usage.c" + puts(_("write")); +#line 174 "../version.c" + puts(_("write")); +#line 60 "../numeric.c" + puts(_("%s error: %s option value %ld is out of range.\n")); +#line 44 "../check.c" + puts(_("%s error: %s option requires the %s option\n")); +#line 130 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 185 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 238 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 257 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 535 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); + /* END-LIBOPTS-MESSAGES */ + + /* USAGE-TEXT: */ +#line 876 "../usage.c" + puts(_("\t\t\t\t- an alternate for '%s'\n")); +#line 1151 "../usage.c" + puts(_("Version, usage and configuration options:")); +#line 927 "../usage.c" + puts(_("\t\t\t\t- default option for unnamed options\n")); +#line 840 "../usage.c" + puts(_("\t\t\t\t- disabled as '--%s'\n")); +#line 1120 "../usage.c" + puts(_(" --- %-14s %s\n")); +#line 1118 "../usage.c" + puts(_("This option has been disabled")); +#line 867 "../usage.c" + puts(_("\t\t\t\t- enabled by default\n")); +#line 40 "../alias.c" + puts(_("%s error: only ")); +#line 1197 "../usage.c" + puts(_(" - examining environment variables named %s_*\n")); +#line 168 "../file.c" + puts(_("\t\t\t\t- file must not pre-exist\n")); +#line 172 "../file.c" + puts(_("\t\t\t\t- file must pre-exist\n")); +#line 383 "../usage.c" + puts(_("Options are specified by doubled hyphens and their name or by a single\n" + "hyphen and the flag character.\n")); +#line 921 "../makeshell.c" + puts(_("\n" + "= = = = = = = =\n\n" + "This incarnation of genshell will produce\n" + "a shell script to parse the options for %s:\n\n")); +#line 167 "../enum.c" + puts(_(" or an integer mask with any of the lower %d bits set\n")); +#line 900 "../usage.c" + puts(_("\t\t\t\t- is a set membership option\n")); +#line 921 "../usage.c" + puts(_("\t\t\t\t- must appear between %d and %d times\n")); +#line 385 "../usage.c" + puts(_("Options are specified by single or double hyphens and their name.\n")); +#line 907 "../usage.c" + puts(_("\t\t\t\t- may appear multiple times\n")); +#line 894 "../usage.c" + puts(_("\t\t\t\t- may not be preset\n")); +#line 1312 "../usage.c" + puts(_(" Arg Option-Name Description\n")); +#line 1248 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1306 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1307 "../usage.c" + puts(_(" %3s %s")); +#line 1313 "../usage.c" + puts(_(" %3s %s")); +#line 390 "../usage.c" + puts(_("The '-#<number>' option may omit the hash char\n")); +#line 386 "../usage.c" + puts(_("All arguments are named options.\n")); +#line 974 "../usage.c" + puts(_(" - reading file %s")); +#line 412 "../usage.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 100 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 129 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 906 "../usage.c" + puts(_("\t\t\t\t- may NOT appear - preset only\n")); +#line 947 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 1195 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 685 "../usage.c" + puts(_("prohibits these options:\n")); +#line 680 "../usage.c" + puts(_("prohibits the option '%s'\n")); +#line 81 "../numeric.c" + puts(_("%s%ld to %ld")); +#line 79 "../numeric.c" + puts(_("%sgreater than or equal to %ld")); +#line 75 "../numeric.c" + puts(_("%s%ld exactly")); +#line 68 "../numeric.c" + puts(_("%sit must lie in one of the ranges:\n")); +#line 68 "../numeric.c" + puts(_("%sit must be in the range:\n")); +#line 88 "../numeric.c" + puts(_(", or\n")); +#line 66 "../numeric.c" + puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); +#line 77 "../numeric.c" + puts(_("%sless than or equal to %ld")); +#line 393 "../usage.c" + puts(_("Operands and options may be intermixed. They will be reordered.\n")); +#line 655 "../usage.c" + puts(_("requires the option '%s'\n")); +#line 658 "../usage.c" + puts(_("requires these options:\n")); +#line 1324 "../usage.c" + puts(_(" Arg Option-Name Req? Description\n")); +#line 1318 "../usage.c" + puts(_(" Flg Arg Option-Name Req? Description\n")); +#line 168 "../enum.c" + puts(_("or you may use a numeric representation. Preceding these with a '!'\n" + "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" + "will set them all. Multiple entries may be passed as an option\n" + "argument list.\n")); +#line 913 "../usage.c" + puts(_("\t\t\t\t- may appear up to %d times\n")); +#line 77 "../enum.c" + puts(_("The valid \"%s\" option keywords are:\n")); +#line 1155 "../usage.c" + puts(_("The next option supports vendor supported extra options:")); +#line 776 "../usage.c" + puts(_("These additional options are:")); + /* END-USAGE-TEXT */ +} +#endif /* uncompilable code */ +#ifdef __cplusplus +} +#endif +/* ocsptool-args.c ends here */ diff --git a/src/ocsptool-args.h.bak b/src/ocsptool-args.h.bak new file mode 100644 index 0000000000..0d558ddf18 --- /dev/null +++ b/src/ocsptool-args.h.bak @@ -0,0 +1,247 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (ocsptool-args.h) + * + * It has been AutoGen-ed + * From the definitions ocsptool-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the ocsptool author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The ocsptool program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * ocsptool is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * ocsptool is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ +/** + * This file contains the programmatic interface to the Automated + * Options generated for the ocsptool program. + * These macros are documented in the AutoGen info file in the + * "AutoOpts" chapter. Please refer to that doc for usage help. + */ +#ifndef AUTOOPTS_OCSPTOOL_ARGS_H_GUARD +#define AUTOOPTS_OCSPTOOL_ARGS_H_GUARD 1 +#include "config.h" +#include <autoopts/options.h> + +/** + * Ensure that the library used for compiling this generated header is at + * least as new as the version current when the header template was released + * (not counting patch version increments). Also ensure that the oldest + * tolerable version is at least as old as what was current when the header + * template was released. + */ +#define AO_TEMPLATE_VERSION 167937 +#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ + || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) +# error option template version mismatches autoopts/options.h header + Choke Me. +#endif + +/** + * Enumeration of each option type for ocsptool + */ +typedef enum { + INDEX_OPT_DEBUG = 0, + INDEX_OPT_VERBOSE = 1, + INDEX_OPT_INFILE = 2, + INDEX_OPT_OUTFILE = 3, + INDEX_OPT_ASK = 4, + INDEX_OPT_VERIFY_RESPONSE = 5, + INDEX_OPT_REQUEST_INFO = 6, + INDEX_OPT_RESPONSE_INFO = 7, + INDEX_OPT_GENERATE_REQUEST = 8, + INDEX_OPT_NONCE = 9, + INDEX_OPT_LOAD_ISSUER = 10, + INDEX_OPT_LOAD_CERT = 11, + INDEX_OPT_LOAD_TRUST = 12, + INDEX_OPT_LOAD_SIGNER = 13, + INDEX_OPT_INDER = 14, + INDEX_OPT_LOAD_REQUEST = 15, + INDEX_OPT_LOAD_RESPONSE = 16, + INDEX_OPT_IGNORE_ERRORS = 17, + INDEX_OPT_VERSION = 18, + INDEX_OPT_HELP = 19, + INDEX_OPT_MORE_HELP = 20 +} teOptIndex; +/** count of all options for ocsptool */ +#define OPTION_CT 21 +/** ocsptool version */ +#define OCSPTOOL_VERSION "@VERSION@" +/** Full ocsptool version text */ +#define OCSPTOOL_FULL_VERSION "ocsptool @VERSION@" + +/** + * Interface defines for all options. Replace "n" with the UPPER_CASED + * option name (as in the teOptIndex enumeration above). + * e.g. HAVE_OPT(DEBUG) + */ +#define DESC(n) (ocsptoolOptions.pOptDesc[INDEX_OPT_## n]) +/** 'true' if an option has been specified in any way */ +#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) +/** The string argument to an option. The argument type must be \"string\". */ +#define OPT_ARG(n) (DESC(n).optArg.argString) +/** Mask the option state revealing how an option was specified. + * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET, + * \a OPTST_DEFINED, \a OPTST_RESET or zero. + */ +#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) +/** Count of option's occurrances *on the command line*. */ +#define COUNT_OPT(n) (DESC(n).optOccCt) +/** mask of \a OPTST_SET and \a OPTST_DEFINED. */ +#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) +/** 'true' if \a HAVE_OPT would yield 'false'. */ +#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) +/** 'true' if OPTST_DISABLED bit not set. */ +#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) +/** number of stacked option arguments. + * Valid only for stacked option arguments. */ +#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) +/** stacked argument vector. + * Valid only for stacked option arguments. */ +#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) +/** Reset an option. */ +#define CLEAR_OPT(n) STMTS( \ + DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + DESC(n).fOptState |= OPTST_DISABLED; \ + DESC(n).optCookie = NULL ) +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Enumeration of ocsptool exit codes + */ +typedef enum { + OCSPTOOL_EXIT_SUCCESS = 0, + OCSPTOOL_EXIT_FAILURE = 1, + OCSPTOOL_EXIT_USAGE_ERROR = 64, + OCSPTOOL_EXIT_LIBOPTS_FAILURE = 70 +} ocsptool_exit_code_t; +/** + * Interface defines for specific options. + * @{ + */ +#define VALUE_OPT_DEBUG 'd' + +#define OPT_VALUE_DEBUG (DESC(DEBUG).optArg.argInt) +#define VALUE_OPT_VERBOSE 'V' +#define VALUE_OPT_INFILE 0x1001 +#define VALUE_OPT_OUTFILE 0x1002 +#define VALUE_OPT_ASK 0x1003 +#define VALUE_OPT_VERIFY_RESPONSE 'e' +#define VALUE_OPT_REQUEST_INFO 'i' +#define VALUE_OPT_RESPONSE_INFO 'j' +#define VALUE_OPT_GENERATE_REQUEST 'q' +#define VALUE_OPT_NONCE 0x1004 +#define VALUE_OPT_LOAD_ISSUER 0x1005 +#define VALUE_OPT_LOAD_CERT 0x1006 +#define VALUE_OPT_LOAD_TRUST 0x1007 +#define VALUE_OPT_LOAD_SIGNER 0x1008 +#define VALUE_OPT_INDER 0x1009 +#define VALUE_OPT_LOAD_REQUEST 'Q' +#define VALUE_OPT_LOAD_RESPONSE 'S' +#define VALUE_OPT_IGNORE_ERRORS 0x100A +/** option flag (value) for help-value option */ +#define VALUE_OPT_HELP 'h' +/** option flag (value) for more-help-value option */ +#define VALUE_OPT_MORE_HELP '!' +/** option flag (value) for version-value option */ +#define VALUE_OPT_VERSION 'v' +/* + * Interface defines not associated with particular options + */ +#define ERRSKIP_OPTERR STMTS(ocsptoolOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(ocsptoolOptions.fOptSet |= OPTPROC_ERRSTOP) +#define RESTART_OPT(n) STMTS( \ + ocsptoolOptions.curOptIdx = (n); \ + ocsptoolOptions.pzCurOpt = NULL ) +#define START_OPT RESTART_OPT(1) +#define USAGE(c) (*ocsptoolOptions.pUsageProc)(&ocsptoolOptions, c) + +#ifdef __cplusplus +extern "C" { +#endif +/* + * global exported definitions + */ +#include <gettext.h> + + +/* * * * * * + * + * Declare the ocsptool option descriptor. + */ +extern tOptions ocsptoolOptions; + +#if defined(ENABLE_NLS) +# ifndef _ +# include <stdio.h> +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include <libintl.h> +# endif + +# ifndef ATTRIBUTE_FORMAT_ARG +# define ATTRIBUTE_FORMAT_ARG(_a) +# endif + +static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1); +static inline char* aoGetsText(char const* pz) { + if (pz == NULL) return NULL; + return (char*)gettext(pz); +} +# define _(s) aoGetsText(s) +# endif /* _() */ + +# define OPT_NO_XLAT_CFG_NAMES STMTS(ocsptoolOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT_CFG;) +# define OPT_NO_XLAT_OPT_NAMES STMTS(ocsptoolOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) + +# define OPT_XLAT_CFG_NAMES STMTS(ocsptoolOptions.fOptSet &= \ + ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) +# define OPT_XLAT_OPT_NAMES STMTS(ocsptoolOptions.fOptSet &= \ + ~OPTPROC_NXLAT_OPT;) + +#else /* ENABLE_NLS */ +# define OPT_NO_XLAT_CFG_NAMES +# define OPT_NO_XLAT_OPT_NAMES + +# define OPT_XLAT_CFG_NAMES +# define OPT_XLAT_OPT_NAMES + +# ifndef _ +# define _(_s) _s +# endif +#endif /* ENABLE_NLS */ + +#ifdef __cplusplus +} +#endif +#endif /* AUTOOPTS_OCSPTOOL_ARGS_H_GUARD */ + +/* ocsptool-args.h ends here */ diff --git a/src/p11tool-args.c.bak b/src/p11tool-args.c.bak new file mode 100644 index 0000000000..9b6f759081 --- /dev/null +++ b/src/p11tool-args.c.bak @@ -0,0 +1,3160 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (p11tool-args.c) + * + * It has been AutoGen-ed + * From the definitions p11tool-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the p11tool author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The p11tool program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * p11tool is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * p11tool is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "p11tool-args.h" +#include <sys/types.h> + +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> + +#ifdef __cplusplus +extern "C" { +#endif +extern FILE * option_usage_fp; +#define zCopyright (p11tool_opt_strs+0) +#define zLicenseDescrip (p11tool_opt_strs+288) + + +#ifndef NULL +# define NULL 0 +#endif + +/** + * static const strings for p11tool options + */ +static char const p11tool_opt_strs[5676] = +/* 0 */ "p11tool @VERSION@\n" + "Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n" + "This is free software. It is licensed for use, modification and\n" + "redistribution under the terms of the GNU General Public License,\n" + "version 3 or later <http://gnu.org/licenses/gpl.html>\n\0" +/* 288 */ "p11tool is free software: you can redistribute it and/or modify it under\n" + "the terms of the GNU General Public License as published by the Free\n" + "Software Foundation, either version 3 of the License, or (at your option)\n" + "any later version.\n\n" + "p11tool is distributed in the hope that it will be useful, but WITHOUT ANY\n" + "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n" + "FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n" + "details.\n\n" + "You should have received a copy of the GNU General Public License along\n" + "with this program. If not, see <http://www.gnu.org/licenses/>.\n\0" +/* 891 */ "Tokens:\0" +/* 899 */ "List all available tokens\0" +/* 925 */ "LIST_TOKENS\0" +/* 937 */ "list-tokens\0" +/* 949 */ "List the URLs available tokens\0" +/* 980 */ "LIST_TOKEN_URLS\0" +/* 996 */ "list-token-urls\0" +/* 1012 */ "List all available mechanisms in a token\0" +/* 1053 */ "LIST_MECHANISMS\0" +/* 1069 */ "list-mechanisms\0" +/* 1085 */ "Initializes a PKCS #11 token\0" +/* 1114 */ "INITIALIZE\0" +/* 1125 */ "initialize\0" +/* 1136 */ "Initializes/Resets a PKCS #11 token user PIN\0" +/* 1181 */ "INITIALIZE_PIN\0" +/* 1196 */ "initialize-pin\0" +/* 1211 */ "Initializes/Resets a PKCS #11 token security officer PIN\0" +/* 1268 */ "INITIALIZE_SO_PIN\0" +/* 1286 */ "initialize-so-pin\0" +/* 1304 */ "Specify the PIN to use on token initialization\0" +/* 1351 */ "SET_PIN\0" +/* 1359 */ "set-pin\0" +/* 1367 */ "Specify the Security Officer's PIN to use on token initialization\0" +/* 1433 */ "SET_SO_PIN\0" +/* 1444 */ "set-so-pin\0" +/* 1455 */ "Object listing:\0" +/* 1471 */ "List all available objects in a token\0" +/* 1509 */ "LIST_ALL\0" +/* 1518 */ "list-all\0" +/* 1527 */ "List all available certificates in a token\0" +/* 1570 */ "LIST_ALL_CERTS\0" +/* 1585 */ "list-all-certs\0" +/* 1600 */ "List all certificates that have an associated private key\0" +/* 1658 */ "LIST_CERTS\0" +/* 1669 */ "list-certs\0" +/* 1680 */ "List all available private keys in a token\0" +/* 1723 */ "LIST_ALL_PRIVKEYS\0" +/* 1741 */ "list-all-privkeys\0" +/* 1759 */ "an alias for the 'list-all-privkeys' option\0" +/* 1803 */ "list-privkeys\0" +/* 1817 */ "list-keys\0" +/* 1827 */ "List all available certificates marked as trusted\0" +/* 1877 */ "LIST_ALL_TRUSTED\0" +/* 1894 */ "list-all-trusted\0" +/* 1911 */ "Export the object specified by the URL\0" +/* 1950 */ "EXPORT\0" +/* 1957 */ "export\0" +/* 1964 */ "Export the certificate object specified by the URL\0" +/* 2015 */ "EXPORT_STAPLED\0" +/* 2030 */ "export-stapled\0" +/* 2045 */ "Export the certificate specified by the URL and its chain of trust\0" +/* 2112 */ "EXPORT_CHAIN\0" +/* 2125 */ "export-chain\0" +/* 2138 */ "Export the public key for a private key\0" +/* 2178 */ "EXPORT_PUBKEY\0" +/* 2192 */ "export-pubkey\0" +/* 2206 */ "List information on an available object in a token\0" +/* 2257 */ "INFO\0" +/* 2262 */ "info\0" +/* 2267 */ "an alias for the 'mark-trusted' option\0" +/* 2306 */ "trusted\0" +/* 2314 */ "an alias for the 'mark-distrusted' option\0" +/* 2356 */ "distrusted\0" +/* 2367 */ "Key generation:\0" +/* 2383 */ "Generate an RSA private-public key pair\0" +/* 2423 */ "GENERATE_RSA\0" +/* 2436 */ "generate-rsa\0" +/* 2449 */ "Generate a DSA private-public key pair\0" +/* 2488 */ "GENERATE_DSA\0" +/* 2501 */ "generate-dsa\0" +/* 2514 */ "Generate an ECDSA private-public key pair\0" +/* 2556 */ "GENERATE_ECC\0" +/* 2569 */ "generate-ecc\0" +/* 2582 */ "Specify the number of bits for the key generate\0" +/* 2630 */ "BITS\0" +/* 2635 */ "bits\0" +/* 2640 */ "Specify the curve used for EC key generation\0" +/* 2685 */ "CURVE\0" +/* 2691 */ "curve\0" +/* 2697 */ "Specify the security level\0" +/* 2724 */ "SEC_PARAM\0" +/* 2734 */ "sec-param\0" +/* 2744 */ "Writing objects:\0" +/* 2761 */ "Set the CKA_ID (in hex) for the specified by the URL object\0" +/* 2821 */ "SET_ID\0" +/* 2828 */ "set-id\0" +/* 2835 */ "Set the CKA_LABEL for the specified by the URL object\0" +/* 2889 */ "SET_LABEL\0" +/* 2899 */ "set-label\0" +/* 2909 */ "Writes the loaded objects to a PKCS #11 token\0" +/* 2955 */ "WRITE\0" +/* 2961 */ "write\0" +/* 2967 */ "Deletes the objects matching the given PKCS #11 URL\0" +/* 3019 */ "DELETE\0" +/* 3026 */ "delete\0" +/* 3033 */ "Sets a label for the write operation\0" +/* 3070 */ "LABEL\0" +/* 3076 */ "label\0" +/* 3082 */ "Sets an ID for the write operation\0" +/* 3117 */ "ID\0" +/* 3120 */ "id\0" +/* 3123 */ "Marks the generated key to be a wrapping key\0" +/* 3168 */ "MARK_WRAP\0" +/* 3178 */ "no-mark-wrap\0" +/* 3191 */ "no\0" +/* 3194 */ "Marks the object to be written as trusted\0" +/* 3236 */ "MARK_TRUSTED\0" +/* 3249 */ "no-mark-trusted\0" +/* 3265 */ "When retrieving objects, it requires the objects to be distrusted\n" + "(blacklisted)\0" +/* 3345 */ "MARK_DISTRUSTED\0" +/* 3361 */ "mark-distrusted\0" +/* 3377 */ "Marks the object to be written for decryption\0" +/* 3423 */ "MARK_DECRYPT\0" +/* 3436 */ "no-mark-decrypt\0" +/* 3452 */ "Marks the object to be written for signature generation\0" +/* 3508 */ "MARK_SIGN\0" +/* 3518 */ "no-mark-sign\0" +/* 3531 */ "Marks the object to be written as a CA\0" +/* 3570 */ "MARK_CA\0" +/* 3578 */ "no-mark-ca\0" +/* 3589 */ "Marks the object to be written as private\0" +/* 3631 */ "MARK_PRIVATE\0" +/* 3644 */ "no-mark-private\0" +/* 3660 */ "an alias for the 'mark-ca' option\0" +/* 3694 */ "ca\0" +/* 3697 */ "an alias for the 'mark-private' option\0" +/* 3736 */ "private\0" +/* 3744 */ "Provide a hex encoded secret key\0" +/* 3777 */ "SECRET_KEY\0" +/* 3788 */ "secret-key\0" +/* 3799 */ "Private key file to use\0" +/* 3823 */ "LOAD_PRIVKEY\0" +/* 3836 */ "load-privkey\0" +/* 3849 */ "Public key file to use\0" +/* 3872 */ "LOAD_PUBKEY\0" +/* 3884 */ "load-pubkey\0" +/* 3896 */ "Certificate file to use\0" +/* 3920 */ "LOAD_CERTIFICATE\0" +/* 3937 */ "load-certificate\0" +/* 3954 */ "Other options:\0" +/* 3969 */ "Enable debugging\0" +/* 3986 */ "DEBUG\0" +/* 3992 */ "debug\0" +/* 3998 */ "Output file\0" +/* 4010 */ "OUTFILE\0" +/* 4018 */ "outfile\0" +/* 4026 */ "Force (user) login to token\0" +/* 4054 */ "LOGIN\0" +/* 4060 */ "no-login\0" +/* 4069 */ "Force security officer login to token\0" +/* 4107 */ "SO_LOGIN\0" +/* 4116 */ "no-so-login\0" +/* 4128 */ "an alias for the 'so-login' option\0" +/* 4163 */ "admin-login\0" +/* 4175 */ "Tests the signature operation of the provided object\0" +/* 4228 */ "TEST_SIGN\0" +/* 4238 */ "test-sign\0" +/* 4248 */ "Generate random data\0" +/* 4269 */ "GENERATE_RANDOM\0" +/* 4285 */ "generate-random\0" +/* 4301 */ "Use PKCS #8 format for private keys\0" +/* 4337 */ "PKCS8\0" +/* 4343 */ "pkcs8\0" +/* 4349 */ "Use DER/RAW format for input\0" +/* 4378 */ "INDER\0" +/* 4384 */ "no-inder\0" +/* 4393 */ "an alias for the 'inder' option\0" +/* 4425 */ "inraw\0" +/* 4431 */ "Use DER format for output certificates, private keys, and DH parameters\0" +/* 4503 */ "OUTDER\0" +/* 4510 */ "no-outder\0" +/* 4520 */ "an alias for the 'outder' option\0" +/* 4553 */ "outraw\0" +/* 4560 */ "Specify the PKCS #11 provider library\0" +/* 4598 */ "PROVIDER\0" +/* 4607 */ "provider\0" +/* 4616 */ "Print detailed URLs\0" +/* 4636 */ "DETAILED_URL\0" +/* 4649 */ "no-detailed-url\0" +/* 4665 */ "Print a compact listing using only the URLs\0" +/* 4709 */ "ONLY_URLS\0" +/* 4719 */ "only-urls\0" +/* 4729 */ "Disable all interaction with the tool\0" +/* 4767 */ "BATCH\0" +/* 4773 */ "batch\0" +/* 4779 */ "display extended usage information and exit\0" +/* 4823 */ "help\0" +/* 4828 */ "extended usage information passed thru pager\0" +/* 4873 */ "more-help\0" +/* 4883 */ "output version information and exit\0" +/* 4919 */ "version\0" +/* 4927 */ "P11TOOL\0" +/* 4935 */ "p11tool - GnuTLS PKCS #11 tool\n" + "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [url]\n\0" +/* 5030 */ "@PACKAGE_BUGREPORT@\0" +/* 5050 */ "\n\0" +/* 5052 */ "Program that allows operations on PKCS #11 smart cards and security\n" + "modules.\n\n" + "To use PKCS #11 tokens with GnuTLS the p11-kit configuration files need to\n" + "be setup. That is create a .module file in /etc/pkcs11/modules with the\n" + "contents 'module: /path/to/pkcs11.so'. Alternatively the configuration\n" + "file /etc/gnutls/pkcs11.conf has to exist and contain a number of lines of\n" + "the form 'load=/usr/lib/opensc-pkcs11.so'.\n\n" + "You can provide the PIN to be used for the PKCS #11 operations with the\n" + "environment variables GNUTLS_PIN and GNUTLS_SO_PIN.\n\0" +/* 5594 */ "p11tool @VERSION@\0" +/* 5612 */ "p11tool [options] [url]\n" + "p11tool --help for usage instructions.\n"; + +/** + * token_related_options option description: + */ +/** token_related_options option separation text */ +#define TOKEN_RELATED_OPTIONS_DESC (p11tool_opt_strs+891) +#define TOKEN_RELATED_OPTIONS_FLAGS (OPTST_DOCUMENT | OPTST_NO_INIT) + +/** + * list-tokens option description: + */ +/** Descriptive text for the list-tokens option */ +#define LIST_TOKENS_DESC (p11tool_opt_strs+899) +/** Upper-cased name for the list-tokens option */ +#define LIST_TOKENS_NAME (p11tool_opt_strs+925) +/** Name string for the list-tokens option */ +#define LIST_TOKENS_name (p11tool_opt_strs+937) +/** Compiled in flag settings for the list-tokens option */ +#define LIST_TOKENS_FLAGS (OPTST_DISABLED) + +/** + * list-token-urls option description: + */ +/** Descriptive text for the list-token-urls option */ +#define LIST_TOKEN_URLS_DESC (p11tool_opt_strs+949) +/** Upper-cased name for the list-token-urls option */ +#define LIST_TOKEN_URLS_NAME (p11tool_opt_strs+980) +/** Name string for the list-token-urls option */ +#define LIST_TOKEN_URLS_name (p11tool_opt_strs+996) +/** Compiled in flag settings for the list-token-urls option */ +#define LIST_TOKEN_URLS_FLAGS (OPTST_DISABLED) + +/** + * list-mechanisms option description: + */ +/** Descriptive text for the list-mechanisms option */ +#define LIST_MECHANISMS_DESC (p11tool_opt_strs+1012) +/** Upper-cased name for the list-mechanisms option */ +#define LIST_MECHANISMS_NAME (p11tool_opt_strs+1053) +/** Name string for the list-mechanisms option */ +#define LIST_MECHANISMS_name (p11tool_opt_strs+1069) +/** Compiled in flag settings for the list-mechanisms option */ +#define LIST_MECHANISMS_FLAGS (OPTST_DISABLED) + +/** + * initialize option description: + */ +/** Descriptive text for the initialize option */ +#define INITIALIZE_DESC (p11tool_opt_strs+1085) +/** Upper-cased name for the initialize option */ +#define INITIALIZE_NAME (p11tool_opt_strs+1114) +/** Name string for the initialize option */ +#define INITIALIZE_name (p11tool_opt_strs+1125) +/** Compiled in flag settings for the initialize option */ +#define INITIALIZE_FLAGS (OPTST_DISABLED) + +/** + * initialize-pin option description: + */ +/** Descriptive text for the initialize-pin option */ +#define INITIALIZE_PIN_DESC (p11tool_opt_strs+1136) +/** Upper-cased name for the initialize-pin option */ +#define INITIALIZE_PIN_NAME (p11tool_opt_strs+1181) +/** Name string for the initialize-pin option */ +#define INITIALIZE_PIN_name (p11tool_opt_strs+1196) +/** Compiled in flag settings for the initialize-pin option */ +#define INITIALIZE_PIN_FLAGS (OPTST_DISABLED) + +/** + * initialize-so-pin option description: + */ +/** Descriptive text for the initialize-so-pin option */ +#define INITIALIZE_SO_PIN_DESC (p11tool_opt_strs+1211) +/** Upper-cased name for the initialize-so-pin option */ +#define INITIALIZE_SO_PIN_NAME (p11tool_opt_strs+1268) +/** Name string for the initialize-so-pin option */ +#define INITIALIZE_SO_PIN_name (p11tool_opt_strs+1286) +/** Compiled in flag settings for the initialize-so-pin option */ +#define INITIALIZE_SO_PIN_FLAGS (OPTST_DISABLED) + +/** + * set-pin option description: + */ +/** Descriptive text for the set-pin option */ +#define SET_PIN_DESC (p11tool_opt_strs+1304) +/** Upper-cased name for the set-pin option */ +#define SET_PIN_NAME (p11tool_opt_strs+1351) +/** Name string for the set-pin option */ +#define SET_PIN_name (p11tool_opt_strs+1359) +/** Compiled in flag settings for the set-pin option */ +#define SET_PIN_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * set-so-pin option description: + */ +/** Descriptive text for the set-so-pin option */ +#define SET_SO_PIN_DESC (p11tool_opt_strs+1367) +/** Upper-cased name for the set-so-pin option */ +#define SET_SO_PIN_NAME (p11tool_opt_strs+1433) +/** Name string for the set-so-pin option */ +#define SET_SO_PIN_name (p11tool_opt_strs+1444) +/** Compiled in flag settings for the set-so-pin option */ +#define SET_SO_PIN_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * object_list_related_options option description: + */ +/** object_list_related_options option separation text */ +#define OBJECT_LIST_RELATED_OPTIONS_DESC (p11tool_opt_strs+1455) +#define OBJECT_LIST_RELATED_OPTIONS_FLAGS (OPTST_DOCUMENT | OPTST_NO_INIT) + +/** + * list-all option description: + */ +/** Descriptive text for the list-all option */ +#define LIST_ALL_DESC (p11tool_opt_strs+1471) +/** Upper-cased name for the list-all option */ +#define LIST_ALL_NAME (p11tool_opt_strs+1509) +/** Name string for the list-all option */ +#define LIST_ALL_name (p11tool_opt_strs+1518) +/** Compiled in flag settings for the list-all option */ +#define LIST_ALL_FLAGS (OPTST_DISABLED) + +/** + * list-all-certs option description: + */ +/** Descriptive text for the list-all-certs option */ +#define LIST_ALL_CERTS_DESC (p11tool_opt_strs+1527) +/** Upper-cased name for the list-all-certs option */ +#define LIST_ALL_CERTS_NAME (p11tool_opt_strs+1570) +/** Name string for the list-all-certs option */ +#define LIST_ALL_CERTS_name (p11tool_opt_strs+1585) +/** Compiled in flag settings for the list-all-certs option */ +#define LIST_ALL_CERTS_FLAGS (OPTST_DISABLED) + +/** + * list-certs option description: + */ +/** Descriptive text for the list-certs option */ +#define LIST_CERTS_DESC (p11tool_opt_strs+1600) +/** Upper-cased name for the list-certs option */ +#define LIST_CERTS_NAME (p11tool_opt_strs+1658) +/** Name string for the list-certs option */ +#define LIST_CERTS_name (p11tool_opt_strs+1669) +/** Compiled in flag settings for the list-certs option */ +#define LIST_CERTS_FLAGS (OPTST_DISABLED) + +/** + * list-all-privkeys option description: + */ +/** Descriptive text for the list-all-privkeys option */ +#define LIST_ALL_PRIVKEYS_DESC (p11tool_opt_strs+1680) +/** Upper-cased name for the list-all-privkeys option */ +#define LIST_ALL_PRIVKEYS_NAME (p11tool_opt_strs+1723) +/** Name string for the list-all-privkeys option */ +#define LIST_ALL_PRIVKEYS_name (p11tool_opt_strs+1741) +/** Compiled in flag settings for the list-all-privkeys option */ +#define LIST_ALL_PRIVKEYS_FLAGS (OPTST_DISABLED) + +/** + * list-privkeys option description: + */ +/** Descriptive text for the list-privkeys option */ +#define LIST_PRIVKEYS_DESC (p11tool_opt_strs+1759) +#define LIST_PRIVKEYS_NAME NULL +/** Unmodified name string for the list-privkeys option */ +#define LIST_PRIVKEYS_name (p11tool_opt_strs+1803) +/** Compiled in flag settings for the list-privkeys option */ +#define LIST_PRIVKEYS_FLAGS (LIST_ALL_PRIVKEYS_FLAGS | OPTST_ALIAS) + +/** + * list-keys option description: + */ +/** Descriptive text for the list-keys option */ +#define LIST_KEYS_DESC (p11tool_opt_strs+1759) +#define LIST_KEYS_NAME NULL +/** Unmodified name string for the list-keys option */ +#define LIST_KEYS_name (p11tool_opt_strs+1817) +/** Compiled in flag settings for the list-keys option */ +#define LIST_KEYS_FLAGS (LIST_ALL_PRIVKEYS_FLAGS | OPTST_ALIAS) + +/** + * list-all-trusted option description: + */ +/** Descriptive text for the list-all-trusted option */ +#define LIST_ALL_TRUSTED_DESC (p11tool_opt_strs+1827) +/** Upper-cased name for the list-all-trusted option */ +#define LIST_ALL_TRUSTED_NAME (p11tool_opt_strs+1877) +/** Name string for the list-all-trusted option */ +#define LIST_ALL_TRUSTED_name (p11tool_opt_strs+1894) +/** Compiled in flag settings for the list-all-trusted option */ +#define LIST_ALL_TRUSTED_FLAGS (OPTST_DISABLED) + +/** + * export option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the export option */ +#define EXPORT_DESC (p11tool_opt_strs+1911) +/** Upper-cased name for the export option */ +#define EXPORT_NAME (p11tool_opt_strs+1950) +/** Name string for the export option */ +#define EXPORT_name (p11tool_opt_strs+1957) +/** Other options that appear in conjunction with the export option */ +static int const aExportCantList[] = { + INDEX_OPT_EXPORT_STAPLED, + INDEX_OPT_EXPORT_CHAIN, + INDEX_OPT_EXPORT_PUBKEY, NO_EQUIVALENT }; +/** Compiled in flag settings for the export option */ +#define EXPORT_FLAGS (OPTST_DISABLED) + +/** + * export-stapled option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the export-stapled option */ +#define EXPORT_STAPLED_DESC (p11tool_opt_strs+1964) +/** Upper-cased name for the export-stapled option */ +#define EXPORT_STAPLED_NAME (p11tool_opt_strs+2015) +/** Name string for the export-stapled option */ +#define EXPORT_STAPLED_name (p11tool_opt_strs+2030) +/** Other options that appear in conjunction with the export-stapled option */ +static int const aExport_StapledCantList[] = { + INDEX_OPT_EXPORT, + INDEX_OPT_EXPORT_CHAIN, + INDEX_OPT_EXPORT_PUBKEY, NO_EQUIVALENT }; +/** Compiled in flag settings for the export-stapled option */ +#define EXPORT_STAPLED_FLAGS (OPTST_DISABLED) + +/** + * export-chain option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the export-chain option */ +#define EXPORT_CHAIN_DESC (p11tool_opt_strs+2045) +/** Upper-cased name for the export-chain option */ +#define EXPORT_CHAIN_NAME (p11tool_opt_strs+2112) +/** Name string for the export-chain option */ +#define EXPORT_CHAIN_name (p11tool_opt_strs+2125) +/** Other options that appear in conjunction with the export-chain option */ +static int const aExport_ChainCantList[] = { + INDEX_OPT_EXPORT_STAPLED, + INDEX_OPT_EXPORT, + INDEX_OPT_EXPORT_PUBKEY, NO_EQUIVALENT }; +/** Compiled in flag settings for the export-chain option */ +#define EXPORT_CHAIN_FLAGS (OPTST_DISABLED) + +/** + * export-pubkey option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the export-pubkey option */ +#define EXPORT_PUBKEY_DESC (p11tool_opt_strs+2138) +/** Upper-cased name for the export-pubkey option */ +#define EXPORT_PUBKEY_NAME (p11tool_opt_strs+2178) +/** Name string for the export-pubkey option */ +#define EXPORT_PUBKEY_name (p11tool_opt_strs+2192) +/** Other options that appear in conjunction with the export-pubkey option */ +static int const aExport_PubkeyCantList[] = { + INDEX_OPT_EXPORT_STAPLED, + INDEX_OPT_EXPORT, + INDEX_OPT_EXPORT_CHAIN, NO_EQUIVALENT }; +/** Compiled in flag settings for the export-pubkey option */ +#define EXPORT_PUBKEY_FLAGS (OPTST_DISABLED) + +/** + * info option description: + */ +/** Descriptive text for the info option */ +#define INFO_DESC (p11tool_opt_strs+2206) +/** Upper-cased name for the info option */ +#define INFO_NAME (p11tool_opt_strs+2257) +/** Name string for the info option */ +#define INFO_name (p11tool_opt_strs+2262) +/** Compiled in flag settings for the info option */ +#define INFO_FLAGS (OPTST_DISABLED) + +/** + * trusted option description: + */ +/** Descriptive text for the trusted option */ +#define TRUSTED_DESC (p11tool_opt_strs+2267) +#define TRUSTED_NAME NULL +/** Unmodified name string for the trusted option */ +#define TRUSTED_name (p11tool_opt_strs+2306) +/** Compiled in flag settings for the trusted option */ +#define TRUSTED_FLAGS (MARK_TRUSTED_FLAGS | OPTST_ALIAS) + +/** + * distrusted option description: + */ +/** Descriptive text for the distrusted option */ +#define DISTRUSTED_DESC (p11tool_opt_strs+2314) +#define DISTRUSTED_NAME NULL +/** Unmodified name string for the distrusted option */ +#define DISTRUSTED_name (p11tool_opt_strs+2356) +/** Compiled in flag settings for the distrusted option */ +#define DISTRUSTED_FLAGS (MARK_DISTRUSTED_FLAGS | OPTST_ALIAS) + +/** + * keygen_related_options option description: + */ +/** keygen_related_options option separation text */ +#define KEYGEN_RELATED_OPTIONS_DESC (p11tool_opt_strs+2367) +#define KEYGEN_RELATED_OPTIONS_FLAGS (OPTST_DOCUMENT | OPTST_NO_INIT) + +/** + * generate-rsa option description: + */ +/** Descriptive text for the generate-rsa option */ +#define GENERATE_RSA_DESC (p11tool_opt_strs+2383) +/** Upper-cased name for the generate-rsa option */ +#define GENERATE_RSA_NAME (p11tool_opt_strs+2423) +/** Name string for the generate-rsa option */ +#define GENERATE_RSA_name (p11tool_opt_strs+2436) +/** Compiled in flag settings for the generate-rsa option */ +#define GENERATE_RSA_FLAGS (OPTST_DISABLED) + +/** + * generate-dsa option description: + */ +/** Descriptive text for the generate-dsa option */ +#define GENERATE_DSA_DESC (p11tool_opt_strs+2449) +/** Upper-cased name for the generate-dsa option */ +#define GENERATE_DSA_NAME (p11tool_opt_strs+2488) +/** Name string for the generate-dsa option */ +#define GENERATE_DSA_name (p11tool_opt_strs+2501) +/** Compiled in flag settings for the generate-dsa option */ +#define GENERATE_DSA_FLAGS (OPTST_DISABLED) + +/** + * generate-ecc option description: + */ +/** Descriptive text for the generate-ecc option */ +#define GENERATE_ECC_DESC (p11tool_opt_strs+2514) +/** Upper-cased name for the generate-ecc option */ +#define GENERATE_ECC_NAME (p11tool_opt_strs+2556) +/** Name string for the generate-ecc option */ +#define GENERATE_ECC_name (p11tool_opt_strs+2569) +/** Compiled in flag settings for the generate-ecc option */ +#define GENERATE_ECC_FLAGS (OPTST_DISABLED) + +/** + * bits option description: + */ +/** Descriptive text for the bits option */ +#define BITS_DESC (p11tool_opt_strs+2582) +/** Upper-cased name for the bits option */ +#define BITS_NAME (p11tool_opt_strs+2630) +/** Name string for the bits option */ +#define BITS_name (p11tool_opt_strs+2635) +/** Compiled in flag settings for the bits option */ +#define BITS_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * curve option description: + */ +/** Descriptive text for the curve option */ +#define CURVE_DESC (p11tool_opt_strs+2640) +/** Upper-cased name for the curve option */ +#define CURVE_NAME (p11tool_opt_strs+2685) +/** Name string for the curve option */ +#define CURVE_name (p11tool_opt_strs+2691) +/** Compiled in flag settings for the curve option */ +#define CURVE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * sec-param option description: + */ +/** Descriptive text for the sec-param option */ +#define SEC_PARAM_DESC (p11tool_opt_strs+2697) +/** Upper-cased name for the sec-param option */ +#define SEC_PARAM_NAME (p11tool_opt_strs+2724) +/** Name string for the sec-param option */ +#define SEC_PARAM_name (p11tool_opt_strs+2734) +/** Compiled in flag settings for the sec-param option */ +#define SEC_PARAM_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * write_object_related_options option description: + */ +/** write_object_related_options option separation text */ +#define WRITE_OBJECT_RELATED_OPTIONS_DESC (p11tool_opt_strs+2744) +#define WRITE_OBJECT_RELATED_OPTIONS_FLAGS (OPTST_DOCUMENT | OPTST_NO_INIT) + +/** + * set-id option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the set-id option */ +#define SET_ID_DESC (p11tool_opt_strs+2761) +/** Upper-cased name for the set-id option */ +#define SET_ID_NAME (p11tool_opt_strs+2821) +/** Name string for the set-id option */ +#define SET_ID_name (p11tool_opt_strs+2828) +/** Other options that appear in conjunction with the set-id option */ +static int const aSet_IdCantList[] = { + INDEX_OPT_WRITE, NO_EQUIVALENT }; +/** Compiled in flag settings for the set-id option */ +#define SET_ID_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * set-label option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the set-label option */ +#define SET_LABEL_DESC (p11tool_opt_strs+2835) +/** Upper-cased name for the set-label option */ +#define SET_LABEL_NAME (p11tool_opt_strs+2889) +/** Name string for the set-label option */ +#define SET_LABEL_name (p11tool_opt_strs+2899) +/** Other options that appear in conjunction with the set-label option */ +static int const aSet_LabelCantList[] = { + INDEX_OPT_WRITE, + INDEX_OPT_SET_ID, NO_EQUIVALENT }; +/** Compiled in flag settings for the set-label option */ +#define SET_LABEL_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * write option description: + */ +/** Descriptive text for the write option */ +#define WRITE_DESC (p11tool_opt_strs+2909) +/** Upper-cased name for the write option */ +#define WRITE_NAME (p11tool_opt_strs+2955) +/** Name string for the write option */ +#define WRITE_name (p11tool_opt_strs+2961) +/** Compiled in flag settings for the write option */ +#define WRITE_FLAGS (OPTST_DISABLED) + +/** + * delete option description: + */ +/** Descriptive text for the delete option */ +#define DELETE_DESC (p11tool_opt_strs+2967) +/** Upper-cased name for the delete option */ +#define DELETE_NAME (p11tool_opt_strs+3019) +/** Name string for the delete option */ +#define DELETE_name (p11tool_opt_strs+3026) +/** Compiled in flag settings for the delete option */ +#define DELETE_FLAGS (OPTST_DISABLED) + +/** + * label option description: + */ +/** Descriptive text for the label option */ +#define LABEL_DESC (p11tool_opt_strs+3033) +/** Upper-cased name for the label option */ +#define LABEL_NAME (p11tool_opt_strs+3070) +/** Name string for the label option */ +#define LABEL_name (p11tool_opt_strs+3076) +/** Compiled in flag settings for the label option */ +#define LABEL_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * id option description: + */ +/** Descriptive text for the id option */ +#define ID_DESC (p11tool_opt_strs+3082) +/** Upper-cased name for the id option */ +#define ID_NAME (p11tool_opt_strs+3117) +/** Name string for the id option */ +#define ID_name (p11tool_opt_strs+3120) +/** Compiled in flag settings for the id option */ +#define ID_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * mark-wrap option description: + */ +/** Descriptive text for the mark-wrap option */ +#define MARK_WRAP_DESC (p11tool_opt_strs+3123) +/** Upper-cased name for the mark-wrap option */ +#define MARK_WRAP_NAME (p11tool_opt_strs+3168) +/** disablement name for the mark-wrap option */ +#define NOT_MARK_WRAP_name (p11tool_opt_strs+3178) +/** disablement prefix for the mark-wrap option */ +#define NOT_MARK_WRAP_PFX (p11tool_opt_strs+3191) +/** Name string for the mark-wrap option */ +#define MARK_WRAP_name (NOT_MARK_WRAP_name + 3) +/** Compiled in flag settings for the mark-wrap option */ +#define MARK_WRAP_FLAGS (OPTST_DISABLED) + +/** + * mark-trusted option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the mark-trusted option */ +#define MARK_TRUSTED_DESC (p11tool_opt_strs+3194) +/** Upper-cased name for the mark-trusted option */ +#define MARK_TRUSTED_NAME (p11tool_opt_strs+3236) +/** disablement name for the mark-trusted option */ +#define NOT_MARK_TRUSTED_name (p11tool_opt_strs+3249) +/** disablement prefix for the mark-trusted option */ +#define NOT_MARK_TRUSTED_PFX (p11tool_opt_strs+3191) +/** Name string for the mark-trusted option */ +#define MARK_TRUSTED_name (NOT_MARK_TRUSTED_name + 3) +/** Other options that appear in conjunction with the mark-trusted option */ +static int const aMark_TrustedCantList[] = { + INDEX_OPT_MARK_DISTRUSTED, NO_EQUIVALENT }; +/** Compiled in flag settings for the mark-trusted option */ +#define MARK_TRUSTED_FLAGS (OPTST_DISABLED) + +/** + * mark-distrusted option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the mark-distrusted option */ +#define MARK_DISTRUSTED_DESC (p11tool_opt_strs+3265) +/** Upper-cased name for the mark-distrusted option */ +#define MARK_DISTRUSTED_NAME (p11tool_opt_strs+3345) +/** Name string for the mark-distrusted option */ +#define MARK_DISTRUSTED_name (p11tool_opt_strs+3361) +/** Other options that appear in conjunction with the mark-distrusted option */ +static int const aMark_DistrustedCantList[] = { + INDEX_OPT_MARK_TRUSTED, NO_EQUIVALENT }; +/** Compiled in flag settings for the mark-distrusted option */ +#define MARK_DISTRUSTED_FLAGS (OPTST_DISABLED) + +/** + * mark-decrypt option description: + */ +/** Descriptive text for the mark-decrypt option */ +#define MARK_DECRYPT_DESC (p11tool_opt_strs+3377) +/** Upper-cased name for the mark-decrypt option */ +#define MARK_DECRYPT_NAME (p11tool_opt_strs+3423) +/** disablement name for the mark-decrypt option */ +#define NOT_MARK_DECRYPT_name (p11tool_opt_strs+3436) +/** disablement prefix for the mark-decrypt option */ +#define NOT_MARK_DECRYPT_PFX (p11tool_opt_strs+3191) +/** Name string for the mark-decrypt option */ +#define MARK_DECRYPT_name (NOT_MARK_DECRYPT_name + 3) +/** Compiled in flag settings for the mark-decrypt option */ +#define MARK_DECRYPT_FLAGS (OPTST_DISABLED) + +/** + * mark-sign option description: + */ +/** Descriptive text for the mark-sign option */ +#define MARK_SIGN_DESC (p11tool_opt_strs+3452) +/** Upper-cased name for the mark-sign option */ +#define MARK_SIGN_NAME (p11tool_opt_strs+3508) +/** disablement name for the mark-sign option */ +#define NOT_MARK_SIGN_name (p11tool_opt_strs+3518) +/** disablement prefix for the mark-sign option */ +#define NOT_MARK_SIGN_PFX (p11tool_opt_strs+3191) +/** Name string for the mark-sign option */ +#define MARK_SIGN_name (NOT_MARK_SIGN_name + 3) +/** Compiled in flag settings for the mark-sign option */ +#define MARK_SIGN_FLAGS (OPTST_DISABLED) + +/** + * mark-ca option description: + */ +/** Descriptive text for the mark-ca option */ +#define MARK_CA_DESC (p11tool_opt_strs+3531) +/** Upper-cased name for the mark-ca option */ +#define MARK_CA_NAME (p11tool_opt_strs+3570) +/** disablement name for the mark-ca option */ +#define NOT_MARK_CA_name (p11tool_opt_strs+3578) +/** disablement prefix for the mark-ca option */ +#define NOT_MARK_CA_PFX (p11tool_opt_strs+3191) +/** Name string for the mark-ca option */ +#define MARK_CA_name (NOT_MARK_CA_name + 3) +/** Compiled in flag settings for the mark-ca option */ +#define MARK_CA_FLAGS (OPTST_DISABLED) + +/** + * mark-private option description: + */ +/** Descriptive text for the mark-private option */ +#define MARK_PRIVATE_DESC (p11tool_opt_strs+3589) +/** Upper-cased name for the mark-private option */ +#define MARK_PRIVATE_NAME (p11tool_opt_strs+3631) +/** disablement name for the mark-private option */ +#define NOT_MARK_PRIVATE_name (p11tool_opt_strs+3644) +/** disablement prefix for the mark-private option */ +#define NOT_MARK_PRIVATE_PFX (p11tool_opt_strs+3191) +/** Name string for the mark-private option */ +#define MARK_PRIVATE_name (NOT_MARK_PRIVATE_name + 3) +/** Compiled in flag settings for the mark-private option */ +#define MARK_PRIVATE_FLAGS (OPTST_DISABLED) + +/** + * ca option description: + */ +/** Descriptive text for the ca option */ +#define CA_DESC (p11tool_opt_strs+3660) +#define CA_NAME NULL +/** Unmodified name string for the ca option */ +#define CA_name (p11tool_opt_strs+3694) +/** Compiled in flag settings for the ca option */ +#define CA_FLAGS (MARK_CA_FLAGS | OPTST_ALIAS) + +/** + * private option description: + */ +/** Descriptive text for the private option */ +#define PRIVATE_DESC (p11tool_opt_strs+3697) +#define PRIVATE_NAME NULL +/** Unmodified name string for the private option */ +#define PRIVATE_name (p11tool_opt_strs+3736) +/** Compiled in flag settings for the private option */ +#define PRIVATE_FLAGS (MARK_PRIVATE_FLAGS | OPTST_ALIAS) + +/** + * secret-key option description: + */ +/** Descriptive text for the secret-key option */ +#define SECRET_KEY_DESC (p11tool_opt_strs+3744) +/** Upper-cased name for the secret-key option */ +#define SECRET_KEY_NAME (p11tool_opt_strs+3777) +/** Name string for the secret-key option */ +#define SECRET_KEY_name (p11tool_opt_strs+3788) +/** Compiled in flag settings for the secret-key option */ +#define SECRET_KEY_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * load-privkey option description: + */ +/** Descriptive text for the load-privkey option */ +#define LOAD_PRIVKEY_DESC (p11tool_opt_strs+3799) +/** Upper-cased name for the load-privkey option */ +#define LOAD_PRIVKEY_NAME (p11tool_opt_strs+3823) +/** Name string for the load-privkey option */ +#define LOAD_PRIVKEY_name (p11tool_opt_strs+3836) +/** Compiled in flag settings for the load-privkey option */ +#define LOAD_PRIVKEY_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * load-pubkey option description: + */ +/** Descriptive text for the load-pubkey option */ +#define LOAD_PUBKEY_DESC (p11tool_opt_strs+3849) +/** Upper-cased name for the load-pubkey option */ +#define LOAD_PUBKEY_NAME (p11tool_opt_strs+3872) +/** Name string for the load-pubkey option */ +#define LOAD_PUBKEY_name (p11tool_opt_strs+3884) +/** Compiled in flag settings for the load-pubkey option */ +#define LOAD_PUBKEY_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * load-certificate option description: + */ +/** Descriptive text for the load-certificate option */ +#define LOAD_CERTIFICATE_DESC (p11tool_opt_strs+3896) +/** Upper-cased name for the load-certificate option */ +#define LOAD_CERTIFICATE_NAME (p11tool_opt_strs+3920) +/** Name string for the load-certificate option */ +#define LOAD_CERTIFICATE_name (p11tool_opt_strs+3937) +/** Compiled in flag settings for the load-certificate option */ +#define LOAD_CERTIFICATE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * other_options option description: + */ +/** other_options option separation text */ +#define OTHER_OPTIONS_DESC (p11tool_opt_strs+3954) +#define OTHER_OPTIONS_FLAGS (OPTST_DOCUMENT | OPTST_NO_INIT) + +/** + * debug option description: + */ +/** Descriptive text for the debug option */ +#define DEBUG_DESC (p11tool_opt_strs+3969) +/** Upper-cased name for the debug option */ +#define DEBUG_NAME (p11tool_opt_strs+3986) +/** Name string for the debug option */ +#define DEBUG_name (p11tool_opt_strs+3992) +/** Compiled in flag settings for the debug option */ +#define DEBUG_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * outfile option description: + */ +/** Descriptive text for the outfile option */ +#define OUTFILE_DESC (p11tool_opt_strs+3998) +/** Upper-cased name for the outfile option */ +#define OUTFILE_NAME (p11tool_opt_strs+4010) +/** Name string for the outfile option */ +#define OUTFILE_name (p11tool_opt_strs+4018) +/** Compiled in flag settings for the outfile option */ +#define OUTFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * login option description: + */ +/** Descriptive text for the login option */ +#define LOGIN_DESC (p11tool_opt_strs+4026) +/** Upper-cased name for the login option */ +#define LOGIN_NAME (p11tool_opt_strs+4054) +/** disablement name for the login option */ +#define NOT_LOGIN_name (p11tool_opt_strs+4060) +/** disablement prefix for the login option */ +#define NOT_LOGIN_PFX (p11tool_opt_strs+3191) +/** Name string for the login option */ +#define LOGIN_name (NOT_LOGIN_name + 3) +/** Compiled in flag settings for the login option */ +#define LOGIN_FLAGS (OPTST_DISABLED) + +/** + * so-login option description: + */ +/** Descriptive text for the so-login option */ +#define SO_LOGIN_DESC (p11tool_opt_strs+4069) +/** Upper-cased name for the so-login option */ +#define SO_LOGIN_NAME (p11tool_opt_strs+4107) +/** disablement name for the so-login option */ +#define NOT_SO_LOGIN_name (p11tool_opt_strs+4116) +/** disablement prefix for the so-login option */ +#define NOT_SO_LOGIN_PFX (p11tool_opt_strs+3191) +/** Name string for the so-login option */ +#define SO_LOGIN_name (NOT_SO_LOGIN_name + 3) +/** Compiled in flag settings for the so-login option */ +#define SO_LOGIN_FLAGS (OPTST_DISABLED) + +/** + * admin-login option description: + */ +/** Descriptive text for the admin-login option */ +#define ADMIN_LOGIN_DESC (p11tool_opt_strs+4128) +#define ADMIN_LOGIN_NAME NULL +/** Unmodified name string for the admin-login option */ +#define ADMIN_LOGIN_name (p11tool_opt_strs+4163) +/** Compiled in flag settings for the admin-login option */ +#define ADMIN_LOGIN_FLAGS (SO_LOGIN_FLAGS | OPTST_ALIAS) + +/** + * test-sign option description: + */ +/** Descriptive text for the test-sign option */ +#define TEST_SIGN_DESC (p11tool_opt_strs+4175) +/** Upper-cased name for the test-sign option */ +#define TEST_SIGN_NAME (p11tool_opt_strs+4228) +/** Name string for the test-sign option */ +#define TEST_SIGN_name (p11tool_opt_strs+4238) +/** Compiled in flag settings for the test-sign option */ +#define TEST_SIGN_FLAGS (OPTST_DISABLED) + +/** + * generate-random option description: + */ +/** Descriptive text for the generate-random option */ +#define GENERATE_RANDOM_DESC (p11tool_opt_strs+4248) +/** Upper-cased name for the generate-random option */ +#define GENERATE_RANDOM_NAME (p11tool_opt_strs+4269) +/** Name string for the generate-random option */ +#define GENERATE_RANDOM_name (p11tool_opt_strs+4285) +/** Compiled in flag settings for the generate-random option */ +#define GENERATE_RANDOM_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * pkcs8 option description: + */ +/** Descriptive text for the pkcs8 option */ +#define PKCS8_DESC (p11tool_opt_strs+4301) +/** Upper-cased name for the pkcs8 option */ +#define PKCS8_NAME (p11tool_opt_strs+4337) +/** Name string for the pkcs8 option */ +#define PKCS8_name (p11tool_opt_strs+4343) +/** Compiled in flag settings for the pkcs8 option */ +#define PKCS8_FLAGS (OPTST_DISABLED) + +/** + * inder option description: + */ +/** Descriptive text for the inder option */ +#define INDER_DESC (p11tool_opt_strs+4349) +/** Upper-cased name for the inder option */ +#define INDER_NAME (p11tool_opt_strs+4378) +/** disablement name for the inder option */ +#define NOT_INDER_name (p11tool_opt_strs+4384) +/** disablement prefix for the inder option */ +#define NOT_INDER_PFX (p11tool_opt_strs+3191) +/** Name string for the inder option */ +#define INDER_name (NOT_INDER_name + 3) +/** Compiled in flag settings for the inder option */ +#define INDER_FLAGS (OPTST_DISABLED) + +/** + * inraw option description: + */ +/** Descriptive text for the inraw option */ +#define INRAW_DESC (p11tool_opt_strs+4393) +#define INRAW_NAME NULL +/** Unmodified name string for the inraw option */ +#define INRAW_name (p11tool_opt_strs+4425) +/** Compiled in flag settings for the inraw option */ +#define INRAW_FLAGS (INDER_FLAGS | OPTST_ALIAS) + +/** + * outder option description: + */ +/** Descriptive text for the outder option */ +#define OUTDER_DESC (p11tool_opt_strs+4431) +/** Upper-cased name for the outder option */ +#define OUTDER_NAME (p11tool_opt_strs+4503) +/** disablement name for the outder option */ +#define NOT_OUTDER_name (p11tool_opt_strs+4510) +/** disablement prefix for the outder option */ +#define NOT_OUTDER_PFX (p11tool_opt_strs+3191) +/** Name string for the outder option */ +#define OUTDER_name (NOT_OUTDER_name + 3) +/** Compiled in flag settings for the outder option */ +#define OUTDER_FLAGS (OPTST_DISABLED) + +/** + * outraw option description: + */ +/** Descriptive text for the outraw option */ +#define OUTRAW_DESC (p11tool_opt_strs+4520) +#define OUTRAW_NAME NULL +/** Unmodified name string for the outraw option */ +#define OUTRAW_name (p11tool_opt_strs+4553) +/** Compiled in flag settings for the outraw option */ +#define OUTRAW_FLAGS (OUTDER_FLAGS | OPTST_ALIAS) + +/** + * provider option description: + */ +/** Descriptive text for the provider option */ +#define PROVIDER_DESC (p11tool_opt_strs+4560) +/** Upper-cased name for the provider option */ +#define PROVIDER_NAME (p11tool_opt_strs+4598) +/** Name string for the provider option */ +#define PROVIDER_name (p11tool_opt_strs+4607) +/** Compiled in flag settings for the provider option */ +#define PROVIDER_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * detailed-url option description: + */ +/** Descriptive text for the detailed-url option */ +#define DETAILED_URL_DESC (p11tool_opt_strs+4616) +/** Upper-cased name for the detailed-url option */ +#define DETAILED_URL_NAME (p11tool_opt_strs+4636) +/** disablement name for the detailed-url option */ +#define NOT_DETAILED_URL_name (p11tool_opt_strs+4649) +/** disablement prefix for the detailed-url option */ +#define NOT_DETAILED_URL_PFX (p11tool_opt_strs+3191) +/** Name string for the detailed-url option */ +#define DETAILED_URL_name (NOT_DETAILED_URL_name + 3) +/** Compiled in flag settings for the detailed-url option */ +#define DETAILED_URL_FLAGS (OPTST_DISABLED) + +/** + * only-urls option description: + */ +/** Descriptive text for the only-urls option */ +#define ONLY_URLS_DESC (p11tool_opt_strs+4665) +/** Upper-cased name for the only-urls option */ +#define ONLY_URLS_NAME (p11tool_opt_strs+4709) +/** Name string for the only-urls option */ +#define ONLY_URLS_name (p11tool_opt_strs+4719) +/** Compiled in flag settings for the only-urls option */ +#define ONLY_URLS_FLAGS (OPTST_DISABLED) + +/** + * batch option description: + */ +/** Descriptive text for the batch option */ +#define BATCH_DESC (p11tool_opt_strs+4729) +/** Upper-cased name for the batch option */ +#define BATCH_NAME (p11tool_opt_strs+4767) +/** Name string for the batch option */ +#define BATCH_name (p11tool_opt_strs+4773) +/** Compiled in flag settings for the batch option */ +#define BATCH_FLAGS (OPTST_DISABLED) + +/* + * Help/More_Help/Version option descriptions: + */ +#define HELP_DESC (p11tool_opt_strs+4779) +#define HELP_name (p11tool_opt_strs+4823) +#ifdef HAVE_WORKING_FORK +#define MORE_HELP_DESC (p11tool_opt_strs+4828) +#define MORE_HELP_name (p11tool_opt_strs+4873) +#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +#define MORE_HELP_DESC HELP_DESC +#define MORE_HELP_name HELP_name +#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#endif +#ifdef NO_OPTIONAL_OPT_ARGS +# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ + OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) +#endif +#define VER_DESC (p11tool_opt_strs+4883) +#define VER_name (p11tool_opt_strs+4919) +/** + * Declare option callback procedures + */ +extern tOptProc + optionBooleanVal, optionNestedVal, optionNumericVal, + optionPagedUsage, optionPrintVersion, optionResetOpt, + optionStackArg, optionTimeDate, optionTimeVal, + optionUnstackArg, optionVendorOption; +static tOptProc + doOptAdmin_Login, doOptCa, doOptDebug, + doOptDistrusted, doOptInraw, doOptList_Keys, + doOptList_Privkeys, doOptLoad_Certificate, doOptLoad_Privkey, + doOptLoad_Pubkey, doOptOutraw, doOptPrivate, + doOptProvider, doOptTrusted, doUsageOpt; +#define VER_PROC optionPrintVersion + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the p11tool Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the p11tool program responds to. + */ +static tOptDesc optDesc[OPTION_CT] = { + { /* entry idx, value */ 0, 0, + /* equiv idx, value */ 0, 0, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 0, 0, + /* opt state flags */ TOKEN_RELATED_OPTIONS_FLAGS, 0, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ TOKEN_RELATED_OPTIONS_DESC, NULL, NULL, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 1, VALUE_OPT_LIST_TOKENS, + /* equiv idx, value */ 1, VALUE_OPT_LIST_TOKENS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LIST_TOKENS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --list-tokens */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LIST_TOKENS_DESC, LIST_TOKENS_NAME, LIST_TOKENS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 2, VALUE_OPT_LIST_TOKEN_URLS, + /* equiv idx, value */ 2, VALUE_OPT_LIST_TOKEN_URLS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LIST_TOKEN_URLS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --list-token-urls */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LIST_TOKEN_URLS_DESC, LIST_TOKEN_URLS_NAME, LIST_TOKEN_URLS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 3, VALUE_OPT_LIST_MECHANISMS, + /* equiv idx, value */ 3, VALUE_OPT_LIST_MECHANISMS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LIST_MECHANISMS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --list-mechanisms */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LIST_MECHANISMS_DESC, LIST_MECHANISMS_NAME, LIST_MECHANISMS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 4, VALUE_OPT_INITIALIZE, + /* equiv idx, value */ 4, VALUE_OPT_INITIALIZE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INITIALIZE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --initialize */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ INITIALIZE_DESC, INITIALIZE_NAME, INITIALIZE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 5, VALUE_OPT_INITIALIZE_PIN, + /* equiv idx, value */ 5, VALUE_OPT_INITIALIZE_PIN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INITIALIZE_PIN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --initialize-pin */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ INITIALIZE_PIN_DESC, INITIALIZE_PIN_NAME, INITIALIZE_PIN_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 6, VALUE_OPT_INITIALIZE_SO_PIN, + /* equiv idx, value */ 6, VALUE_OPT_INITIALIZE_SO_PIN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INITIALIZE_SO_PIN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --initialize-so-pin */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ INITIALIZE_SO_PIN_DESC, INITIALIZE_SO_PIN_NAME, INITIALIZE_SO_PIN_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 7, VALUE_OPT_SET_PIN, + /* equiv idx, value */ 7, VALUE_OPT_SET_PIN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SET_PIN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --set-pin */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SET_PIN_DESC, SET_PIN_NAME, SET_PIN_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 8, VALUE_OPT_SET_SO_PIN, + /* equiv idx, value */ 8, VALUE_OPT_SET_SO_PIN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SET_SO_PIN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --set-so-pin */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SET_SO_PIN_DESC, SET_SO_PIN_NAME, SET_SO_PIN_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 0, 0, + /* equiv idx, value */ 0, 0, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 0, 0, + /* opt state flags */ OBJECT_LIST_RELATED_OPTIONS_FLAGS, 0, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ OBJECT_LIST_RELATED_OPTIONS_DESC, NULL, NULL, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 10, VALUE_OPT_LIST_ALL, + /* equiv idx, value */ 10, VALUE_OPT_LIST_ALL, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LIST_ALL_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --list-all */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LIST_ALL_DESC, LIST_ALL_NAME, LIST_ALL_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 11, VALUE_OPT_LIST_ALL_CERTS, + /* equiv idx, value */ 11, VALUE_OPT_LIST_ALL_CERTS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LIST_ALL_CERTS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --list-all-certs */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LIST_ALL_CERTS_DESC, LIST_ALL_CERTS_NAME, LIST_ALL_CERTS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 12, VALUE_OPT_LIST_CERTS, + /* equiv idx, value */ 12, VALUE_OPT_LIST_CERTS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LIST_CERTS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --list-certs */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LIST_CERTS_DESC, LIST_CERTS_NAME, LIST_CERTS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 13, VALUE_OPT_LIST_ALL_PRIVKEYS, + /* equiv idx, value */ 13, VALUE_OPT_LIST_ALL_PRIVKEYS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LIST_ALL_PRIVKEYS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --list-all-privkeys */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LIST_ALL_PRIVKEYS_DESC, LIST_ALL_PRIVKEYS_NAME, LIST_ALL_PRIVKEYS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 14, VALUE_OPT_LIST_PRIVKEYS, + /* equiv idx, value */ 14, VALUE_OPT_LIST_PRIVKEYS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LIST_PRIVKEYS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --list-privkeys */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptList_Privkeys, + /* desc, NAME, name */ LIST_PRIVKEYS_DESC, LIST_PRIVKEYS_NAME, LIST_PRIVKEYS_name, + /* disablement strs */ 0, 0 }, + + { /* entry idx, value */ 15, VALUE_OPT_LIST_KEYS, + /* equiv idx, value */ 15, VALUE_OPT_LIST_KEYS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LIST_KEYS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --list-keys */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptList_Keys, + /* desc, NAME, name */ LIST_KEYS_DESC, LIST_KEYS_NAME, LIST_KEYS_name, + /* disablement strs */ 0, 0 }, + + { /* entry idx, value */ 16, VALUE_OPT_LIST_ALL_TRUSTED, + /* equiv idx, value */ 16, VALUE_OPT_LIST_ALL_TRUSTED, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LIST_ALL_TRUSTED_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --list-all-trusted */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LIST_ALL_TRUSTED_DESC, LIST_ALL_TRUSTED_NAME, LIST_ALL_TRUSTED_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 17, VALUE_OPT_EXPORT, + /* equiv idx, value */ 17, VALUE_OPT_EXPORT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ EXPORT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --export */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, aExportCantList, + /* option proc */ NULL, + /* desc, NAME, name */ EXPORT_DESC, EXPORT_NAME, EXPORT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 18, VALUE_OPT_EXPORT_STAPLED, + /* equiv idx, value */ 18, VALUE_OPT_EXPORT_STAPLED, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ EXPORT_STAPLED_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --export-stapled */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, aExport_StapledCantList, + /* option proc */ NULL, + /* desc, NAME, name */ EXPORT_STAPLED_DESC, EXPORT_STAPLED_NAME, EXPORT_STAPLED_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 19, VALUE_OPT_EXPORT_CHAIN, + /* equiv idx, value */ 19, VALUE_OPT_EXPORT_CHAIN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ EXPORT_CHAIN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --export-chain */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, aExport_ChainCantList, + /* option proc */ NULL, + /* desc, NAME, name */ EXPORT_CHAIN_DESC, EXPORT_CHAIN_NAME, EXPORT_CHAIN_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 20, VALUE_OPT_EXPORT_PUBKEY, + /* equiv idx, value */ 20, VALUE_OPT_EXPORT_PUBKEY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ EXPORT_PUBKEY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --export-pubkey */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, aExport_PubkeyCantList, + /* option proc */ NULL, + /* desc, NAME, name */ EXPORT_PUBKEY_DESC, EXPORT_PUBKEY_NAME, EXPORT_PUBKEY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 21, VALUE_OPT_INFO, + /* equiv idx, value */ 21, VALUE_OPT_INFO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INFO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --info */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ INFO_DESC, INFO_NAME, INFO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 22, VALUE_OPT_TRUSTED, + /* equiv idx, value */ 22, VALUE_OPT_TRUSTED, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ TRUSTED_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --trusted */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptTrusted, + /* desc, NAME, name */ TRUSTED_DESC, TRUSTED_NAME, TRUSTED_name, + /* disablement strs */ 0, 0 }, + + { /* entry idx, value */ 23, VALUE_OPT_DISTRUSTED, + /* equiv idx, value */ 23, VALUE_OPT_DISTRUSTED, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DISTRUSTED_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --distrusted */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptDistrusted, + /* desc, NAME, name */ DISTRUSTED_DESC, DISTRUSTED_NAME, DISTRUSTED_name, + /* disablement strs */ 0, 0 }, + + { /* entry idx, value */ 0, 0, + /* equiv idx, value */ 0, 0, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 0, 0, + /* opt state flags */ KEYGEN_RELATED_OPTIONS_FLAGS, 0, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ KEYGEN_RELATED_OPTIONS_DESC, NULL, NULL, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 25, VALUE_OPT_GENERATE_RSA, + /* equiv idx, value */ 25, VALUE_OPT_GENERATE_RSA, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ GENERATE_RSA_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --generate-rsa */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ GENERATE_RSA_DESC, GENERATE_RSA_NAME, GENERATE_RSA_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 26, VALUE_OPT_GENERATE_DSA, + /* equiv idx, value */ 26, VALUE_OPT_GENERATE_DSA, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ GENERATE_DSA_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --generate-dsa */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ GENERATE_DSA_DESC, GENERATE_DSA_NAME, GENERATE_DSA_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 27, VALUE_OPT_GENERATE_ECC, + /* equiv idx, value */ 27, VALUE_OPT_GENERATE_ECC, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ GENERATE_ECC_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --generate-ecc */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ GENERATE_ECC_DESC, GENERATE_ECC_NAME, GENERATE_ECC_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 28, VALUE_OPT_BITS, + /* equiv idx, value */ 28, VALUE_OPT_BITS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ BITS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --bits */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionNumericVal, + /* desc, NAME, name */ BITS_DESC, BITS_NAME, BITS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 29, VALUE_OPT_CURVE, + /* equiv idx, value */ 29, VALUE_OPT_CURVE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ CURVE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --curve */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ CURVE_DESC, CURVE_NAME, CURVE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 30, VALUE_OPT_SEC_PARAM, + /* equiv idx, value */ 30, VALUE_OPT_SEC_PARAM, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SEC_PARAM_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --sec-param */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SEC_PARAM_DESC, SEC_PARAM_NAME, SEC_PARAM_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 0, 0, + /* equiv idx, value */ 0, 0, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 0, 0, + /* opt state flags */ WRITE_OBJECT_RELATED_OPTIONS_FLAGS, 0, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ WRITE_OBJECT_RELATED_OPTIONS_DESC, NULL, NULL, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 32, VALUE_OPT_SET_ID, + /* equiv idx, value */ 32, VALUE_OPT_SET_ID, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SET_ID_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --set-id */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, aSet_IdCantList, + /* option proc */ NULL, + /* desc, NAME, name */ SET_ID_DESC, SET_ID_NAME, SET_ID_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 33, VALUE_OPT_SET_LABEL, + /* equiv idx, value */ 33, VALUE_OPT_SET_LABEL, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SET_LABEL_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --set-label */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, aSet_LabelCantList, + /* option proc */ NULL, + /* desc, NAME, name */ SET_LABEL_DESC, SET_LABEL_NAME, SET_LABEL_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 34, VALUE_OPT_WRITE, + /* equiv idx, value */ 34, VALUE_OPT_WRITE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ WRITE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --write */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ WRITE_DESC, WRITE_NAME, WRITE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 35, VALUE_OPT_DELETE, + /* equiv idx, value */ 35, VALUE_OPT_DELETE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DELETE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --delete */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ DELETE_DESC, DELETE_NAME, DELETE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 36, VALUE_OPT_LABEL, + /* equiv idx, value */ 36, VALUE_OPT_LABEL, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LABEL_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --label */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LABEL_DESC, LABEL_NAME, LABEL_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 37, VALUE_OPT_ID, + /* equiv idx, value */ 37, VALUE_OPT_ID, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ ID_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --id */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ ID_DESC, ID_NAME, ID_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 38, VALUE_OPT_MARK_WRAP, + /* equiv idx, value */ 38, VALUE_OPT_MARK_WRAP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MARK_WRAP_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --mark-wrap */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ MARK_WRAP_DESC, MARK_WRAP_NAME, MARK_WRAP_name, + /* disablement strs */ NOT_MARK_WRAP_name, NOT_MARK_WRAP_PFX }, + + { /* entry idx, value */ 39, VALUE_OPT_MARK_TRUSTED, + /* equiv idx, value */ 39, VALUE_OPT_MARK_TRUSTED, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MARK_TRUSTED_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --mark-trusted */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, aMark_TrustedCantList, + /* option proc */ NULL, + /* desc, NAME, name */ MARK_TRUSTED_DESC, MARK_TRUSTED_NAME, MARK_TRUSTED_name, + /* disablement strs */ NOT_MARK_TRUSTED_name, NOT_MARK_TRUSTED_PFX }, + + { /* entry idx, value */ 40, VALUE_OPT_MARK_DISTRUSTED, + /* equiv idx, value */ 40, VALUE_OPT_MARK_DISTRUSTED, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MARK_DISTRUSTED_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --mark-distrusted */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, aMark_DistrustedCantList, + /* option proc */ NULL, + /* desc, NAME, name */ MARK_DISTRUSTED_DESC, MARK_DISTRUSTED_NAME, MARK_DISTRUSTED_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 41, VALUE_OPT_MARK_DECRYPT, + /* equiv idx, value */ 41, VALUE_OPT_MARK_DECRYPT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MARK_DECRYPT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --mark-decrypt */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ MARK_DECRYPT_DESC, MARK_DECRYPT_NAME, MARK_DECRYPT_name, + /* disablement strs */ NOT_MARK_DECRYPT_name, NOT_MARK_DECRYPT_PFX }, + + { /* entry idx, value */ 42, VALUE_OPT_MARK_SIGN, + /* equiv idx, value */ 42, VALUE_OPT_MARK_SIGN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MARK_SIGN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --mark-sign */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ MARK_SIGN_DESC, MARK_SIGN_NAME, MARK_SIGN_name, + /* disablement strs */ NOT_MARK_SIGN_name, NOT_MARK_SIGN_PFX }, + + { /* entry idx, value */ 43, VALUE_OPT_MARK_CA, + /* equiv idx, value */ 43, VALUE_OPT_MARK_CA, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MARK_CA_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --mark-ca */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ MARK_CA_DESC, MARK_CA_NAME, MARK_CA_name, + /* disablement strs */ NOT_MARK_CA_name, NOT_MARK_CA_PFX }, + + { /* entry idx, value */ 44, VALUE_OPT_MARK_PRIVATE, + /* equiv idx, value */ 44, VALUE_OPT_MARK_PRIVATE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MARK_PRIVATE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --mark-private */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ MARK_PRIVATE_DESC, MARK_PRIVATE_NAME, MARK_PRIVATE_name, + /* disablement strs */ NOT_MARK_PRIVATE_name, NOT_MARK_PRIVATE_PFX }, + + { /* entry idx, value */ 45, VALUE_OPT_CA, + /* equiv idx, value */ 45, VALUE_OPT_CA, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ CA_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --ca */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptCa, + /* desc, NAME, name */ CA_DESC, CA_NAME, CA_name, + /* disablement strs */ 0, 0 }, + + { /* entry idx, value */ 46, VALUE_OPT_PRIVATE, + /* equiv idx, value */ 46, VALUE_OPT_PRIVATE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PRIVATE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --private */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptPrivate, + /* desc, NAME, name */ PRIVATE_DESC, PRIVATE_NAME, PRIVATE_name, + /* disablement strs */ 0, 0 }, + + { /* entry idx, value */ 47, VALUE_OPT_SECRET_KEY, + /* equiv idx, value */ 47, VALUE_OPT_SECRET_KEY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SECRET_KEY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --secret-key */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SECRET_KEY_DESC, SECRET_KEY_NAME, SECRET_KEY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 48, VALUE_OPT_LOAD_PRIVKEY, + /* equiv idx, value */ 48, VALUE_OPT_LOAD_PRIVKEY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_PRIVKEY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-privkey */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptLoad_Privkey, + /* desc, NAME, name */ LOAD_PRIVKEY_DESC, LOAD_PRIVKEY_NAME, LOAD_PRIVKEY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 49, VALUE_OPT_LOAD_PUBKEY, + /* equiv idx, value */ 49, VALUE_OPT_LOAD_PUBKEY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_PUBKEY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-pubkey */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptLoad_Pubkey, + /* desc, NAME, name */ LOAD_PUBKEY_DESC, LOAD_PUBKEY_NAME, LOAD_PUBKEY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 50, VALUE_OPT_LOAD_CERTIFICATE, + /* equiv idx, value */ 50, VALUE_OPT_LOAD_CERTIFICATE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOAD_CERTIFICATE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --load-certificate */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptLoad_Certificate, + /* desc, NAME, name */ LOAD_CERTIFICATE_DESC, LOAD_CERTIFICATE_NAME, LOAD_CERTIFICATE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 0, 0, + /* equiv idx, value */ 0, 0, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 0, 0, + /* opt state flags */ OTHER_OPTIONS_FLAGS, 0, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ OTHER_OPTIONS_DESC, NULL, NULL, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 52, VALUE_OPT_DEBUG, + /* equiv idx, value */ 52, VALUE_OPT_DEBUG, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DEBUG_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --debug */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptDebug, + /* desc, NAME, name */ DEBUG_DESC, DEBUG_NAME, DEBUG_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 53, VALUE_OPT_OUTFILE, + /* equiv idx, value */ 53, VALUE_OPT_OUTFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OUTFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --outfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ OUTFILE_DESC, OUTFILE_NAME, OUTFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 54, VALUE_OPT_LOGIN, + /* equiv idx, value */ 54, VALUE_OPT_LOGIN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LOGIN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --login */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LOGIN_DESC, LOGIN_NAME, LOGIN_name, + /* disablement strs */ NOT_LOGIN_name, NOT_LOGIN_PFX }, + + { /* entry idx, value */ 55, VALUE_OPT_SO_LOGIN, + /* equiv idx, value */ 55, VALUE_OPT_SO_LOGIN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SO_LOGIN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --so-login */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SO_LOGIN_DESC, SO_LOGIN_NAME, SO_LOGIN_name, + /* disablement strs */ NOT_SO_LOGIN_name, NOT_SO_LOGIN_PFX }, + + { /* entry idx, value */ 56, VALUE_OPT_ADMIN_LOGIN, + /* equiv idx, value */ 56, VALUE_OPT_ADMIN_LOGIN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ ADMIN_LOGIN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --admin-login */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptAdmin_Login, + /* desc, NAME, name */ ADMIN_LOGIN_DESC, ADMIN_LOGIN_NAME, ADMIN_LOGIN_name, + /* disablement strs */ 0, 0 }, + + { /* entry idx, value */ 57, VALUE_OPT_TEST_SIGN, + /* equiv idx, value */ 57, VALUE_OPT_TEST_SIGN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ TEST_SIGN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --test-sign */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ TEST_SIGN_DESC, TEST_SIGN_NAME, TEST_SIGN_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 58, VALUE_OPT_GENERATE_RANDOM, + /* equiv idx, value */ 58, VALUE_OPT_GENERATE_RANDOM, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ GENERATE_RANDOM_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --generate-random */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionNumericVal, + /* desc, NAME, name */ GENERATE_RANDOM_DESC, GENERATE_RANDOM_NAME, GENERATE_RANDOM_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 59, VALUE_OPT_PKCS8, + /* equiv idx, value */ 59, VALUE_OPT_PKCS8, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PKCS8_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pkcs8 */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PKCS8_DESC, PKCS8_NAME, PKCS8_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 60, VALUE_OPT_INDER, + /* equiv idx, value */ 60, VALUE_OPT_INDER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INDER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --inder */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ INDER_DESC, INDER_NAME, INDER_name, + /* disablement strs */ NOT_INDER_name, NOT_INDER_PFX }, + + { /* entry idx, value */ 61, VALUE_OPT_INRAW, + /* equiv idx, value */ 61, VALUE_OPT_INRAW, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INRAW_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --inraw */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptInraw, + /* desc, NAME, name */ INRAW_DESC, INRAW_NAME, INRAW_name, + /* disablement strs */ 0, 0 }, + + { /* entry idx, value */ 62, VALUE_OPT_OUTDER, + /* equiv idx, value */ 62, VALUE_OPT_OUTDER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OUTDER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --outder */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ OUTDER_DESC, OUTDER_NAME, OUTDER_name, + /* disablement strs */ NOT_OUTDER_name, NOT_OUTDER_PFX }, + + { /* entry idx, value */ 63, VALUE_OPT_OUTRAW, + /* equiv idx, value */ 63, VALUE_OPT_OUTRAW, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OUTRAW_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --outraw */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptOutraw, + /* desc, NAME, name */ OUTRAW_DESC, OUTRAW_NAME, OUTRAW_name, + /* disablement strs */ 0, 0 }, + + { /* entry idx, value */ 64, VALUE_OPT_PROVIDER, + /* equiv idx, value */ 64, VALUE_OPT_PROVIDER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PROVIDER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --provider */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptProvider, + /* desc, NAME, name */ PROVIDER_DESC, PROVIDER_NAME, PROVIDER_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 65, VALUE_OPT_DETAILED_URL, + /* equiv idx, value */ 65, VALUE_OPT_DETAILED_URL, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DETAILED_URL_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --detailed-url */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ DETAILED_URL_DESC, DETAILED_URL_NAME, DETAILED_URL_name, + /* disablement strs */ NOT_DETAILED_URL_name, NOT_DETAILED_URL_PFX }, + + { /* entry idx, value */ 66, VALUE_OPT_ONLY_URLS, + /* equiv idx, value */ 66, VALUE_OPT_ONLY_URLS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ ONLY_URLS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --only-urls */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ ONLY_URLS_DESC, ONLY_URLS_NAME, ONLY_URLS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 67, VALUE_OPT_BATCH, + /* equiv idx, value */ 67, VALUE_OPT_BATCH, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ BATCH_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --batch */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ BATCH_DESC, BATCH_NAME, BATCH_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VER_FLAGS, AOUSE_VERSION, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ VER_PROC, + /* desc, NAME, name */ VER_DESC, NULL, VER_name, + /* disablement strs */ NULL, NULL }, + + + + { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doUsageOpt, + /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionPagedUsage, + /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, + /* disablement strs */ NULL, NULL } +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** Reference to the upper cased version of p11tool. */ +#define zPROGNAME (p11tool_opt_strs+4927) +/** Reference to the title line for p11tool usage. */ +#define zUsageTitle (p11tool_opt_strs+4935) +/** There is no p11tool configuration file. */ +#define zRcName NULL +/** There are no directories to search for p11tool config files. */ +#define apzHomeList NULL +/** The p11tool program bug email address. */ +#define zBugsAddr (p11tool_opt_strs+5030) +/** Clarification/explanation of what p11tool does. */ +#define zExplain (p11tool_opt_strs+5050) +/** Extra detail explaining what p11tool does. */ +#define zDetail (p11tool_opt_strs+5052) +/** The full version string for p11tool. */ +#define zFullVersion (p11tool_opt_strs+5594) +/* extracted from optcode.tlib near line 364 */ + +#if defined(ENABLE_NLS) +# define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT + static tOptionXlateProc translate_option_strings; +#else +# define OPTPROC_BASE OPTPROC_NONE +# define translate_option_strings NULL +#endif /* ENABLE_NLS */ + +#define p11tool_full_usage (NULL) +#define p11tool_short_usage (p11tool_opt_strs+5612) + +#endif /* not defined __doxygen__ */ + +/* + * Create the static procedure(s) declared above. + */ +/** + * The callout function that invokes the optionUsage function. + * + * @param[in] opts the AutoOpts option description structure + * @param[in] od the descriptor for the "help" (usage) option. + * @noreturn + */ +static void +doUsageOpt(tOptions * opts, tOptDesc * od) +{ + int ex_code; + ex_code = P11TOOL_EXIT_SUCCESS; + optionUsage(&p11toolOptions, ex_code); + /* NOTREACHED */ + exit(P11TOOL_EXIT_FAILURE); + (void)opts; + (void)od; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the list-privkeys option. + * + * @param[in] pOptions the p11tool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptList_Privkeys(tOptions* pOptions, tOptDesc* pOptDesc) +{ + int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_LIST_ALL_PRIVKEYS); + if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0)) + USAGE(P11TOOL_EXIT_USAGE_ERROR); + +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the list-keys option. + * + * @param[in] pOptions the p11tool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptList_Keys(tOptions* pOptions, tOptDesc* pOptDesc) +{ + int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_LIST_ALL_PRIVKEYS); + if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0)) + USAGE(P11TOOL_EXIT_USAGE_ERROR); + +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the trusted option. + * + * @param[in] pOptions the p11tool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptTrusted(tOptions* pOptions, tOptDesc* pOptDesc) +{ + int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_MARK_TRUSTED); + if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0)) + USAGE(P11TOOL_EXIT_USAGE_ERROR); + +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the distrusted option. + * + * @param[in] pOptions the p11tool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptDistrusted(tOptions* pOptions, tOptDesc* pOptDesc) +{ + int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_MARK_DISTRUSTED); + if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0)) + USAGE(P11TOOL_EXIT_USAGE_ERROR); + +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the ca option. + * + * @param[in] pOptions the p11tool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptCa(tOptions* pOptions, tOptDesc* pOptDesc) +{ + int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_MARK_CA); + if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0)) + USAGE(P11TOOL_EXIT_USAGE_ERROR); + +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the private option. + * + * @param[in] pOptions the p11tool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptPrivate(tOptions* pOptions, tOptDesc* pOptDesc) +{ + int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_MARK_PRIVATE); + if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0)) + USAGE(P11TOOL_EXIT_USAGE_ERROR); + +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the load-privkey option. + * + * @param[in] pOptions the p11tool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptLoad_Privkey(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the load-pubkey option. + * + * @param[in] pOptions the p11tool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptLoad_Pubkey(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the load-certificate option. + * + * @param[in] pOptions the p11tool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptLoad_Certificate(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the debug option. + * Specifies the debug level. + * @param[in] pOptions the p11tool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptDebug(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[1] = { + { 0 , 9999 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 1; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + + emit_ranges: +optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the admin-login option. + * + * @param[in] pOptions the p11tool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptAdmin_Login(tOptions* pOptions, tOptDesc* pOptDesc) +{ + int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_SO_LOGIN); + if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0)) + USAGE(P11TOOL_EXIT_USAGE_ERROR); + +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the inraw option. + * + * @param[in] pOptions the p11tool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptInraw(tOptions* pOptions, tOptDesc* pOptDesc) +{ + int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_INDER); + if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0)) + USAGE(P11TOOL_EXIT_USAGE_ERROR); + +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the outraw option. + * + * @param[in] pOptions the p11tool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptOutraw(tOptions* pOptions, tOptDesc* pOptDesc) +{ + int res = optionAlias(pOptions, pOptDesc, INDEX_OPT_OUTDER); + if ((res != 0) && ((pOptions->fOptSet & OPTPROC_ERRSTOP) != 0)) + USAGE(P11TOOL_EXIT_USAGE_ERROR); + +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the provider option. + * This will override the default options in /etc/gnutls/pkcs11.conf + * @param[in] pOptions the p11tool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptProvider(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MAY_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} +/* extracted from optmain.tlib near line 1250 */ + +/** + * The directory containing the data associated with p11tool. + */ +#ifndef PKGDATADIR +# define PKGDATADIR "" +#endif + +/** + * Information about the person or institution that packaged p11tool + * for the current distribution. + */ +#ifndef WITH_PACKAGER +# define p11tool_packager_info NULL +#else +/** Packager information for p11tool. */ +static char const p11tool_packager_info[] = + "Packaged by " WITH_PACKAGER + +# ifdef WITH_PACKAGER_VERSION + " ("WITH_PACKAGER_VERSION")" +# endif + +# ifdef WITH_PACKAGER_BUG_REPORTS + "\nReport p11tool bugs to " WITH_PACKAGER_BUG_REPORTS +# endif + "\n"; +#endif +#ifndef __doxygen__ + +#endif /* __doxygen__ */ +/** + * The option definitions for p11tool. The one structure that + * binds them all. + */ +tOptions p11toolOptions = { + OPTIONS_STRUCT_VERSION, + 0, NULL, /* original argc + argv */ + ( OPTPROC_BASE + + OPTPROC_ERRSTOP + + OPTPROC_SHORTOPT + + OPTPROC_LONGOPT + + OPTPROC_NO_REQ_OPT + + OPTPROC_NEGATIONS + + OPTPROC_REORDER + + OPTPROC_GNUUSAGE + + OPTPROC_MISUSE ), + 0, NULL, /* current option index, current option */ + NULL, NULL, zPROGNAME, + zRcName, zCopyright, zLicenseDescrip, + zFullVersion, apzHomeList, zUsageTitle, + zExplain, zDetail, optDesc, + zBugsAddr, /* address to send bugs to */ + NULL, NULL, /* extensions/saved state */ + optionUsage, /* usage procedure */ + translate_option_strings, /* translation procedure */ + /* + * Indexes to special options + */ + { INDEX_OPT_MORE_HELP, /* more-help option index */ + NO_EQUIVALENT, /* save option index */ + NO_EQUIVALENT, /* '-#' option index */ + NO_EQUIVALENT /* index of default opt */ + }, + 71 /* full option count */, 68 /* user option count */, + p11tool_full_usage, p11tool_short_usage, + NULL, NULL, + PKGDATADIR, p11tool_packager_info +}; + +#if ENABLE_NLS +/** + * This code is designed to translate translatable option text for the + * p11tool program. These translations happen upon entry + * to optionProcess(). + */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#ifdef HAVE_DCGETTEXT +# include <gettext.h> +#endif +#include <autoopts/usage-txt.h> + +static char * AO_gettext(char const * pz); +static void coerce_it(void ** s); + +/** + * AutoGen specific wrapper function for gettext. It relies on the macro _() + * to convert from English to the target language, then strdup-duplicates the + * result string. It tries the "libopts" domain first, then whatever has been + * set via the \a textdomain(3) call. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * +AO_gettext(char const * pz) +{ + char * res; + if (pz == NULL) + return NULL; +#ifdef HAVE_DCGETTEXT + /* + * While processing the option_xlateable_txt data, try to use the + * "libopts" domain. Once we switch to the option descriptor data, + * do *not* use that domain. + */ + if (option_xlateable_txt.field_ct != 0) { + res = dgettext("libopts", pz); + if (res == pz) + res = (char *)VOIDP(_(pz)); + } else + res = (char *)VOIDP(_(pz)); +#else + res = (char *)VOIDP(_(pz)); +#endif + if (res == pz) + return res; + res = strdup(res); + if (res == NULL) { + fputs(_("No memory for duping translated strings\n"), stderr); + exit(P11TOOL_EXIT_FAILURE); + } + return res; +} + +/** + * All the pointers we use are marked "* const", but they are stored in + * writable memory. Coerce the mutability and set the pointer. + */ +static void coerce_it(void ** s) { *s = AO_gettext(*s); +} + +/** + * Translate all the translatable strings in the p11toolOptions + * structure defined above. This is done only once. + */ +static void +translate_option_strings(void) +{ + tOptions * const opts = &p11toolOptions; + + /* + * Guard against re-translation. It won't work. The strings will have + * been changed by the first pass through this code. One shot only. + */ + if (option_xlateable_txt.field_ct != 0) { + /* + * Do the translations. The first pointer follows the field count + * field. The field count field is the size of a pointer. + */ + char ** ppz = (char**)VOIDP(&(option_xlateable_txt)); + int ix = option_xlateable_txt.field_ct; + + do { + ppz++; /* skip over field_ct */ + *ppz = AO_gettext(*ppz); + } while (--ix > 0); + /* prevent re-translation and disable "libopts" domain lookup */ + option_xlateable_txt.field_ct = 0; + + coerce_it(VOIDP(&(opts->pzCopyright))); + coerce_it(VOIDP(&(opts->pzCopyNotice))); + coerce_it(VOIDP(&(opts->pzFullVersion))); + coerce_it(VOIDP(&(opts->pzUsageTitle))); + coerce_it(VOIDP(&(opts->pzExplain))); + coerce_it(VOIDP(&(opts->pzDetail))); + { + tOptDesc * od = opts->pOptDesc; + for (ix = opts->optCt; ix > 0; ix--, od++) + coerce_it(VOIDP(&(od->pzText))); + } + } +} +#endif /* ENABLE_NLS */ + +#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT +/** I18N function strictly for xgettext. Do not compile. */ +static void bogus_function(void) { + /* TRANSLATORS: + + The following dummy function was crated solely so that xgettext can + extract the correct strings. These strings are actually referenced + by a field name in the p11toolOptions structure noted in the + comments below. The literal text is defined in p11tool_opt_strs. + + NOTE: the strings below are segmented with respect to the source string + p11tool_opt_strs. The strings above are handed off for translation + at run time a paragraph at a time. Consequently, they are presented here + for translation a paragraph at a time. + + ALSO: often the description for an option will reference another option + by name. These are set off with apostrophe quotes (I hope). Do not + translate option names. + */ + /* referenced via p11toolOptions.pzCopyright */ + puts(_("p11tool @VERSION@\n\ +Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n\ +This is free software. It is licensed for use, modification and\n\ +redistribution under the terms of the GNU General Public License,\n\ +version 3 or later <http://gnu.org/licenses/gpl.html>\n")); + + /* referenced via p11toolOptions.pzCopyNotice */ + puts(_("p11tool is free software: you can redistribute it and/or modify it under\n\ +the terms of the GNU General Public License as published by the Free\n\ +Software Foundation, either version 3 of the License, or (at your option)\n\ +any later version.\n\n")); + puts(_("p11tool is distributed in the hope that it will be useful, but WITHOUT ANY\n\ +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n\ +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n\ +details.\n\n")); + puts(_("You should have received a copy of the GNU General Public License along\n\ +with this program. If not, see <http://www.gnu.org/licenses/>.\n")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Tokens:")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("List all available tokens")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("List the URLs available tokens")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("List all available mechanisms in a token")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Initializes a PKCS #11 token")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Initializes/Resets a PKCS #11 token user PIN")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Initializes/Resets a PKCS #11 token security officer PIN")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Specify the PIN to use on token initialization")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Specify the Security Officer's PIN to use on token initialization")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Object listing:")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("List all available objects in a token")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("List all available certificates in a token")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("List all certificates that have an associated private key")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("List all available private keys in a token")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("an alias for the 'list-all-privkeys' option")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("an alias for the 'list-all-privkeys' option")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("List all available certificates marked as trusted")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Export the object specified by the URL")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Export the certificate object specified by the URL")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Export the certificate specified by the URL and its chain of trust")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Export the public key for a private key")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("List information on an available object in a token")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("an alias for the 'mark-trusted' option")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("an alias for the 'mark-distrusted' option")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Key generation:")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Generate an RSA private-public key pair")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Generate a DSA private-public key pair")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Generate an ECDSA private-public key pair")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Specify the number of bits for the key generate")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Specify the curve used for EC key generation")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Specify the security level")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Writing objects:")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Set the CKA_ID (in hex) for the specified by the URL object")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Set the CKA_LABEL for the specified by the URL object")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Writes the loaded objects to a PKCS #11 token")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Deletes the objects matching the given PKCS #11 URL")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Sets a label for the write operation")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Sets an ID for the write operation")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Marks the generated key to be a wrapping key")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Marks the object to be written as trusted")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("When retrieving objects, it requires the objects to be distrusted\n\ +(blacklisted)")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Marks the object to be written for decryption")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Marks the object to be written for signature generation")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Marks the object to be written as a CA")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Marks the object to be written as private")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("an alias for the 'mark-ca' option")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("an alias for the 'mark-private' option")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Provide a hex encoded secret key")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Private key file to use")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Public key file to use")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Certificate file to use")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Other options:")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Enable debugging")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Output file")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Force (user) login to token")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Force security officer login to token")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("an alias for the 'so-login' option")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Tests the signature operation of the provided object")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Generate random data")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Use PKCS #8 format for private keys")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Use DER/RAW format for input")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("an alias for the 'inder' option")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Use DER format for output certificates, private keys, and DH parameters")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("an alias for the 'outder' option")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Specify the PKCS #11 provider library")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Print detailed URLs")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Print a compact listing using only the URLs")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("Disable all interaction with the tool")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("display extended usage information and exit")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("extended usage information passed thru pager")); + + /* referenced via p11toolOptions.pOptDesc->pzText */ + puts(_("output version information and exit")); + + /* referenced via p11toolOptions.pzUsageTitle */ + puts(_("p11tool - GnuTLS PKCS #11 tool\n\ +Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... [url]\n")); + + /* referenced via p11toolOptions.pzExplain */ + puts(_("\n")); + + /* referenced via p11toolOptions.pzDetail */ + puts(_("Program that allows operations on PKCS #11 smart cards and security\n\ +modules.\n\n")); + puts(_("To use PKCS #11 tokens with GnuTLS the p11-kit configuration files need to\n\ +be setup. That is create a .module file in /etc/pkcs11/modules with the\n\ +contents 'module: /path/to/pkcs11.so'. Alternatively the configuration\n\ +file /etc/gnutls/pkcs11.conf has to exist and contain a number of lines of\n\ +the form 'load=/usr/lib/opensc-pkcs11.so'.\n\n")); + puts(_("You can provide the PIN to be used for the PKCS #11 operations with the\n\ +environment variables GNUTLS_PIN and GNUTLS_SO_PIN.\n")); + + /* referenced via p11toolOptions.pzFullVersion */ + puts(_("p11tool @VERSION@")); + + /* referenced via p11toolOptions.pzFullUsage */ + puts(_("<<<NOT-FOUND>>>")); + + /* referenced via p11toolOptions.pzShortUsage */ + puts(_("p11tool [options] [url]\n\ +p11tool --help for usage instructions.\n")); + /* LIBOPTS-MESSAGES: */ +#line 67 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 93 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 53 "../init.c" + puts(_("AutoOpts function called without option descriptor\n")); +#line 86 "../init.c" + puts(_("\tThis exceeds the compiled library version: ")); +#line 84 "../init.c" + puts(_("Automated Options Processing Error!\n" + "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); +#line 80 "../autoopts.c" + puts(_("realloc of %d bytes at 0x%p failed\n")); +#line 88 "../init.c" + puts(_("\tThis is less than the minimum library version: ")); +#line 121 "../version.c" + puts(_("Automated Options version %s\n" + "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); +#line 87 "../makeshell.c" + puts(_("(AutoOpts bug): %s.\n")); +#line 90 "../reset.c" + puts(_("optionResetOpt() called, but reset-option not configured")); +#line 295 "../usage.c" + puts(_("could not locate the 'help' option")); +#line 336 "../autoopts.c" + puts(_("optionProcess() was called with invalid data")); +#line 751 "../usage.c" + puts(_("invalid argument type specified")); +#line 598 "../find.c" + puts(_("defaulted to option with optional arg")); +#line 76 "../alias.c" + puts(_("aliasing option is out of range.")); +#line 235 "../enum.c" + puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); +#line 108 "../find.c" + puts(_(" The following options match:\n")); +#line 293 "../find.c" + puts(_("%s: ambiguous option name: %s (matches %d options)\n")); +#line 161 "../check.c" + puts(_("%s: Command line arguments required\n")); +#line 43 "../alias.c" + puts(_("%d %s%s options allowed\n")); +#line 94 "../makeshell.c" + puts(_("%s error %d (%s) calling %s for '%s'\n")); +#line 306 "../makeshell.c" + puts(_("interprocess pipe")); +#line 168 "../version.c" + puts(_("error: version option argument '%c' invalid. Use:\n" + "\t'v' - version only\n" + "\t'c' - version and copyright\n" + "\t'n' - version and full copyright notice\n")); +#line 58 "../check.c" + puts(_("%s error: the '%s' and '%s' options conflict\n")); +#line 217 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 430 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 38 "../alias.c" + puts(_("-equivalence")); +#line 469 "../find.c" + puts(_("%s: illegal option -- %c\n")); +#line 110 "../reset.c" + puts(_("%s: illegal option -- %c\n")); +#line 271 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 755 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 118 "../reset.c" + puts(_("%s: illegal option -- %s\n")); +#line 335 "../find.c" + puts(_("%s: unknown vendor extension option -- %s\n")); +#line 160 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 170 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 750 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 1084 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 385 "../find.c" + puts(_("%s: invalid option name: %s\n")); +#line 527 "../find.c" + puts(_("%s: The '%s' option requires an argument.\n")); +#line 156 "../autoopts.c" + puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" + "\t'%s' and '%s'.")); +#line 94 "../check.c" + puts(_("%s error: The %s option is required\n")); +#line 632 "../find.c" + puts(_("%s: The '%s' option cannot have an argument.\n")); +#line 151 "../check.c" + puts(_("%s: Command line arguments are not allowed.\n")); +#line 536 "../save.c" + puts(_("error %d (%s) creating %s\n")); +#line 235 "../enum.c" + puts(_("%s error: '%s' does not match any %s keywords.\n")); +#line 93 "../reset.c" + puts(_("%s error: The '%s' option requires an argument.\n")); +#line 186 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 239 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 143 "../restore.c" + puts(_("%s error: no saved option state\n")); +#line 231 "../autoopts.c" + puts(_("'%s' is not a command line option.\n")); +#line 113 "../time.c" + puts(_("%s error: '%s' is not a recognizable date/time.\n")); +#line 131 "../save.c" + puts(_("'%s' not defined\n")); +#line 50 "../time.c" + puts(_("%s error: '%s' is not a recognizable time duration.\n")); +#line 92 "../check.c" + puts(_("%s error: The %s option must appear %d times.\n")); +#line 165 "../numeric.c" + puts(_("%s error: '%s' is not a recognizable number.\n")); +#line 201 "../enum.c" + puts(_("%s error: %s exceeds %s keyword count\n")); +#line 333 "../usage.c" + puts(_("Try '%s %s' for more information.\n")); +#line 45 "../alias.c" + puts(_("one %s%s option allowed\n")); +#line 208 "../makeshell.c" + puts(_("standard output")); +#line 943 "../makeshell.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard output")); +#line 418 "../usage.c" + puts(_("standard output")); +#line 628 "../usage.c" + puts(_("standard output")); +#line 175 "../version.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard error")); +#line 418 "../usage.c" + puts(_("standard error")); +#line 628 "../usage.c" + puts(_("standard error")); +#line 175 "../version.c" + puts(_("standard error")); +#line 208 "../makeshell.c" + puts(_("write")); +#line 943 "../makeshell.c" + puts(_("write")); +#line 276 "../usage.c" + puts(_("write")); +#line 417 "../usage.c" + puts(_("write")); +#line 627 "../usage.c" + puts(_("write")); +#line 174 "../version.c" + puts(_("write")); +#line 60 "../numeric.c" + puts(_("%s error: %s option value %ld is out of range.\n")); +#line 44 "../check.c" + puts(_("%s error: %s option requires the %s option\n")); +#line 130 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 185 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 238 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 257 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 535 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); + /* END-LIBOPTS-MESSAGES */ + + /* USAGE-TEXT: */ +#line 876 "../usage.c" + puts(_("\t\t\t\t- an alternate for '%s'\n")); +#line 1151 "../usage.c" + puts(_("Version, usage and configuration options:")); +#line 927 "../usage.c" + puts(_("\t\t\t\t- default option for unnamed options\n")); +#line 840 "../usage.c" + puts(_("\t\t\t\t- disabled as '--%s'\n")); +#line 1120 "../usage.c" + puts(_(" --- %-14s %s\n")); +#line 1118 "../usage.c" + puts(_("This option has been disabled")); +#line 867 "../usage.c" + puts(_("\t\t\t\t- enabled by default\n")); +#line 40 "../alias.c" + puts(_("%s error: only ")); +#line 1197 "../usage.c" + puts(_(" - examining environment variables named %s_*\n")); +#line 168 "../file.c" + puts(_("\t\t\t\t- file must not pre-exist\n")); +#line 172 "../file.c" + puts(_("\t\t\t\t- file must pre-exist\n")); +#line 383 "../usage.c" + puts(_("Options are specified by doubled hyphens and their name or by a single\n" + "hyphen and the flag character.\n")); +#line 921 "../makeshell.c" + puts(_("\n" + "= = = = = = = =\n\n" + "This incarnation of genshell will produce\n" + "a shell script to parse the options for %s:\n\n")); +#line 167 "../enum.c" + puts(_(" or an integer mask with any of the lower %d bits set\n")); +#line 900 "../usage.c" + puts(_("\t\t\t\t- is a set membership option\n")); +#line 921 "../usage.c" + puts(_("\t\t\t\t- must appear between %d and %d times\n")); +#line 385 "../usage.c" + puts(_("Options are specified by single or double hyphens and their name.\n")); +#line 907 "../usage.c" + puts(_("\t\t\t\t- may appear multiple times\n")); +#line 894 "../usage.c" + puts(_("\t\t\t\t- may not be preset\n")); +#line 1312 "../usage.c" + puts(_(" Arg Option-Name Description\n")); +#line 1248 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1306 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1307 "../usage.c" + puts(_(" %3s %s")); +#line 1313 "../usage.c" + puts(_(" %3s %s")); +#line 390 "../usage.c" + puts(_("The '-#<number>' option may omit the hash char\n")); +#line 386 "../usage.c" + puts(_("All arguments are named options.\n")); +#line 974 "../usage.c" + puts(_(" - reading file %s")); +#line 412 "../usage.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 100 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 129 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 906 "../usage.c" + puts(_("\t\t\t\t- may NOT appear - preset only\n")); +#line 947 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 1195 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 685 "../usage.c" + puts(_("prohibits these options:\n")); +#line 680 "../usage.c" + puts(_("prohibits the option '%s'\n")); +#line 81 "../numeric.c" + puts(_("%s%ld to %ld")); +#line 79 "../numeric.c" + puts(_("%sgreater than or equal to %ld")); +#line 75 "../numeric.c" + puts(_("%s%ld exactly")); +#line 68 "../numeric.c" + puts(_("%sit must lie in one of the ranges:\n")); +#line 68 "../numeric.c" + puts(_("%sit must be in the range:\n")); +#line 88 "../numeric.c" + puts(_(", or\n")); +#line 66 "../numeric.c" + puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); +#line 77 "../numeric.c" + puts(_("%sless than or equal to %ld")); +#line 393 "../usage.c" + puts(_("Operands and options may be intermixed. They will be reordered.\n")); +#line 655 "../usage.c" + puts(_("requires the option '%s'\n")); +#line 658 "../usage.c" + puts(_("requires these options:\n")); +#line 1324 "../usage.c" + puts(_(" Arg Option-Name Req? Description\n")); +#line 1318 "../usage.c" + puts(_(" Flg Arg Option-Name Req? Description\n")); +#line 168 "../enum.c" + puts(_("or you may use a numeric representation. Preceding these with a '!'\n" + "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" + "will set them all. Multiple entries may be passed as an option\n" + "argument list.\n")); +#line 913 "../usage.c" + puts(_("\t\t\t\t- may appear up to %d times\n")); +#line 77 "../enum.c" + puts(_("The valid \"%s\" option keywords are:\n")); +#line 1155 "../usage.c" + puts(_("The next option supports vendor supported extra options:")); +#line 776 "../usage.c" + puts(_("These additional options are:")); + /* END-USAGE-TEXT */ +} +#endif /* uncompilable code */ +#ifdef __cplusplus +} +#endif +/* p11tool-args.c ends here */ diff --git a/src/p11tool-args.h.bak b/src/p11tool-args.h.bak new file mode 100644 index 0000000000..54a4b46b3b --- /dev/null +++ b/src/p11tool-args.h.bak @@ -0,0 +1,341 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (p11tool-args.h) + * + * It has been AutoGen-ed + * From the definitions p11tool-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the p11tool author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The p11tool program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * p11tool is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * p11tool is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ +/** + * This file contains the programmatic interface to the Automated + * Options generated for the p11tool program. + * These macros are documented in the AutoGen info file in the + * "AutoOpts" chapter. Please refer to that doc for usage help. + */ +#ifndef AUTOOPTS_P11TOOL_ARGS_H_GUARD +#define AUTOOPTS_P11TOOL_ARGS_H_GUARD 1 +#include "config.h" +#include <autoopts/options.h> + +/** + * Ensure that the library used for compiling this generated header is at + * least as new as the version current when the header template was released + * (not counting patch version increments). Also ensure that the oldest + * tolerable version is at least as old as what was current when the header + * template was released. + */ +#define AO_TEMPLATE_VERSION 167937 +#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ + || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) +# error option template version mismatches autoopts/options.h header + Choke Me. +#endif + +/** + * Enumeration of each option type for p11tool + */ +typedef enum { + INDEX_OPT_LIST_TOKENS = 1, + INDEX_OPT_LIST_TOKEN_URLS = 2, + INDEX_OPT_LIST_MECHANISMS = 3, + INDEX_OPT_INITIALIZE = 4, + INDEX_OPT_INITIALIZE_PIN = 5, + INDEX_OPT_INITIALIZE_SO_PIN = 6, + INDEX_OPT_SET_PIN = 7, + INDEX_OPT_SET_SO_PIN = 8, + INDEX_OPT_LIST_ALL = 10, + INDEX_OPT_LIST_ALL_CERTS = 11, + INDEX_OPT_LIST_CERTS = 12, + INDEX_OPT_LIST_ALL_PRIVKEYS = 13, + INDEX_OPT_LIST_PRIVKEYS = 14, + INDEX_OPT_LIST_KEYS = 15, + INDEX_OPT_LIST_ALL_TRUSTED = 16, + INDEX_OPT_EXPORT = 17, + INDEX_OPT_EXPORT_STAPLED = 18, + INDEX_OPT_EXPORT_CHAIN = 19, + INDEX_OPT_EXPORT_PUBKEY = 20, + INDEX_OPT_INFO = 21, + INDEX_OPT_TRUSTED = 22, + INDEX_OPT_DISTRUSTED = 23, + INDEX_OPT_GENERATE_RSA = 25, + INDEX_OPT_GENERATE_DSA = 26, + INDEX_OPT_GENERATE_ECC = 27, + INDEX_OPT_BITS = 28, + INDEX_OPT_CURVE = 29, + INDEX_OPT_SEC_PARAM = 30, + INDEX_OPT_SET_ID = 32, + INDEX_OPT_SET_LABEL = 33, + INDEX_OPT_WRITE = 34, + INDEX_OPT_DELETE = 35, + INDEX_OPT_LABEL = 36, + INDEX_OPT_ID = 37, + INDEX_OPT_MARK_WRAP = 38, + INDEX_OPT_MARK_TRUSTED = 39, + INDEX_OPT_MARK_DISTRUSTED = 40, + INDEX_OPT_MARK_DECRYPT = 41, + INDEX_OPT_MARK_SIGN = 42, + INDEX_OPT_MARK_CA = 43, + INDEX_OPT_MARK_PRIVATE = 44, + INDEX_OPT_CA = 45, + INDEX_OPT_PRIVATE = 46, + INDEX_OPT_SECRET_KEY = 47, + INDEX_OPT_LOAD_PRIVKEY = 48, + INDEX_OPT_LOAD_PUBKEY = 49, + INDEX_OPT_LOAD_CERTIFICATE = 50, + INDEX_OPT_DEBUG = 52, + INDEX_OPT_OUTFILE = 53, + INDEX_OPT_LOGIN = 54, + INDEX_OPT_SO_LOGIN = 55, + INDEX_OPT_ADMIN_LOGIN = 56, + INDEX_OPT_TEST_SIGN = 57, + INDEX_OPT_GENERATE_RANDOM = 58, + INDEX_OPT_PKCS8 = 59, + INDEX_OPT_INDER = 60, + INDEX_OPT_INRAW = 61, + INDEX_OPT_OUTDER = 62, + INDEX_OPT_OUTRAW = 63, + INDEX_OPT_PROVIDER = 64, + INDEX_OPT_DETAILED_URL = 65, + INDEX_OPT_ONLY_URLS = 66, + INDEX_OPT_BATCH = 67, + INDEX_OPT_VERSION = 68, + INDEX_OPT_HELP = 69, + INDEX_OPT_MORE_HELP = 70 +} teOptIndex; +/** count of all options for p11tool */ +#define OPTION_CT 71 +/** p11tool version */ +#define P11TOOL_VERSION "@VERSION@" +/** Full p11tool version text */ +#define P11TOOL_FULL_VERSION "p11tool @VERSION@" + +/** + * Interface defines for all options. Replace "n" with the UPPER_CASED + * option name (as in the teOptIndex enumeration above). + * e.g. HAVE_OPT(TOKEN_RELATED_OPTIONS) + */ +#define DESC(n) (p11toolOptions.pOptDesc[INDEX_OPT_## n]) +/** 'true' if an option has been specified in any way */ +#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) +/** The string argument to an option. The argument type must be \"string\". */ +#define OPT_ARG(n) (DESC(n).optArg.argString) +/** Mask the option state revealing how an option was specified. + * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET, + * \a OPTST_DEFINED, \a OPTST_RESET or zero. + */ +#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) +/** Count of option's occurrances *on the command line*. */ +#define COUNT_OPT(n) (DESC(n).optOccCt) +/** mask of \a OPTST_SET and \a OPTST_DEFINED. */ +#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) +/** 'true' if \a HAVE_OPT would yield 'false'. */ +#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) +/** 'true' if OPTST_DISABLED bit not set. */ +#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) +/** number of stacked option arguments. + * Valid only for stacked option arguments. */ +#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) +/** stacked argument vector. + * Valid only for stacked option arguments. */ +#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) +/** Reset an option. */ +#define CLEAR_OPT(n) STMTS( \ + DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + DESC(n).fOptState |= OPTST_DISABLED; \ + DESC(n).optCookie = NULL ) +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Enumeration of p11tool exit codes + */ +typedef enum { + P11TOOL_EXIT_SUCCESS = 0, + P11TOOL_EXIT_FAILURE = 1, + P11TOOL_EXIT_USAGE_ERROR = 64, + P11TOOL_EXIT_LIBOPTS_FAILURE = 70 +} p11tool_exit_code_t; +/** + * Interface defines for specific options. + * @{ + */ +#define VALUE_OPT_LIST_TOKENS 0x1001 +#define VALUE_OPT_LIST_TOKEN_URLS 0x1002 +#define VALUE_OPT_LIST_MECHANISMS 0x1003 +#define VALUE_OPT_INITIALIZE 0x1004 +#define VALUE_OPT_INITIALIZE_PIN 0x1005 +#define VALUE_OPT_INITIALIZE_SO_PIN 0x1006 +#define VALUE_OPT_SET_PIN 0x1007 +#define VALUE_OPT_SET_SO_PIN 0x1008 +#define VALUE_OPT_LIST_ALL 0x1009 +#define VALUE_OPT_LIST_ALL_CERTS 0x100A +#define VALUE_OPT_LIST_CERTS 0x100B +#define VALUE_OPT_LIST_ALL_PRIVKEYS 0x100C +#define VALUE_OPT_LIST_PRIVKEYS 0x100D +#define VALUE_OPT_LIST_KEYS 0x100E +#define VALUE_OPT_LIST_ALL_TRUSTED 0x100F +#define VALUE_OPT_EXPORT 0x1010 +#define VALUE_OPT_EXPORT_STAPLED 0x1011 +#define VALUE_OPT_EXPORT_CHAIN 0x1012 +#define VALUE_OPT_EXPORT_PUBKEY 0x1013 +#define VALUE_OPT_INFO 0x1014 +#define VALUE_OPT_TRUSTED 0x1015 +#define VALUE_OPT_DISTRUSTED 0x1016 +#define VALUE_OPT_GENERATE_RSA 0x1017 +#define VALUE_OPT_GENERATE_DSA 0x1018 +#define VALUE_OPT_GENERATE_ECC 0x1019 +#define VALUE_OPT_BITS 0x101A + +#define OPT_VALUE_BITS (DESC(BITS).optArg.argInt) +#define VALUE_OPT_CURVE 0x101B +#define VALUE_OPT_SEC_PARAM 0x101C +#define VALUE_OPT_SET_ID 0x101D +#define VALUE_OPT_SET_LABEL 0x101E +#define VALUE_OPT_WRITE 0x101F +#define VALUE_OPT_DELETE 0x1020 +#define VALUE_OPT_LABEL 0x1021 +#define VALUE_OPT_ID 0x1022 +#define VALUE_OPT_MARK_WRAP 0x1023 +#define VALUE_OPT_MARK_TRUSTED 0x1024 +#define VALUE_OPT_MARK_DISTRUSTED 0x1025 +#define VALUE_OPT_MARK_DECRYPT 0x1026 +#define VALUE_OPT_MARK_SIGN 0x1027 +#define VALUE_OPT_MARK_CA 0x1028 +#define VALUE_OPT_MARK_PRIVATE 0x1029 +#define VALUE_OPT_CA 0x102A +#define VALUE_OPT_PRIVATE 0x102B +#define VALUE_OPT_SECRET_KEY 0x102C +#define VALUE_OPT_LOAD_PRIVKEY 0x102D +#define VALUE_OPT_LOAD_PUBKEY 0x102E +#define VALUE_OPT_LOAD_CERTIFICATE 0x102F +#define VALUE_OPT_DEBUG 'd' + +#define OPT_VALUE_DEBUG (DESC(DEBUG).optArg.argInt) +#define VALUE_OPT_OUTFILE 0x1030 +#define VALUE_OPT_LOGIN 0x1031 +#define VALUE_OPT_SO_LOGIN 0x1032 +#define VALUE_OPT_ADMIN_LOGIN 0x1033 +#define VALUE_OPT_TEST_SIGN 0x1034 +#define VALUE_OPT_GENERATE_RANDOM 0x1035 + +#define OPT_VALUE_GENERATE_RANDOM (DESC(GENERATE_RANDOM).optArg.argInt) +#define VALUE_OPT_PKCS8 '8' +#define VALUE_OPT_INDER 0x1036 +#define VALUE_OPT_INRAW 0x1037 +#define VALUE_OPT_OUTDER 0x1038 +#define VALUE_OPT_OUTRAW 0x1039 +#define VALUE_OPT_PROVIDER 0x103A +#define VALUE_OPT_DETAILED_URL 0x103B +#define VALUE_OPT_ONLY_URLS 0x103C +#define VALUE_OPT_BATCH 0x103D +/** option flag (value) for help-value option */ +#define VALUE_OPT_HELP 'h' +/** option flag (value) for more-help-value option */ +#define VALUE_OPT_MORE_HELP '!' +/** option flag (value) for version-value option */ +#define VALUE_OPT_VERSION 'v' +/* + * Interface defines not associated with particular options + */ +#define ERRSKIP_OPTERR STMTS(p11toolOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(p11toolOptions.fOptSet |= OPTPROC_ERRSTOP) +#define RESTART_OPT(n) STMTS( \ + p11toolOptions.curOptIdx = (n); \ + p11toolOptions.pzCurOpt = NULL ) +#define START_OPT RESTART_OPT(1) +#define USAGE(c) (*p11toolOptions.pUsageProc)(&p11toolOptions, c) + +#ifdef __cplusplus +extern "C" { +#endif +/* + * global exported definitions + */ +#include <gettext.h> + + +/* * * * * * + * + * Declare the p11tool option descriptor. + */ +extern tOptions p11toolOptions; + +#if defined(ENABLE_NLS) +# ifndef _ +# include <stdio.h> +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include <libintl.h> +# endif + +# ifndef ATTRIBUTE_FORMAT_ARG +# define ATTRIBUTE_FORMAT_ARG(_a) +# endif + +static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1); +static inline char* aoGetsText(char const* pz) { + if (pz == NULL) return NULL; + return (char*)gettext(pz); +} +# define _(s) aoGetsText(s) +# endif /* _() */ + +# define OPT_NO_XLAT_CFG_NAMES STMTS(p11toolOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT_CFG;) +# define OPT_NO_XLAT_OPT_NAMES STMTS(p11toolOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) + +# define OPT_XLAT_CFG_NAMES STMTS(p11toolOptions.fOptSet &= \ + ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) +# define OPT_XLAT_OPT_NAMES STMTS(p11toolOptions.fOptSet &= \ + ~OPTPROC_NXLAT_OPT;) + +#else /* ENABLE_NLS */ +# define OPT_NO_XLAT_CFG_NAMES +# define OPT_NO_XLAT_OPT_NAMES + +# define OPT_XLAT_CFG_NAMES +# define OPT_XLAT_OPT_NAMES + +# ifndef _ +# define _(_s) _s +# endif +#endif /* ENABLE_NLS */ + +#ifdef __cplusplus +} +#endif +#endif /* AUTOOPTS_P11TOOL_ARGS_H_GUARD */ + +/* p11tool-args.h ends here */ diff --git a/src/psktool-args.c.bak b/src/psktool-args.c.bak new file mode 100644 index 0000000000..7038f99c6e --- /dev/null +++ b/src/psktool-args.c.bak @@ -0,0 +1,969 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (psktool-args.c) + * + * It has been AutoGen-ed + * From the definitions psktool-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the psktool author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The psktool program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * psktool is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * psktool is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "psktool-args.h" +#include <sys/types.h> + +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> + +#ifdef __cplusplus +extern "C" { +#endif +extern FILE * option_usage_fp; +#define zCopyright (psktool_opt_strs+0) +#define zLicenseDescrip (psktool_opt_strs+288) + + +#ifndef NULL +# define NULL 0 +#endif + +/** + * static const strings for psktool options + */ +static char const psktool_opt_strs[1495] = +/* 0 */ "psktool @VERSION@\n" + "Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n" + "This is free software. It is licensed for use, modification and\n" + "redistribution under the terms of the GNU General Public License,\n" + "version 3 or later <http://gnu.org/licenses/gpl.html>\n\0" +/* 288 */ "psktool is free software: you can redistribute it and/or modify it under\n" + "the terms of the GNU General Public License as published by the Free\n" + "Software Foundation, either version 3 of the License, or (at your option)\n" + "any later version.\n\n" + "psktool is distributed in the hope that it will be useful, but WITHOUT ANY\n" + "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n" + "FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n" + "details.\n\n" + "You should have received a copy of the GNU General Public License along\n" + "with this program. If not, see <http://www.gnu.org/licenses/>.\n\0" +/* 891 */ "Enable debugging\0" +/* 908 */ "DEBUG\0" +/* 914 */ "debug\0" +/* 920 */ "specify the key size in bytes\0" +/* 950 */ "KEYSIZE\0" +/* 958 */ "keysize\0" +/* 966 */ "specify a username\0" +/* 985 */ "USERNAME\0" +/* 994 */ "username\0" +/* 1003 */ "specify a password file\0" +/* 1027 */ "PASSWD\0" +/* 1034 */ "passwd\0" +/* 1041 */ "display extended usage information and exit\0" +/* 1085 */ "help\0" +/* 1090 */ "extended usage information passed thru pager\0" +/* 1135 */ "more-help\0" +/* 1145 */ "output version information and exit\0" +/* 1181 */ "version\0" +/* 1189 */ "PSKTOOL\0" +/* 1197 */ "psktool - GnuTLS PSK tool\n" + "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0" +/* 1281 */ "@PACKAGE_BUGREPORT@\0" +/* 1301 */ "\n\0" +/* 1303 */ "Program that generates random keys for use with TLS-PSK. The keys are\n" + "stored in hexadecimal format in a key file.\n\0" +/* 1419 */ "psktool @VERSION@\0" +/* 1437 */ "psktool [options]\n" + "psktool --help for usage instructions.\n"; + +/** + * debug option description: + */ +/** Descriptive text for the debug option */ +#define DEBUG_DESC (psktool_opt_strs+891) +/** Upper-cased name for the debug option */ +#define DEBUG_NAME (psktool_opt_strs+908) +/** Name string for the debug option */ +#define DEBUG_name (psktool_opt_strs+914) +/** Compiled in flag settings for the debug option */ +#define DEBUG_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * keysize option description: + */ +/** Descriptive text for the keysize option */ +#define KEYSIZE_DESC (psktool_opt_strs+920) +/** Upper-cased name for the keysize option */ +#define KEYSIZE_NAME (psktool_opt_strs+950) +/** Name string for the keysize option */ +#define KEYSIZE_name (psktool_opt_strs+958) +/** Compiled in flag settings for the keysize option */ +#define KEYSIZE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * username option description: + */ +/** Descriptive text for the username option */ +#define USERNAME_DESC (psktool_opt_strs+966) +/** Upper-cased name for the username option */ +#define USERNAME_NAME (psktool_opt_strs+985) +/** Name string for the username option */ +#define USERNAME_name (psktool_opt_strs+994) +/** Compiled in flag settings for the username option */ +#define USERNAME_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * passwd option description: + */ +/** Descriptive text for the passwd option */ +#define PASSWD_DESC (psktool_opt_strs+1003) +/** Upper-cased name for the passwd option */ +#define PASSWD_NAME (psktool_opt_strs+1027) +/** Name string for the passwd option */ +#define PASSWD_name (psktool_opt_strs+1034) +/** Compiled in flag settings for the passwd option */ +#define PASSWD_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/* + * Help/More_Help/Version option descriptions: + */ +#define HELP_DESC (psktool_opt_strs+1041) +#define HELP_name (psktool_opt_strs+1085) +#ifdef HAVE_WORKING_FORK +#define MORE_HELP_DESC (psktool_opt_strs+1090) +#define MORE_HELP_name (psktool_opt_strs+1135) +#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +#define MORE_HELP_DESC HELP_DESC +#define MORE_HELP_name HELP_name +#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#endif +#ifdef NO_OPTIONAL_OPT_ARGS +# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ + OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) +#endif +#define VER_DESC (psktool_opt_strs+1145) +#define VER_name (psktool_opt_strs+1181) +/** + * Declare option callback procedures + */ +extern tOptProc + optionBooleanVal, optionNestedVal, optionNumericVal, + optionPagedUsage, optionPrintVersion, optionResetOpt, + optionStackArg, optionTimeDate, optionTimeVal, + optionUnstackArg, optionVendorOption; +static tOptProc + doOptDebug, doOptKeysize, doUsageOpt; +#define VER_PROC optionPrintVersion + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the psktool Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the psktool program responds to. + */ +static tOptDesc optDesc[OPTION_CT] = { + { /* entry idx, value */ 0, VALUE_OPT_DEBUG, + /* equiv idx, value */ 0, VALUE_OPT_DEBUG, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DEBUG_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --debug */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptDebug, + /* desc, NAME, name */ DEBUG_DESC, DEBUG_NAME, DEBUG_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 1, VALUE_OPT_KEYSIZE, + /* equiv idx, value */ 1, VALUE_OPT_KEYSIZE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ KEYSIZE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --keysize */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptKeysize, + /* desc, NAME, name */ KEYSIZE_DESC, KEYSIZE_NAME, KEYSIZE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 2, VALUE_OPT_USERNAME, + /* equiv idx, value */ 2, VALUE_OPT_USERNAME, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ USERNAME_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --username */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ USERNAME_DESC, USERNAME_NAME, USERNAME_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 3, VALUE_OPT_PASSWD, + /* equiv idx, value */ 3, VALUE_OPT_PASSWD, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PASSWD_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --passwd */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PASSWD_DESC, PASSWD_NAME, PASSWD_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VER_FLAGS, AOUSE_VERSION, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ VER_PROC, + /* desc, NAME, name */ VER_DESC, NULL, VER_name, + /* disablement strs */ NULL, NULL }, + + + + { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doUsageOpt, + /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionPagedUsage, + /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, + /* disablement strs */ NULL, NULL } +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** Reference to the upper cased version of psktool. */ +#define zPROGNAME (psktool_opt_strs+1189) +/** Reference to the title line for psktool usage. */ +#define zUsageTitle (psktool_opt_strs+1197) +/** There is no psktool configuration file. */ +#define zRcName NULL +/** There are no directories to search for psktool config files. */ +#define apzHomeList NULL +/** The psktool program bug email address. */ +#define zBugsAddr (psktool_opt_strs+1281) +/** Clarification/explanation of what psktool does. */ +#define zExplain (psktool_opt_strs+1301) +/** Extra detail explaining what psktool does. */ +#define zDetail (psktool_opt_strs+1303) +/** The full version string for psktool. */ +#define zFullVersion (psktool_opt_strs+1419) +/* extracted from optcode.tlib near line 364 */ + +#if defined(ENABLE_NLS) +# define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT + static tOptionXlateProc translate_option_strings; +#else +# define OPTPROC_BASE OPTPROC_NONE +# define translate_option_strings NULL +#endif /* ENABLE_NLS */ + +#define psktool_full_usage (NULL) +#define psktool_short_usage (psktool_opt_strs+1437) + +#endif /* not defined __doxygen__ */ + +/* + * Create the static procedure(s) declared above. + */ +/** + * The callout function that invokes the optionUsage function. + * + * @param[in] opts the AutoOpts option description structure + * @param[in] od the descriptor for the "help" (usage) option. + * @noreturn + */ +static void +doUsageOpt(tOptions * opts, tOptDesc * od) +{ + int ex_code; + ex_code = PSKTOOL_EXIT_SUCCESS; + optionUsage(&psktoolOptions, ex_code); + /* NOTREACHED */ + exit(PSKTOOL_EXIT_FAILURE); + (void)opts; + (void)od; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the debug option. + * Specifies the debug level. + * @param[in] pOptions the psktool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptDebug(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[1] = { + { 0 , 9999 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 1; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + + emit_ranges: +optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the keysize option. + * + * @param[in] pOptions the psktool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptKeysize(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[1] = { + { 0 , 512 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 1; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + + emit_ranges: +optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); +} +/* extracted from optmain.tlib near line 1250 */ + +/** + * The directory containing the data associated with psktool. + */ +#ifndef PKGDATADIR +# define PKGDATADIR "" +#endif + +/** + * Information about the person or institution that packaged psktool + * for the current distribution. + */ +#ifndef WITH_PACKAGER +# define psktool_packager_info NULL +#else +/** Packager information for psktool. */ +static char const psktool_packager_info[] = + "Packaged by " WITH_PACKAGER + +# ifdef WITH_PACKAGER_VERSION + " ("WITH_PACKAGER_VERSION")" +# endif + +# ifdef WITH_PACKAGER_BUG_REPORTS + "\nReport psktool bugs to " WITH_PACKAGER_BUG_REPORTS +# endif + "\n"; +#endif +#ifndef __doxygen__ + +#endif /* __doxygen__ */ +/** + * The option definitions for psktool. The one structure that + * binds them all. + */ +tOptions psktoolOptions = { + OPTIONS_STRUCT_VERSION, + 0, NULL, /* original argc + argv */ + ( OPTPROC_BASE + + OPTPROC_ERRSTOP + + OPTPROC_SHORTOPT + + OPTPROC_LONGOPT + + OPTPROC_NO_REQ_OPT + + OPTPROC_NO_ARGS + + OPTPROC_GNUUSAGE + + OPTPROC_MISUSE ), + 0, NULL, /* current option index, current option */ + NULL, NULL, zPROGNAME, + zRcName, zCopyright, zLicenseDescrip, + zFullVersion, apzHomeList, zUsageTitle, + zExplain, zDetail, optDesc, + zBugsAddr, /* address to send bugs to */ + NULL, NULL, /* extensions/saved state */ + optionUsage, /* usage procedure */ + translate_option_strings, /* translation procedure */ + /* + * Indexes to special options + */ + { INDEX_OPT_MORE_HELP, /* more-help option index */ + NO_EQUIVALENT, /* save option index */ + NO_EQUIVALENT, /* '-#' option index */ + NO_EQUIVALENT /* index of default opt */ + }, + 7 /* full option count */, 4 /* user option count */, + psktool_full_usage, psktool_short_usage, + NULL, NULL, + PKGDATADIR, psktool_packager_info +}; + +#if ENABLE_NLS +/** + * This code is designed to translate translatable option text for the + * psktool program. These translations happen upon entry + * to optionProcess(). + */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#ifdef HAVE_DCGETTEXT +# include <gettext.h> +#endif +#include <autoopts/usage-txt.h> + +static char * AO_gettext(char const * pz); +static void coerce_it(void ** s); + +/** + * AutoGen specific wrapper function for gettext. It relies on the macro _() + * to convert from English to the target language, then strdup-duplicates the + * result string. It tries the "libopts" domain first, then whatever has been + * set via the \a textdomain(3) call. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * +AO_gettext(char const * pz) +{ + char * res; + if (pz == NULL) + return NULL; +#ifdef HAVE_DCGETTEXT + /* + * While processing the option_xlateable_txt data, try to use the + * "libopts" domain. Once we switch to the option descriptor data, + * do *not* use that domain. + */ + if (option_xlateable_txt.field_ct != 0) { + res = dgettext("libopts", pz); + if (res == pz) + res = (char *)VOIDP(_(pz)); + } else + res = (char *)VOIDP(_(pz)); +#else + res = (char *)VOIDP(_(pz)); +#endif + if (res == pz) + return res; + res = strdup(res); + if (res == NULL) { + fputs(_("No memory for duping translated strings\n"), stderr); + exit(PSKTOOL_EXIT_FAILURE); + } + return res; +} + +/** + * All the pointers we use are marked "* const", but they are stored in + * writable memory. Coerce the mutability and set the pointer. + */ +static void coerce_it(void ** s) { *s = AO_gettext(*s); +} + +/** + * Translate all the translatable strings in the psktoolOptions + * structure defined above. This is done only once. + */ +static void +translate_option_strings(void) +{ + tOptions * const opts = &psktoolOptions; + + /* + * Guard against re-translation. It won't work. The strings will have + * been changed by the first pass through this code. One shot only. + */ + if (option_xlateable_txt.field_ct != 0) { + /* + * Do the translations. The first pointer follows the field count + * field. The field count field is the size of a pointer. + */ + char ** ppz = (char**)VOIDP(&(option_xlateable_txt)); + int ix = option_xlateable_txt.field_ct; + + do { + ppz++; /* skip over field_ct */ + *ppz = AO_gettext(*ppz); + } while (--ix > 0); + /* prevent re-translation and disable "libopts" domain lookup */ + option_xlateable_txt.field_ct = 0; + + coerce_it(VOIDP(&(opts->pzCopyright))); + coerce_it(VOIDP(&(opts->pzCopyNotice))); + coerce_it(VOIDP(&(opts->pzFullVersion))); + coerce_it(VOIDP(&(opts->pzUsageTitle))); + coerce_it(VOIDP(&(opts->pzExplain))); + coerce_it(VOIDP(&(opts->pzDetail))); + { + tOptDesc * od = opts->pOptDesc; + for (ix = opts->optCt; ix > 0; ix--, od++) + coerce_it(VOIDP(&(od->pzText))); + } + } +} +#endif /* ENABLE_NLS */ + +#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT +/** I18N function strictly for xgettext. Do not compile. */ +static void bogus_function(void) { + /* TRANSLATORS: + + The following dummy function was crated solely so that xgettext can + extract the correct strings. These strings are actually referenced + by a field name in the psktoolOptions structure noted in the + comments below. The literal text is defined in psktool_opt_strs. + + NOTE: the strings below are segmented with respect to the source string + psktool_opt_strs. The strings above are handed off for translation + at run time a paragraph at a time. Consequently, they are presented here + for translation a paragraph at a time. + + ALSO: often the description for an option will reference another option + by name. These are set off with apostrophe quotes (I hope). Do not + translate option names. + */ + /* referenced via psktoolOptions.pzCopyright */ + puts(_("psktool @VERSION@\n\ +Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n\ +This is free software. It is licensed for use, modification and\n\ +redistribution under the terms of the GNU General Public License,\n\ +version 3 or later <http://gnu.org/licenses/gpl.html>\n")); + + /* referenced via psktoolOptions.pzCopyNotice */ + puts(_("psktool is free software: you can redistribute it and/or modify it under\n\ +the terms of the GNU General Public License as published by the Free\n\ +Software Foundation, either version 3 of the License, or (at your option)\n\ +any later version.\n\n")); + puts(_("psktool is distributed in the hope that it will be useful, but WITHOUT ANY\n\ +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n\ +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n\ +details.\n\n")); + puts(_("You should have received a copy of the GNU General Public License along\n\ +with this program. If not, see <http://www.gnu.org/licenses/>.\n")); + + /* referenced via psktoolOptions.pOptDesc->pzText */ + puts(_("Enable debugging")); + + /* referenced via psktoolOptions.pOptDesc->pzText */ + puts(_("specify the key size in bytes")); + + /* referenced via psktoolOptions.pOptDesc->pzText */ + puts(_("specify a username")); + + /* referenced via psktoolOptions.pOptDesc->pzText */ + puts(_("specify a password file")); + + /* referenced via psktoolOptions.pOptDesc->pzText */ + puts(_("display extended usage information and exit")); + + /* referenced via psktoolOptions.pOptDesc->pzText */ + puts(_("extended usage information passed thru pager")); + + /* referenced via psktoolOptions.pOptDesc->pzText */ + puts(_("output version information and exit")); + + /* referenced via psktoolOptions.pzUsageTitle */ + puts(_("psktool - GnuTLS PSK tool\n\ +Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n")); + + /* referenced via psktoolOptions.pzExplain */ + puts(_("\n")); + + /* referenced via psktoolOptions.pzDetail */ + puts(_("Program that generates random keys for use with TLS-PSK. The keys are\n\ +stored in hexadecimal format in a key file.\n")); + + /* referenced via psktoolOptions.pzFullVersion */ + puts(_("psktool @VERSION@")); + + /* referenced via psktoolOptions.pzFullUsage */ + puts(_("<<<NOT-FOUND>>>")); + + /* referenced via psktoolOptions.pzShortUsage */ + puts(_("psktool [options]\n\ +psktool --help for usage instructions.\n")); + /* LIBOPTS-MESSAGES: */ +#line 67 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 93 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 53 "../init.c" + puts(_("AutoOpts function called without option descriptor\n")); +#line 86 "../init.c" + puts(_("\tThis exceeds the compiled library version: ")); +#line 84 "../init.c" + puts(_("Automated Options Processing Error!\n" + "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); +#line 80 "../autoopts.c" + puts(_("realloc of %d bytes at 0x%p failed\n")); +#line 88 "../init.c" + puts(_("\tThis is less than the minimum library version: ")); +#line 121 "../version.c" + puts(_("Automated Options version %s\n" + "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); +#line 87 "../makeshell.c" + puts(_("(AutoOpts bug): %s.\n")); +#line 90 "../reset.c" + puts(_("optionResetOpt() called, but reset-option not configured")); +#line 295 "../usage.c" + puts(_("could not locate the 'help' option")); +#line 336 "../autoopts.c" + puts(_("optionProcess() was called with invalid data")); +#line 751 "../usage.c" + puts(_("invalid argument type specified")); +#line 598 "../find.c" + puts(_("defaulted to option with optional arg")); +#line 76 "../alias.c" + puts(_("aliasing option is out of range.")); +#line 235 "../enum.c" + puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); +#line 108 "../find.c" + puts(_(" The following options match:\n")); +#line 293 "../find.c" + puts(_("%s: ambiguous option name: %s (matches %d options)\n")); +#line 161 "../check.c" + puts(_("%s: Command line arguments required\n")); +#line 43 "../alias.c" + puts(_("%d %s%s options allowed\n")); +#line 94 "../makeshell.c" + puts(_("%s error %d (%s) calling %s for '%s'\n")); +#line 306 "../makeshell.c" + puts(_("interprocess pipe")); +#line 168 "../version.c" + puts(_("error: version option argument '%c' invalid. Use:\n" + "\t'v' - version only\n" + "\t'c' - version and copyright\n" + "\t'n' - version and full copyright notice\n")); +#line 58 "../check.c" + puts(_("%s error: the '%s' and '%s' options conflict\n")); +#line 217 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 430 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 38 "../alias.c" + puts(_("-equivalence")); +#line 469 "../find.c" + puts(_("%s: illegal option -- %c\n")); +#line 110 "../reset.c" + puts(_("%s: illegal option -- %c\n")); +#line 271 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 755 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 118 "../reset.c" + puts(_("%s: illegal option -- %s\n")); +#line 335 "../find.c" + puts(_("%s: unknown vendor extension option -- %s\n")); +#line 160 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 170 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 750 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 1084 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 385 "../find.c" + puts(_("%s: invalid option name: %s\n")); +#line 527 "../find.c" + puts(_("%s: The '%s' option requires an argument.\n")); +#line 156 "../autoopts.c" + puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" + "\t'%s' and '%s'.")); +#line 94 "../check.c" + puts(_("%s error: The %s option is required\n")); +#line 632 "../find.c" + puts(_("%s: The '%s' option cannot have an argument.\n")); +#line 151 "../check.c" + puts(_("%s: Command line arguments are not allowed.\n")); +#line 536 "../save.c" + puts(_("error %d (%s) creating %s\n")); +#line 235 "../enum.c" + puts(_("%s error: '%s' does not match any %s keywords.\n")); +#line 93 "../reset.c" + puts(_("%s error: The '%s' option requires an argument.\n")); +#line 186 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 239 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 143 "../restore.c" + puts(_("%s error: no saved option state\n")); +#line 231 "../autoopts.c" + puts(_("'%s' is not a command line option.\n")); +#line 113 "../time.c" + puts(_("%s error: '%s' is not a recognizable date/time.\n")); +#line 131 "../save.c" + puts(_("'%s' not defined\n")); +#line 50 "../time.c" + puts(_("%s error: '%s' is not a recognizable time duration.\n")); +#line 92 "../check.c" + puts(_("%s error: The %s option must appear %d times.\n")); +#line 165 "../numeric.c" + puts(_("%s error: '%s' is not a recognizable number.\n")); +#line 201 "../enum.c" + puts(_("%s error: %s exceeds %s keyword count\n")); +#line 333 "../usage.c" + puts(_("Try '%s %s' for more information.\n")); +#line 45 "../alias.c" + puts(_("one %s%s option allowed\n")); +#line 208 "../makeshell.c" + puts(_("standard output")); +#line 943 "../makeshell.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard output")); +#line 418 "../usage.c" + puts(_("standard output")); +#line 628 "../usage.c" + puts(_("standard output")); +#line 175 "../version.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard error")); +#line 418 "../usage.c" + puts(_("standard error")); +#line 628 "../usage.c" + puts(_("standard error")); +#line 175 "../version.c" + puts(_("standard error")); +#line 208 "../makeshell.c" + puts(_("write")); +#line 943 "../makeshell.c" + puts(_("write")); +#line 276 "../usage.c" + puts(_("write")); +#line 417 "../usage.c" + puts(_("write")); +#line 627 "../usage.c" + puts(_("write")); +#line 174 "../version.c" + puts(_("write")); +#line 60 "../numeric.c" + puts(_("%s error: %s option value %ld is out of range.\n")); +#line 44 "../check.c" + puts(_("%s error: %s option requires the %s option\n")); +#line 130 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 185 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 238 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 257 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 535 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); + /* END-LIBOPTS-MESSAGES */ + + /* USAGE-TEXT: */ +#line 876 "../usage.c" + puts(_("\t\t\t\t- an alternate for '%s'\n")); +#line 1151 "../usage.c" + puts(_("Version, usage and configuration options:")); +#line 927 "../usage.c" + puts(_("\t\t\t\t- default option for unnamed options\n")); +#line 840 "../usage.c" + puts(_("\t\t\t\t- disabled as '--%s'\n")); +#line 1120 "../usage.c" + puts(_(" --- %-14s %s\n")); +#line 1118 "../usage.c" + puts(_("This option has been disabled")); +#line 867 "../usage.c" + puts(_("\t\t\t\t- enabled by default\n")); +#line 40 "../alias.c" + puts(_("%s error: only ")); +#line 1197 "../usage.c" + puts(_(" - examining environment variables named %s_*\n")); +#line 168 "../file.c" + puts(_("\t\t\t\t- file must not pre-exist\n")); +#line 172 "../file.c" + puts(_("\t\t\t\t- file must pre-exist\n")); +#line 383 "../usage.c" + puts(_("Options are specified by doubled hyphens and their name or by a single\n" + "hyphen and the flag character.\n")); +#line 921 "../makeshell.c" + puts(_("\n" + "= = = = = = = =\n\n" + "This incarnation of genshell will produce\n" + "a shell script to parse the options for %s:\n\n")); +#line 167 "../enum.c" + puts(_(" or an integer mask with any of the lower %d bits set\n")); +#line 900 "../usage.c" + puts(_("\t\t\t\t- is a set membership option\n")); +#line 921 "../usage.c" + puts(_("\t\t\t\t- must appear between %d and %d times\n")); +#line 385 "../usage.c" + puts(_("Options are specified by single or double hyphens and their name.\n")); +#line 907 "../usage.c" + puts(_("\t\t\t\t- may appear multiple times\n")); +#line 894 "../usage.c" + puts(_("\t\t\t\t- may not be preset\n")); +#line 1312 "../usage.c" + puts(_(" Arg Option-Name Description\n")); +#line 1248 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1306 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1307 "../usage.c" + puts(_(" %3s %s")); +#line 1313 "../usage.c" + puts(_(" %3s %s")); +#line 390 "../usage.c" + puts(_("The '-#<number>' option may omit the hash char\n")); +#line 386 "../usage.c" + puts(_("All arguments are named options.\n")); +#line 974 "../usage.c" + puts(_(" - reading file %s")); +#line 412 "../usage.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 100 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 129 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 906 "../usage.c" + puts(_("\t\t\t\t- may NOT appear - preset only\n")); +#line 947 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 1195 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 685 "../usage.c" + puts(_("prohibits these options:\n")); +#line 680 "../usage.c" + puts(_("prohibits the option '%s'\n")); +#line 81 "../numeric.c" + puts(_("%s%ld to %ld")); +#line 79 "../numeric.c" + puts(_("%sgreater than or equal to %ld")); +#line 75 "../numeric.c" + puts(_("%s%ld exactly")); +#line 68 "../numeric.c" + puts(_("%sit must lie in one of the ranges:\n")); +#line 68 "../numeric.c" + puts(_("%sit must be in the range:\n")); +#line 88 "../numeric.c" + puts(_(", or\n")); +#line 66 "../numeric.c" + puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); +#line 77 "../numeric.c" + puts(_("%sless than or equal to %ld")); +#line 393 "../usage.c" + puts(_("Operands and options may be intermixed. They will be reordered.\n")); +#line 655 "../usage.c" + puts(_("requires the option '%s'\n")); +#line 658 "../usage.c" + puts(_("requires these options:\n")); +#line 1324 "../usage.c" + puts(_(" Arg Option-Name Req? Description\n")); +#line 1318 "../usage.c" + puts(_(" Flg Arg Option-Name Req? Description\n")); +#line 168 "../enum.c" + puts(_("or you may use a numeric representation. Preceding these with a '!'\n" + "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" + "will set them all. Multiple entries may be passed as an option\n" + "argument list.\n")); +#line 913 "../usage.c" + puts(_("\t\t\t\t- may appear up to %d times\n")); +#line 77 "../enum.c" + puts(_("The valid \"%s\" option keywords are:\n")); +#line 1155 "../usage.c" + puts(_("The next option supports vendor supported extra options:")); +#line 776 "../usage.c" + puts(_("These additional options are:")); + /* END-USAGE-TEXT */ +} +#endif /* uncompilable code */ +#ifdef __cplusplus +} +#endif +/* psktool-args.c ends here */ diff --git a/src/psktool-args.h.bak b/src/psktool-args.h.bak new file mode 100644 index 0000000000..9f1811ecde --- /dev/null +++ b/src/psktool-args.h.bak @@ -0,0 +1,221 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (psktool-args.h) + * + * It has been AutoGen-ed + * From the definitions psktool-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the psktool author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The psktool program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * psktool is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * psktool is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ +/** + * This file contains the programmatic interface to the Automated + * Options generated for the psktool program. + * These macros are documented in the AutoGen info file in the + * "AutoOpts" chapter. Please refer to that doc for usage help. + */ +#ifndef AUTOOPTS_PSKTOOL_ARGS_H_GUARD +#define AUTOOPTS_PSKTOOL_ARGS_H_GUARD 1 +#include "config.h" +#include <autoopts/options.h> + +/** + * Ensure that the library used for compiling this generated header is at + * least as new as the version current when the header template was released + * (not counting patch version increments). Also ensure that the oldest + * tolerable version is at least as old as what was current when the header + * template was released. + */ +#define AO_TEMPLATE_VERSION 167937 +#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ + || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) +# error option template version mismatches autoopts/options.h header + Choke Me. +#endif + +/** + * Enumeration of each option type for psktool + */ +typedef enum { + INDEX_OPT_DEBUG = 0, + INDEX_OPT_KEYSIZE = 1, + INDEX_OPT_USERNAME = 2, + INDEX_OPT_PASSWD = 3, + INDEX_OPT_VERSION = 4, + INDEX_OPT_HELP = 5, + INDEX_OPT_MORE_HELP = 6 +} teOptIndex; +/** count of all options for psktool */ +#define OPTION_CT 7 +/** psktool version */ +#define PSKTOOL_VERSION "@VERSION@" +/** Full psktool version text */ +#define PSKTOOL_FULL_VERSION "psktool @VERSION@" + +/** + * Interface defines for all options. Replace "n" with the UPPER_CASED + * option name (as in the teOptIndex enumeration above). + * e.g. HAVE_OPT(DEBUG) + */ +#define DESC(n) (psktoolOptions.pOptDesc[INDEX_OPT_## n]) +/** 'true' if an option has been specified in any way */ +#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) +/** The string argument to an option. The argument type must be \"string\". */ +#define OPT_ARG(n) (DESC(n).optArg.argString) +/** Mask the option state revealing how an option was specified. + * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET, + * \a OPTST_DEFINED, \a OPTST_RESET or zero. + */ +#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) +/** Count of option's occurrances *on the command line*. */ +#define COUNT_OPT(n) (DESC(n).optOccCt) +/** mask of \a OPTST_SET and \a OPTST_DEFINED. */ +#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) +/** 'true' if \a HAVE_OPT would yield 'false'. */ +#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) +/** 'true' if OPTST_DISABLED bit not set. */ +#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) +/** number of stacked option arguments. + * Valid only for stacked option arguments. */ +#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) +/** stacked argument vector. + * Valid only for stacked option arguments. */ +#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) +/** Reset an option. */ +#define CLEAR_OPT(n) STMTS( \ + DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + DESC(n).fOptState |= OPTST_DISABLED; \ + DESC(n).optCookie = NULL ) +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Enumeration of psktool exit codes + */ +typedef enum { + PSKTOOL_EXIT_SUCCESS = 0, + PSKTOOL_EXIT_FAILURE = 1, + PSKTOOL_EXIT_USAGE_ERROR = 64, + PSKTOOL_EXIT_LIBOPTS_FAILURE = 70 +} psktool_exit_code_t; +/** + * Interface defines for specific options. + * @{ + */ +#define VALUE_OPT_DEBUG 'd' + +#define OPT_VALUE_DEBUG (DESC(DEBUG).optArg.argInt) +#define VALUE_OPT_KEYSIZE 's' + +#define OPT_VALUE_KEYSIZE (DESC(KEYSIZE).optArg.argInt) +#define VALUE_OPT_USERNAME 'u' +#define VALUE_OPT_PASSWD 'p' +/** option flag (value) for help-value option */ +#define VALUE_OPT_HELP 'h' +/** option flag (value) for more-help-value option */ +#define VALUE_OPT_MORE_HELP '!' +/** option flag (value) for version-value option */ +#define VALUE_OPT_VERSION 'v' +/* + * Interface defines not associated with particular options + */ +#define ERRSKIP_OPTERR STMTS(psktoolOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(psktoolOptions.fOptSet |= OPTPROC_ERRSTOP) +#define RESTART_OPT(n) STMTS( \ + psktoolOptions.curOptIdx = (n); \ + psktoolOptions.pzCurOpt = NULL ) +#define START_OPT RESTART_OPT(1) +#define USAGE(c) (*psktoolOptions.pUsageProc)(&psktoolOptions, c) + +#ifdef __cplusplus +extern "C" { +#endif +/* + * global exported definitions + */ +#include <gettext.h> + + +/* * * * * * + * + * Declare the psktool option descriptor. + */ +extern tOptions psktoolOptions; + +#if defined(ENABLE_NLS) +# ifndef _ +# include <stdio.h> +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include <libintl.h> +# endif + +# ifndef ATTRIBUTE_FORMAT_ARG +# define ATTRIBUTE_FORMAT_ARG(_a) +# endif + +static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1); +static inline char* aoGetsText(char const* pz) { + if (pz == NULL) return NULL; + return (char*)gettext(pz); +} +# define _(s) aoGetsText(s) +# endif /* _() */ + +# define OPT_NO_XLAT_CFG_NAMES STMTS(psktoolOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT_CFG;) +# define OPT_NO_XLAT_OPT_NAMES STMTS(psktoolOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) + +# define OPT_XLAT_CFG_NAMES STMTS(psktoolOptions.fOptSet &= \ + ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) +# define OPT_XLAT_OPT_NAMES STMTS(psktoolOptions.fOptSet &= \ + ~OPTPROC_NXLAT_OPT;) + +#else /* ENABLE_NLS */ +# define OPT_NO_XLAT_CFG_NAMES +# define OPT_NO_XLAT_OPT_NAMES + +# define OPT_XLAT_CFG_NAMES +# define OPT_XLAT_OPT_NAMES + +# ifndef _ +# define _(_s) _s +# endif +#endif /* ENABLE_NLS */ + +#ifdef __cplusplus +} +#endif +#endif /* AUTOOPTS_PSKTOOL_ARGS_H_GUARD */ + +/* psktool-args.h ends here */ diff --git a/src/serv-args.c.bak b/src/serv-args.c.bak new file mode 100644 index 0000000000..3963eed922 --- /dev/null +++ b/src/serv-args.c.bak @@ -0,0 +1,2280 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (serv-args.c) + * + * It has been AutoGen-ed + * From the definitions serv-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the gnutls-serv author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The gnutls-serv program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * gnutls-serv is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * gnutls-serv is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "serv-args.h" +#include <sys/types.h> + +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> + +#ifdef __cplusplus +extern "C" { +#endif +extern FILE * option_usage_fp; +#define zCopyright (gnutls_serv_opt_strs+0) +#define zLicenseDescrip (gnutls_serv_opt_strs+292) + + +#ifndef NULL +# define NULL 0 +#endif + +/** + * static const strings for gnutls-serv options + */ +static char const gnutls_serv_opt_strs[3374] = +/* 0 */ "gnutls-serv @VERSION@\n" + "Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n" + "This is free software. It is licensed for use, modification and\n" + "redistribution under the terms of the GNU General Public License,\n" + "version 3 or later <http://gnu.org/licenses/gpl.html>\n\0" +/* 292 */ "gnutls-serv is free software: you can redistribute it and/or modify it\n" + "under the terms of the GNU General Public License as published by the Free\n" + "Software Foundation, either version 3 of the License, or (at your option)\n" + "any later version.\n\n" + "gnutls-serv is distributed in the hope that it will be useful, but WITHOUT\n" + "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n" + "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n" + "more details.\n\n" + "You should have received a copy of the GNU General Public License along\n" + "with this program. If not, see <http://www.gnu.org/licenses/>.\n\0" +/* 903 */ "Enable debugging\0" +/* 920 */ "DEBUG\0" +/* 926 */ "debug\0" +/* 932 */ "Server's hostname for server name extension\0" +/* 976 */ "SNI_HOSTNAME\0" +/* 989 */ "sni-hostname\0" +/* 1002 */ "Send fatal alert on sni-hostname mismatch\0" +/* 1044 */ "SNI_HOSTNAME_FATAL\0" +/* 1063 */ "sni-hostname-fatal\0" +/* 1082 */ "Don't accept session tickets\0" +/* 1111 */ "NOTICKET\0" +/* 1120 */ "noticket\0" +/* 1129 */ "Generate Diffie-Hellman parameters\0" +/* 1164 */ "GENERATE\0" +/* 1173 */ "generate\0" +/* 1182 */ "Suppress some messages\0" +/* 1205 */ "QUIET\0" +/* 1211 */ "quiet\0" +/* 1217 */ "Do not use a resumption database\0" +/* 1250 */ "NODB\0" +/* 1255 */ "nodb\0" +/* 1260 */ "Act as an HTTP server\0" +/* 1282 */ "HTTP\0" +/* 1287 */ "http\0" +/* 1292 */ "Act as an Echo server\0" +/* 1314 */ "ECHO\0" +/* 1319 */ "echo\0" +/* 1324 */ "Use DTLS (datagram TLS) over UDP\0" +/* 1357 */ "UDP\0" +/* 1361 */ "udp\0" +/* 1365 */ "Set MTU for datagram TLS\0" +/* 1390 */ "MTU\0" +/* 1394 */ "mtu\0" +/* 1398 */ "Offer SRTP profiles\0" +/* 1418 */ "SRTP_PROFILES\0" +/* 1432 */ "srtp-profiles\0" +/* 1446 */ "Do not request a client certificate\0" +/* 1482 */ "DISABLE_CLIENT_CERT\0" +/* 1502 */ "disable-client-cert\0" +/* 1522 */ "Require a client certificate\0" +/* 1551 */ "REQUIRE_CLIENT_CERT\0" +/* 1571 */ "require-client-cert\0" +/* 1591 */ "If a client certificate is sent then verify it.\0" +/* 1639 */ "VERIFY_CLIENT_CERT\0" +/* 1658 */ "verify-client-cert\0" +/* 1677 */ "Activate heartbeat support\0" +/* 1704 */ "HEARTBEAT\0" +/* 1714 */ "heartbeat\0" +/* 1724 */ "Use DER format for certificates to read from\0" +/* 1769 */ "X509FMTDER\0" +/* 1780 */ "x509fmtder\0" +/* 1791 */ "Priorities string\0" +/* 1809 */ "PRIORITY\0" +/* 1818 */ "priority\0" +/* 1827 */ "DH params file to use\0" +/* 1849 */ "DHPARAMS\0" +/* 1858 */ "dhparams\0" +/* 1867 */ "Certificate file or PKCS #11 URL to use\0" +/* 1907 */ "X509CAFILE\0" +/* 1918 */ "x509cafile\0" +/* 1929 */ "CRL file to use\0" +/* 1945 */ "X509CRLFILE\0" +/* 1957 */ "x509crlfile\0" +/* 1969 */ "PGP Key file to use\0" +/* 1989 */ "PGPKEYFILE\0" +/* 2000 */ "pgpkeyfile\0" +/* 2011 */ "PGP Key ring file to use\0" +/* 2036 */ "PGPKEYRING\0" +/* 2047 */ "pgpkeyring\0" +/* 2058 */ "PGP Public Key (certificate) file to use\0" +/* 2099 */ "PGPCERTFILE\0" +/* 2111 */ "pgpcertfile\0" +/* 2123 */ "X.509 key file or PKCS #11 URL to use\0" +/* 2161 */ "X509KEYFILE\0" +/* 2173 */ "x509keyfile\0" +/* 2185 */ "X.509 Certificate file or PKCS #11 URL to use\0" +/* 2231 */ "X509CERTFILE\0" +/* 2244 */ "x509certfile\0" +/* 2257 */ "Alternative X.509 key file or PKCS #11 URL to use\0" +/* 2307 */ "X509DSAKEYFILE\0" +/* 2322 */ "x509dsakeyfile\0" +/* 2337 */ "Alternative X.509 Certificate file or PKCS #11 URL to use\0" +/* 2395 */ "X509DSACERTFILE\0" +/* 2411 */ "x509dsacertfile\0" +/* 2427 */ "X509ECCKEYFILE\0" +/* 2442 */ "x509ecckeyfile\0" +/* 2457 */ "X509ECCCERTFILE\0" +/* 2473 */ "x509ecccertfile\0" +/* 2489 */ "PGP subkey to use (hex or auto)\0" +/* 2521 */ "PGPSUBKEY\0" +/* 2531 */ "pgpsubkey\0" +/* 2541 */ "SRP password file to use\0" +/* 2566 */ "SRPPASSWD\0" +/* 2576 */ "srppasswd\0" +/* 2586 */ "SRP password configuration file to use\0" +/* 2625 */ "SRPPASSWDCONF\0" +/* 2639 */ "srppasswdconf\0" +/* 2653 */ "PSK password file to use\0" +/* 2678 */ "PSKPASSWD\0" +/* 2688 */ "pskpasswd\0" +/* 2698 */ "PSK identity hint to use\0" +/* 2723 */ "PSKHINT\0" +/* 2731 */ "pskhint\0" +/* 2739 */ "The OCSP response to send to client\0" +/* 2775 */ "OCSP_RESPONSE\0" +/* 2789 */ "ocsp-response\0" +/* 2803 */ "The port to connect to\0" +/* 2826 */ "PORT\0" +/* 2831 */ "port\0" +/* 2836 */ "Print a list of the supported algorithms and modes\0" +/* 2887 */ "LIST\0" +/* 2892 */ "list\0" +/* 2897 */ "Specify the PKCS #11 provider library\0" +/* 2935 */ "PROVIDER\0" +/* 2944 */ "provider\0" +/* 2953 */ "display extended usage information and exit\0" +/* 2997 */ "help\0" +/* 3002 */ "extended usage information passed thru pager\0" +/* 3047 */ "more-help\0" +/* 3057 */ "output version information and exit\0" +/* 3093 */ "version\0" +/* 3101 */ "GNUTLS_SERV\0" +/* 3113 */ "gnutls-serv - GnuTLS server\n" + "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0" +/* 3199 */ "@PACKAGE_BUGREPORT@\0" +/* 3219 */ "\n\0" +/* 3221 */ "Server program that listens to incoming TLS connections.\n\0" +/* 3279 */ "gnutls-serv @VERSION@\0" +/* 3301 */ "Usage: gnutls-serv [options]\n" + "gnutls-serv --help for usage instructions.\n"; + +/** + * debug option description: + */ +/** Descriptive text for the debug option */ +#define DEBUG_DESC (gnutls_serv_opt_strs+903) +/** Upper-cased name for the debug option */ +#define DEBUG_NAME (gnutls_serv_opt_strs+920) +/** Name string for the debug option */ +#define DEBUG_name (gnutls_serv_opt_strs+926) +/** Compiled in flag settings for the debug option */ +#define DEBUG_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * sni-hostname option description: + */ +/** Descriptive text for the sni-hostname option */ +#define SNI_HOSTNAME_DESC (gnutls_serv_opt_strs+932) +/** Upper-cased name for the sni-hostname option */ +#define SNI_HOSTNAME_NAME (gnutls_serv_opt_strs+976) +/** Name string for the sni-hostname option */ +#define SNI_HOSTNAME_name (gnutls_serv_opt_strs+989) +/** Compiled in flag settings for the sni-hostname option */ +#define SNI_HOSTNAME_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * sni-hostname-fatal option description: + */ +/** Descriptive text for the sni-hostname-fatal option */ +#define SNI_HOSTNAME_FATAL_DESC (gnutls_serv_opt_strs+1002) +/** Upper-cased name for the sni-hostname-fatal option */ +#define SNI_HOSTNAME_FATAL_NAME (gnutls_serv_opt_strs+1044) +/** Name string for the sni-hostname-fatal option */ +#define SNI_HOSTNAME_FATAL_name (gnutls_serv_opt_strs+1063) +/** Compiled in flag settings for the sni-hostname-fatal option */ +#define SNI_HOSTNAME_FATAL_FLAGS (OPTST_DISABLED) + +/** + * noticket option description: + */ +/** Descriptive text for the noticket option */ +#define NOTICKET_DESC (gnutls_serv_opt_strs+1082) +/** Upper-cased name for the noticket option */ +#define NOTICKET_NAME (gnutls_serv_opt_strs+1111) +/** Name string for the noticket option */ +#define NOTICKET_name (gnutls_serv_opt_strs+1120) +/** Compiled in flag settings for the noticket option */ +#define NOTICKET_FLAGS (OPTST_DISABLED) + +/** + * generate option description: + */ +/** Descriptive text for the generate option */ +#define GENERATE_DESC (gnutls_serv_opt_strs+1129) +/** Upper-cased name for the generate option */ +#define GENERATE_NAME (gnutls_serv_opt_strs+1164) +/** Name string for the generate option */ +#define GENERATE_name (gnutls_serv_opt_strs+1173) +/** Compiled in flag settings for the generate option */ +#define GENERATE_FLAGS (OPTST_DISABLED) + +/** + * quiet option description: + */ +/** Descriptive text for the quiet option */ +#define QUIET_DESC (gnutls_serv_opt_strs+1182) +/** Upper-cased name for the quiet option */ +#define QUIET_NAME (gnutls_serv_opt_strs+1205) +/** Name string for the quiet option */ +#define QUIET_name (gnutls_serv_opt_strs+1211) +/** Compiled in flag settings for the quiet option */ +#define QUIET_FLAGS (OPTST_DISABLED) + +/** + * nodb option description: + */ +/** Descriptive text for the nodb option */ +#define NODB_DESC (gnutls_serv_opt_strs+1217) +/** Upper-cased name for the nodb option */ +#define NODB_NAME (gnutls_serv_opt_strs+1250) +/** Name string for the nodb option */ +#define NODB_name (gnutls_serv_opt_strs+1255) +/** Compiled in flag settings for the nodb option */ +#define NODB_FLAGS (OPTST_DISABLED) + +/** + * http option description: + */ +/** Descriptive text for the http option */ +#define HTTP_DESC (gnutls_serv_opt_strs+1260) +/** Upper-cased name for the http option */ +#define HTTP_NAME (gnutls_serv_opt_strs+1282) +/** Name string for the http option */ +#define HTTP_name (gnutls_serv_opt_strs+1287) +/** Compiled in flag settings for the http option */ +#define HTTP_FLAGS (OPTST_DISABLED) + +/** + * echo option description: + */ +/** Descriptive text for the echo option */ +#define ECHO_DESC (gnutls_serv_opt_strs+1292) +/** Upper-cased name for the echo option */ +#define ECHO_NAME (gnutls_serv_opt_strs+1314) +/** Name string for the echo option */ +#define ECHO_name (gnutls_serv_opt_strs+1319) +/** Compiled in flag settings for the echo option */ +#define ECHO_FLAGS (OPTST_DISABLED) + +/** + * udp option description: + */ +/** Descriptive text for the udp option */ +#define UDP_DESC (gnutls_serv_opt_strs+1324) +/** Upper-cased name for the udp option */ +#define UDP_NAME (gnutls_serv_opt_strs+1357) +/** Name string for the udp option */ +#define UDP_name (gnutls_serv_opt_strs+1361) +/** Compiled in flag settings for the udp option */ +#define UDP_FLAGS (OPTST_DISABLED) + +/** + * mtu option description: + */ +/** Descriptive text for the mtu option */ +#define MTU_DESC (gnutls_serv_opt_strs+1365) +/** Upper-cased name for the mtu option */ +#define MTU_NAME (gnutls_serv_opt_strs+1390) +/** Name string for the mtu option */ +#define MTU_name (gnutls_serv_opt_strs+1394) +/** Compiled in flag settings for the mtu option */ +#define MTU_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * srtp_profiles option description: + */ +/** Descriptive text for the srtp_profiles option */ +#define SRTP_PROFILES_DESC (gnutls_serv_opt_strs+1398) +/** Upper-cased name for the srtp_profiles option */ +#define SRTP_PROFILES_NAME (gnutls_serv_opt_strs+1418) +/** Name string for the srtp_profiles option */ +#define SRTP_PROFILES_name (gnutls_serv_opt_strs+1432) +/** Compiled in flag settings for the srtp_profiles option */ +#define SRTP_PROFILES_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * disable-client-cert option description: + */ +/** Descriptive text for the disable-client-cert option */ +#define DISABLE_CLIENT_CERT_DESC (gnutls_serv_opt_strs+1446) +/** Upper-cased name for the disable-client-cert option */ +#define DISABLE_CLIENT_CERT_NAME (gnutls_serv_opt_strs+1482) +/** Name string for the disable-client-cert option */ +#define DISABLE_CLIENT_CERT_name (gnutls_serv_opt_strs+1502) +/** Compiled in flag settings for the disable-client-cert option */ +#define DISABLE_CLIENT_CERT_FLAGS (OPTST_DISABLED) + +/** + * require-client-cert option description: + */ +/** Descriptive text for the require-client-cert option */ +#define REQUIRE_CLIENT_CERT_DESC (gnutls_serv_opt_strs+1522) +/** Upper-cased name for the require-client-cert option */ +#define REQUIRE_CLIENT_CERT_NAME (gnutls_serv_opt_strs+1551) +/** Name string for the require-client-cert option */ +#define REQUIRE_CLIENT_CERT_name (gnutls_serv_opt_strs+1571) +/** Compiled in flag settings for the require-client-cert option */ +#define REQUIRE_CLIENT_CERT_FLAGS (OPTST_DISABLED) + +/** + * verify-client-cert option description: + */ +/** Descriptive text for the verify-client-cert option */ +#define VERIFY_CLIENT_CERT_DESC (gnutls_serv_opt_strs+1591) +/** Upper-cased name for the verify-client-cert option */ +#define VERIFY_CLIENT_CERT_NAME (gnutls_serv_opt_strs+1639) +/** Name string for the verify-client-cert option */ +#define VERIFY_CLIENT_CERT_name (gnutls_serv_opt_strs+1658) +/** Compiled in flag settings for the verify-client-cert option */ +#define VERIFY_CLIENT_CERT_FLAGS (OPTST_DISABLED) + +/** + * heartbeat option description: + */ +/** Descriptive text for the heartbeat option */ +#define HEARTBEAT_DESC (gnutls_serv_opt_strs+1677) +/** Upper-cased name for the heartbeat option */ +#define HEARTBEAT_NAME (gnutls_serv_opt_strs+1704) +/** Name string for the heartbeat option */ +#define HEARTBEAT_name (gnutls_serv_opt_strs+1714) +/** Compiled in flag settings for the heartbeat option */ +#define HEARTBEAT_FLAGS (OPTST_DISABLED) + +/** + * x509fmtder option description: + */ +/** Descriptive text for the x509fmtder option */ +#define X509FMTDER_DESC (gnutls_serv_opt_strs+1724) +/** Upper-cased name for the x509fmtder option */ +#define X509FMTDER_NAME (gnutls_serv_opt_strs+1769) +/** Name string for the x509fmtder option */ +#define X509FMTDER_name (gnutls_serv_opt_strs+1780) +/** Compiled in flag settings for the x509fmtder option */ +#define X509FMTDER_FLAGS (OPTST_DISABLED) + +/** + * priority option description: + */ +/** Descriptive text for the priority option */ +#define PRIORITY_DESC (gnutls_serv_opt_strs+1791) +/** Upper-cased name for the priority option */ +#define PRIORITY_NAME (gnutls_serv_opt_strs+1809) +/** Name string for the priority option */ +#define PRIORITY_name (gnutls_serv_opt_strs+1818) +/** Compiled in flag settings for the priority option */ +#define PRIORITY_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * dhparams option description: + */ +/** Descriptive text for the dhparams option */ +#define DHPARAMS_DESC (gnutls_serv_opt_strs+1827) +/** Upper-cased name for the dhparams option */ +#define DHPARAMS_NAME (gnutls_serv_opt_strs+1849) +/** Name string for the dhparams option */ +#define DHPARAMS_name (gnutls_serv_opt_strs+1858) +/** Compiled in flag settings for the dhparams option */ +#define DHPARAMS_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * x509cafile option description: + */ +/** Descriptive text for the x509cafile option */ +#define X509CAFILE_DESC (gnutls_serv_opt_strs+1867) +/** Upper-cased name for the x509cafile option */ +#define X509CAFILE_NAME (gnutls_serv_opt_strs+1907) +/** Name string for the x509cafile option */ +#define X509CAFILE_name (gnutls_serv_opt_strs+1918) +/** Compiled in flag settings for the x509cafile option */ +#define X509CAFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * x509crlfile option description: + */ +/** Descriptive text for the x509crlfile option */ +#define X509CRLFILE_DESC (gnutls_serv_opt_strs+1929) +/** Upper-cased name for the x509crlfile option */ +#define X509CRLFILE_NAME (gnutls_serv_opt_strs+1945) +/** Name string for the x509crlfile option */ +#define X509CRLFILE_name (gnutls_serv_opt_strs+1957) +/** Compiled in flag settings for the x509crlfile option */ +#define X509CRLFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * pgpkeyfile option description: + */ +/** Descriptive text for the pgpkeyfile option */ +#define PGPKEYFILE_DESC (gnutls_serv_opt_strs+1969) +/** Upper-cased name for the pgpkeyfile option */ +#define PGPKEYFILE_NAME (gnutls_serv_opt_strs+1989) +/** Name string for the pgpkeyfile option */ +#define PGPKEYFILE_name (gnutls_serv_opt_strs+2000) +/** Compiled in flag settings for the pgpkeyfile option */ +#define PGPKEYFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * pgpkeyring option description: + */ +/** Descriptive text for the pgpkeyring option */ +#define PGPKEYRING_DESC (gnutls_serv_opt_strs+2011) +/** Upper-cased name for the pgpkeyring option */ +#define PGPKEYRING_NAME (gnutls_serv_opt_strs+2036) +/** Name string for the pgpkeyring option */ +#define PGPKEYRING_name (gnutls_serv_opt_strs+2047) +/** Compiled in flag settings for the pgpkeyring option */ +#define PGPKEYRING_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * pgpcertfile option description: + */ +/** Descriptive text for the pgpcertfile option */ +#define PGPCERTFILE_DESC (gnutls_serv_opt_strs+2058) +/** Upper-cased name for the pgpcertfile option */ +#define PGPCERTFILE_NAME (gnutls_serv_opt_strs+2099) +/** Name string for the pgpcertfile option */ +#define PGPCERTFILE_name (gnutls_serv_opt_strs+2111) +/** Compiled in flag settings for the pgpcertfile option */ +#define PGPCERTFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * x509keyfile option description: + */ +/** Descriptive text for the x509keyfile option */ +#define X509KEYFILE_DESC (gnutls_serv_opt_strs+2123) +/** Upper-cased name for the x509keyfile option */ +#define X509KEYFILE_NAME (gnutls_serv_opt_strs+2161) +/** Name string for the x509keyfile option */ +#define X509KEYFILE_name (gnutls_serv_opt_strs+2173) +/** Compiled in flag settings for the x509keyfile option */ +#define X509KEYFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * x509certfile option description: + */ +/** Descriptive text for the x509certfile option */ +#define X509CERTFILE_DESC (gnutls_serv_opt_strs+2185) +/** Upper-cased name for the x509certfile option */ +#define X509CERTFILE_NAME (gnutls_serv_opt_strs+2231) +/** Name string for the x509certfile option */ +#define X509CERTFILE_name (gnutls_serv_opt_strs+2244) +/** Compiled in flag settings for the x509certfile option */ +#define X509CERTFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * x509dsakeyfile option description: + */ +/** Descriptive text for the x509dsakeyfile option */ +#define X509DSAKEYFILE_DESC (gnutls_serv_opt_strs+2257) +/** Upper-cased name for the x509dsakeyfile option */ +#define X509DSAKEYFILE_NAME (gnutls_serv_opt_strs+2307) +/** Name string for the x509dsakeyfile option */ +#define X509DSAKEYFILE_name (gnutls_serv_opt_strs+2322) +/** Compiled in flag settings for the x509dsakeyfile option */ +#define X509DSAKEYFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * x509dsacertfile option description: + */ +/** Descriptive text for the x509dsacertfile option */ +#define X509DSACERTFILE_DESC (gnutls_serv_opt_strs+2337) +/** Upper-cased name for the x509dsacertfile option */ +#define X509DSACERTFILE_NAME (gnutls_serv_opt_strs+2395) +/** Name string for the x509dsacertfile option */ +#define X509DSACERTFILE_name (gnutls_serv_opt_strs+2411) +/** Compiled in flag settings for the x509dsacertfile option */ +#define X509DSACERTFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * x509ecckeyfile option description: + */ +/** Descriptive text for the x509ecckeyfile option */ +#define X509ECCKEYFILE_DESC (gnutls_serv_opt_strs+2257) +/** Upper-cased name for the x509ecckeyfile option */ +#define X509ECCKEYFILE_NAME (gnutls_serv_opt_strs+2427) +/** Name string for the x509ecckeyfile option */ +#define X509ECCKEYFILE_name (gnutls_serv_opt_strs+2442) +/** Compiled in flag settings for the x509ecckeyfile option */ +#define X509ECCKEYFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * x509ecccertfile option description: + */ +/** Descriptive text for the x509ecccertfile option */ +#define X509ECCCERTFILE_DESC (gnutls_serv_opt_strs+2337) +/** Upper-cased name for the x509ecccertfile option */ +#define X509ECCCERTFILE_NAME (gnutls_serv_opt_strs+2457) +/** Name string for the x509ecccertfile option */ +#define X509ECCCERTFILE_name (gnutls_serv_opt_strs+2473) +/** Compiled in flag settings for the x509ecccertfile option */ +#define X509ECCCERTFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * pgpsubkey option description: + */ +/** Descriptive text for the pgpsubkey option */ +#define PGPSUBKEY_DESC (gnutls_serv_opt_strs+2489) +/** Upper-cased name for the pgpsubkey option */ +#define PGPSUBKEY_NAME (gnutls_serv_opt_strs+2521) +/** Name string for the pgpsubkey option */ +#define PGPSUBKEY_name (gnutls_serv_opt_strs+2531) +/** Compiled in flag settings for the pgpsubkey option */ +#define PGPSUBKEY_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * srppasswd option description: + */ +/** Descriptive text for the srppasswd option */ +#define SRPPASSWD_DESC (gnutls_serv_opt_strs+2541) +/** Upper-cased name for the srppasswd option */ +#define SRPPASSWD_NAME (gnutls_serv_opt_strs+2566) +/** Name string for the srppasswd option */ +#define SRPPASSWD_name (gnutls_serv_opt_strs+2576) +/** Compiled in flag settings for the srppasswd option */ +#define SRPPASSWD_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * srppasswdconf option description: + */ +/** Descriptive text for the srppasswdconf option */ +#define SRPPASSWDCONF_DESC (gnutls_serv_opt_strs+2586) +/** Upper-cased name for the srppasswdconf option */ +#define SRPPASSWDCONF_NAME (gnutls_serv_opt_strs+2625) +/** Name string for the srppasswdconf option */ +#define SRPPASSWDCONF_name (gnutls_serv_opt_strs+2639) +/** Compiled in flag settings for the srppasswdconf option */ +#define SRPPASSWDCONF_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * pskpasswd option description: + */ +/** Descriptive text for the pskpasswd option */ +#define PSKPASSWD_DESC (gnutls_serv_opt_strs+2653) +/** Upper-cased name for the pskpasswd option */ +#define PSKPASSWD_NAME (gnutls_serv_opt_strs+2678) +/** Name string for the pskpasswd option */ +#define PSKPASSWD_name (gnutls_serv_opt_strs+2688) +/** Compiled in flag settings for the pskpasswd option */ +#define PSKPASSWD_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * pskhint option description: + */ +/** Descriptive text for the pskhint option */ +#define PSKHINT_DESC (gnutls_serv_opt_strs+2698) +/** Upper-cased name for the pskhint option */ +#define PSKHINT_NAME (gnutls_serv_opt_strs+2723) +/** Name string for the pskhint option */ +#define PSKHINT_name (gnutls_serv_opt_strs+2731) +/** Compiled in flag settings for the pskhint option */ +#define PSKHINT_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * ocsp-response option description: + */ +/** Descriptive text for the ocsp-response option */ +#define OCSP_RESPONSE_DESC (gnutls_serv_opt_strs+2739) +/** Upper-cased name for the ocsp-response option */ +#define OCSP_RESPONSE_NAME (gnutls_serv_opt_strs+2775) +/** Name string for the ocsp-response option */ +#define OCSP_RESPONSE_name (gnutls_serv_opt_strs+2789) +/** Compiled in flag settings for the ocsp-response option */ +#define OCSP_RESPONSE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * port option description: + */ +/** Descriptive text for the port option */ +#define PORT_DESC (gnutls_serv_opt_strs+2803) +/** Upper-cased name for the port option */ +#define PORT_NAME (gnutls_serv_opt_strs+2826) +/** Name string for the port option */ +#define PORT_name (gnutls_serv_opt_strs+2831) +/** Compiled in flag settings for the port option */ +#define PORT_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * list option description: + */ +/** Descriptive text for the list option */ +#define LIST_DESC (gnutls_serv_opt_strs+2836) +/** Upper-cased name for the list option */ +#define LIST_NAME (gnutls_serv_opt_strs+2887) +/** Name string for the list option */ +#define LIST_name (gnutls_serv_opt_strs+2892) +/** Compiled in flag settings for the list option */ +#define LIST_FLAGS (OPTST_DISABLED) + +/** + * provider option description: + */ +/** Descriptive text for the provider option */ +#define PROVIDER_DESC (gnutls_serv_opt_strs+2897) +/** Upper-cased name for the provider option */ +#define PROVIDER_NAME (gnutls_serv_opt_strs+2935) +/** Name string for the provider option */ +#define PROVIDER_name (gnutls_serv_opt_strs+2944) +/** Compiled in flag settings for the provider option */ +#define PROVIDER_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/* + * Help/More_Help/Version option descriptions: + */ +#define HELP_DESC (gnutls_serv_opt_strs+2953) +#define HELP_name (gnutls_serv_opt_strs+2997) +#ifdef HAVE_WORKING_FORK +#define MORE_HELP_DESC (gnutls_serv_opt_strs+3002) +#define MORE_HELP_name (gnutls_serv_opt_strs+3047) +#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +#define MORE_HELP_DESC HELP_DESC +#define MORE_HELP_name HELP_name +#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#endif +#ifdef NO_OPTIONAL_OPT_ARGS +# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ + OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) +#endif +#define VER_DESC (gnutls_serv_opt_strs+3057) +#define VER_name (gnutls_serv_opt_strs+3093) +/** + * Declare option callback procedures + */ +extern tOptProc + optionBooleanVal, optionNestedVal, optionNumericVal, + optionPagedUsage, optionPrintVersion, optionResetOpt, + optionStackArg, optionTimeDate, optionTimeVal, + optionUnstackArg, optionVendorOption; +static tOptProc + doOptDebug, doOptDhparams, doOptMtu, + doOptOcsp_Response, doOptPgpcertfile, doOptPgpkeyfile, + doOptPgpkeyring, doOptProvider, doOptPskpasswd, + doOptSrppasswd, doOptSrppasswdconf, doOptX509crlfile, + doUsageOpt; +#define VER_PROC optionPrintVersion + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the gnutls-serv Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the gnutls-serv program responds to. + */ +static tOptDesc optDesc[OPTION_CT] = { + { /* entry idx, value */ 0, VALUE_OPT_DEBUG, + /* equiv idx, value */ 0, VALUE_OPT_DEBUG, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DEBUG_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --debug */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptDebug, + /* desc, NAME, name */ DEBUG_DESC, DEBUG_NAME, DEBUG_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 1, VALUE_OPT_SNI_HOSTNAME, + /* equiv idx, value */ 1, VALUE_OPT_SNI_HOSTNAME, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SNI_HOSTNAME_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --sni-hostname */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SNI_HOSTNAME_DESC, SNI_HOSTNAME_NAME, SNI_HOSTNAME_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 2, VALUE_OPT_SNI_HOSTNAME_FATAL, + /* equiv idx, value */ 2, VALUE_OPT_SNI_HOSTNAME_FATAL, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SNI_HOSTNAME_FATAL_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --sni-hostname-fatal */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SNI_HOSTNAME_FATAL_DESC, SNI_HOSTNAME_FATAL_NAME, SNI_HOSTNAME_FATAL_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 3, VALUE_OPT_NOTICKET, + /* equiv idx, value */ 3, VALUE_OPT_NOTICKET, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ NOTICKET_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --noticket */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ NOTICKET_DESC, NOTICKET_NAME, NOTICKET_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 4, VALUE_OPT_GENERATE, + /* equiv idx, value */ 4, VALUE_OPT_GENERATE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ GENERATE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --generate */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ GENERATE_DESC, GENERATE_NAME, GENERATE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 5, VALUE_OPT_QUIET, + /* equiv idx, value */ 5, VALUE_OPT_QUIET, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ QUIET_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --quiet */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ QUIET_DESC, QUIET_NAME, QUIET_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 6, VALUE_OPT_NODB, + /* equiv idx, value */ 6, VALUE_OPT_NODB, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ NODB_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --nodb */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ NODB_DESC, NODB_NAME, NODB_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 7, VALUE_OPT_HTTP, + /* equiv idx, value */ 7, VALUE_OPT_HTTP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ HTTP_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --http */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ HTTP_DESC, HTTP_NAME, HTTP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 8, VALUE_OPT_ECHO, + /* equiv idx, value */ 8, VALUE_OPT_ECHO, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ ECHO_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --echo */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ ECHO_DESC, ECHO_NAME, ECHO_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 9, VALUE_OPT_UDP, + /* equiv idx, value */ 9, VALUE_OPT_UDP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ UDP_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --udp */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ UDP_DESC, UDP_NAME, UDP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 10, VALUE_OPT_MTU, + /* equiv idx, value */ 10, VALUE_OPT_MTU, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MTU_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --mtu */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptMtu, + /* desc, NAME, name */ MTU_DESC, MTU_NAME, MTU_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 11, VALUE_OPT_SRTP_PROFILES, + /* equiv idx, value */ 11, VALUE_OPT_SRTP_PROFILES, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SRTP_PROFILES_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --srtp_profiles */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SRTP_PROFILES_DESC, SRTP_PROFILES_NAME, SRTP_PROFILES_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 12, VALUE_OPT_DISABLE_CLIENT_CERT, + /* equiv idx, value */ 12, VALUE_OPT_DISABLE_CLIENT_CERT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DISABLE_CLIENT_CERT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --disable-client-cert */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ DISABLE_CLIENT_CERT_DESC, DISABLE_CLIENT_CERT_NAME, DISABLE_CLIENT_CERT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 13, VALUE_OPT_REQUIRE_CLIENT_CERT, + /* equiv idx, value */ 13, VALUE_OPT_REQUIRE_CLIENT_CERT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ REQUIRE_CLIENT_CERT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --require-client-cert */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ REQUIRE_CLIENT_CERT_DESC, REQUIRE_CLIENT_CERT_NAME, REQUIRE_CLIENT_CERT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 14, VALUE_OPT_VERIFY_CLIENT_CERT, + /* equiv idx, value */ 14, VALUE_OPT_VERIFY_CLIENT_CERT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VERIFY_CLIENT_CERT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --verify-client-cert */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ VERIFY_CLIENT_CERT_DESC, VERIFY_CLIENT_CERT_NAME, VERIFY_CLIENT_CERT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 15, VALUE_OPT_HEARTBEAT, + /* equiv idx, value */ 15, VALUE_OPT_HEARTBEAT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ HEARTBEAT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --heartbeat */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ HEARTBEAT_DESC, HEARTBEAT_NAME, HEARTBEAT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 16, VALUE_OPT_X509FMTDER, + /* equiv idx, value */ 16, VALUE_OPT_X509FMTDER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ X509FMTDER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --x509fmtder */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ X509FMTDER_DESC, X509FMTDER_NAME, X509FMTDER_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 17, VALUE_OPT_PRIORITY, + /* equiv idx, value */ 17, VALUE_OPT_PRIORITY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PRIORITY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --priority */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PRIORITY_DESC, PRIORITY_NAME, PRIORITY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 18, VALUE_OPT_DHPARAMS, + /* equiv idx, value */ 18, VALUE_OPT_DHPARAMS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DHPARAMS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --dhparams */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptDhparams, + /* desc, NAME, name */ DHPARAMS_DESC, DHPARAMS_NAME, DHPARAMS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 19, VALUE_OPT_X509CAFILE, + /* equiv idx, value */ 19, VALUE_OPT_X509CAFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ X509CAFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --x509cafile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ X509CAFILE_DESC, X509CAFILE_NAME, X509CAFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 20, VALUE_OPT_X509CRLFILE, + /* equiv idx, value */ 20, VALUE_OPT_X509CRLFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ X509CRLFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --x509crlfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptX509crlfile, + /* desc, NAME, name */ X509CRLFILE_DESC, X509CRLFILE_NAME, X509CRLFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 21, VALUE_OPT_PGPKEYFILE, + /* equiv idx, value */ 21, VALUE_OPT_PGPKEYFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PGPKEYFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pgpkeyfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptPgpkeyfile, + /* desc, NAME, name */ PGPKEYFILE_DESC, PGPKEYFILE_NAME, PGPKEYFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 22, VALUE_OPT_PGPKEYRING, + /* equiv idx, value */ 22, VALUE_OPT_PGPKEYRING, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PGPKEYRING_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pgpkeyring */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptPgpkeyring, + /* desc, NAME, name */ PGPKEYRING_DESC, PGPKEYRING_NAME, PGPKEYRING_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 23, VALUE_OPT_PGPCERTFILE, + /* equiv idx, value */ 23, VALUE_OPT_PGPCERTFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PGPCERTFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pgpcertfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptPgpcertfile, + /* desc, NAME, name */ PGPCERTFILE_DESC, PGPCERTFILE_NAME, PGPCERTFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 24, VALUE_OPT_X509KEYFILE, + /* equiv idx, value */ 24, VALUE_OPT_X509KEYFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ X509KEYFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --x509keyfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ X509KEYFILE_DESC, X509KEYFILE_NAME, X509KEYFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 25, VALUE_OPT_X509CERTFILE, + /* equiv idx, value */ 25, VALUE_OPT_X509CERTFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ X509CERTFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --x509certfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ X509CERTFILE_DESC, X509CERTFILE_NAME, X509CERTFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 26, VALUE_OPT_X509DSAKEYFILE, + /* equiv idx, value */ 26, VALUE_OPT_X509DSAKEYFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ X509DSAKEYFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --x509dsakeyfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ X509DSAKEYFILE_DESC, X509DSAKEYFILE_NAME, X509DSAKEYFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 27, VALUE_OPT_X509DSACERTFILE, + /* equiv idx, value */ 27, VALUE_OPT_X509DSACERTFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ X509DSACERTFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --x509dsacertfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ X509DSACERTFILE_DESC, X509DSACERTFILE_NAME, X509DSACERTFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 28, VALUE_OPT_X509ECCKEYFILE, + /* equiv idx, value */ 28, VALUE_OPT_X509ECCKEYFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ X509ECCKEYFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --x509ecckeyfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ X509ECCKEYFILE_DESC, X509ECCKEYFILE_NAME, X509ECCKEYFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 29, VALUE_OPT_X509ECCCERTFILE, + /* equiv idx, value */ 29, VALUE_OPT_X509ECCCERTFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ X509ECCCERTFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --x509ecccertfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ X509ECCCERTFILE_DESC, X509ECCCERTFILE_NAME, X509ECCCERTFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 30, VALUE_OPT_PGPSUBKEY, + /* equiv idx, value */ 30, VALUE_OPT_PGPSUBKEY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PGPSUBKEY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pgpsubkey */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PGPSUBKEY_DESC, PGPSUBKEY_NAME, PGPSUBKEY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 31, VALUE_OPT_SRPPASSWD, + /* equiv idx, value */ 31, VALUE_OPT_SRPPASSWD, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SRPPASSWD_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --srppasswd */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptSrppasswd, + /* desc, NAME, name */ SRPPASSWD_DESC, SRPPASSWD_NAME, SRPPASSWD_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 32, VALUE_OPT_SRPPASSWDCONF, + /* equiv idx, value */ 32, VALUE_OPT_SRPPASSWDCONF, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SRPPASSWDCONF_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --srppasswdconf */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptSrppasswdconf, + /* desc, NAME, name */ SRPPASSWDCONF_DESC, SRPPASSWDCONF_NAME, SRPPASSWDCONF_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 33, VALUE_OPT_PSKPASSWD, + /* equiv idx, value */ 33, VALUE_OPT_PSKPASSWD, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PSKPASSWD_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pskpasswd */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptPskpasswd, + /* desc, NAME, name */ PSKPASSWD_DESC, PSKPASSWD_NAME, PSKPASSWD_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 34, VALUE_OPT_PSKHINT, + /* equiv idx, value */ 34, VALUE_OPT_PSKHINT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PSKHINT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pskhint */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PSKHINT_DESC, PSKHINT_NAME, PSKHINT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 35, VALUE_OPT_OCSP_RESPONSE, + /* equiv idx, value */ 35, VALUE_OPT_OCSP_RESPONSE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OCSP_RESPONSE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --ocsp-response */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptOcsp_Response, + /* desc, NAME, name */ OCSP_RESPONSE_DESC, OCSP_RESPONSE_NAME, OCSP_RESPONSE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 36, VALUE_OPT_PORT, + /* equiv idx, value */ 36, VALUE_OPT_PORT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PORT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --port */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionNumericVal, + /* desc, NAME, name */ PORT_DESC, PORT_NAME, PORT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 37, VALUE_OPT_LIST, + /* equiv idx, value */ 37, VALUE_OPT_LIST, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LIST_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --list */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LIST_DESC, LIST_NAME, LIST_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 38, VALUE_OPT_PROVIDER, + /* equiv idx, value */ 38, VALUE_OPT_PROVIDER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PROVIDER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --provider */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptProvider, + /* desc, NAME, name */ PROVIDER_DESC, PROVIDER_NAME, PROVIDER_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VER_FLAGS, AOUSE_VERSION, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ VER_PROC, + /* desc, NAME, name */ VER_DESC, NULL, VER_name, + /* disablement strs */ NULL, NULL }, + + + + { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doUsageOpt, + /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionPagedUsage, + /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, + /* disablement strs */ NULL, NULL } +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** Reference to the upper cased version of gnutls-serv. */ +#define zPROGNAME (gnutls_serv_opt_strs+3101) +/** Reference to the title line for gnutls-serv usage. */ +#define zUsageTitle (gnutls_serv_opt_strs+3113) +/** There is no gnutls-serv configuration file. */ +#define zRcName NULL +/** There are no directories to search for gnutls-serv config files. */ +#define apzHomeList NULL +/** The gnutls-serv program bug email address. */ +#define zBugsAddr (gnutls_serv_opt_strs+3199) +/** Clarification/explanation of what gnutls-serv does. */ +#define zExplain (gnutls_serv_opt_strs+3219) +/** Extra detail explaining what gnutls-serv does. */ +#define zDetail (gnutls_serv_opt_strs+3221) +/** The full version string for gnutls-serv. */ +#define zFullVersion (gnutls_serv_opt_strs+3279) +/* extracted from optcode.tlib near line 364 */ + +#if defined(ENABLE_NLS) +# define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT + static tOptionXlateProc translate_option_strings; +#else +# define OPTPROC_BASE OPTPROC_NONE +# define translate_option_strings NULL +#endif /* ENABLE_NLS */ + +#define gnutls_serv_full_usage (NULL) +#define gnutls_serv_short_usage (gnutls_serv_opt_strs+3301) + +#endif /* not defined __doxygen__ */ + +/* + * Create the static procedure(s) declared above. + */ +/** + * The callout function that invokes the optionUsage function. + * + * @param[in] opts the AutoOpts option description structure + * @param[in] od the descriptor for the "help" (usage) option. + * @noreturn + */ +static void +doUsageOpt(tOptions * opts, tOptDesc * od) +{ + int ex_code; + ex_code = GNUTLS_SERV_EXIT_SUCCESS; + optionUsage(&gnutls_servOptions, ex_code); + /* NOTREACHED */ + exit(GNUTLS_SERV_EXIT_FAILURE); + (void)opts; + (void)od; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the debug option. + * Specifies the debug level. + * @param[in] pOptions the gnutls-serv options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptDebug(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[1] = { + { 0 , 9999 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 1; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + + emit_ranges: +optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the mtu option. + * + * @param[in] pOptions the gnutls-serv options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptMtu(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[1] = { + { 0, 17000 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 1; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + + emit_ranges: +optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the dhparams option. + * + * @param[in] pOptions the gnutls-serv options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptDhparams(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the x509crlfile option. + * + * @param[in] pOptions the gnutls-serv options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptX509crlfile(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the pgpkeyfile option. + * + * @param[in] pOptions the gnutls-serv options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptPgpkeyfile(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the pgpkeyring option. + * + * @param[in] pOptions the gnutls-serv options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptPgpkeyring(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the pgpcertfile option. + * + * @param[in] pOptions the gnutls-serv options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptPgpcertfile(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the srppasswd option. + * + * @param[in] pOptions the gnutls-serv options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptSrppasswd(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the srppasswdconf option. + * + * @param[in] pOptions the gnutls-serv options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptSrppasswdconf(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the pskpasswd option. + * + * @param[in] pOptions the gnutls-serv options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptPskpasswd(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the ocsp-response option. + * If the client requested an OCSP response, return data from this file to the client. + * @param[in] pOptions the gnutls-serv options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptOcsp_Response(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the provider option. + * This will override the default options in /etc/gnutls/pkcs11.conf + * @param[in] pOptions the gnutls-serv options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptProvider(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} +/* extracted from optmain.tlib near line 1250 */ + +/** + * The directory containing the data associated with gnutls-serv. + */ +#ifndef PKGDATADIR +# define PKGDATADIR "" +#endif + +/** + * Information about the person or institution that packaged gnutls-serv + * for the current distribution. + */ +#ifndef WITH_PACKAGER +# define gnutls_serv_packager_info NULL +#else +/** Packager information for gnutls-serv. */ +static char const gnutls_serv_packager_info[] = + "Packaged by " WITH_PACKAGER + +# ifdef WITH_PACKAGER_VERSION + " ("WITH_PACKAGER_VERSION")" +# endif + +# ifdef WITH_PACKAGER_BUG_REPORTS + "\nReport gnutls_serv bugs to " WITH_PACKAGER_BUG_REPORTS +# endif + "\n"; +#endif +#ifndef __doxygen__ + +#endif /* __doxygen__ */ +/** + * The option definitions for gnutls-serv. The one structure that + * binds them all. + */ +tOptions gnutls_servOptions = { + OPTIONS_STRUCT_VERSION, + 0, NULL, /* original argc + argv */ + ( OPTPROC_BASE + + OPTPROC_ERRSTOP + + OPTPROC_SHORTOPT + + OPTPROC_LONGOPT + + OPTPROC_NO_REQ_OPT + + OPTPROC_NO_ARGS + + OPTPROC_GNUUSAGE + + OPTPROC_MISUSE ), + 0, NULL, /* current option index, current option */ + NULL, NULL, zPROGNAME, + zRcName, zCopyright, zLicenseDescrip, + zFullVersion, apzHomeList, zUsageTitle, + zExplain, zDetail, optDesc, + zBugsAddr, /* address to send bugs to */ + NULL, NULL, /* extensions/saved state */ + optionUsage, /* usage procedure */ + translate_option_strings, /* translation procedure */ + /* + * Indexes to special options + */ + { INDEX_OPT_MORE_HELP, /* more-help option index */ + NO_EQUIVALENT, /* save option index */ + NO_EQUIVALENT, /* '-#' option index */ + NO_EQUIVALENT /* index of default opt */ + }, + 42 /* full option count */, 39 /* user option count */, + gnutls_serv_full_usage, gnutls_serv_short_usage, + NULL, NULL, + PKGDATADIR, gnutls_serv_packager_info +}; + +#if ENABLE_NLS +/** + * This code is designed to translate translatable option text for the + * gnutls-serv program. These translations happen upon entry + * to optionProcess(). + */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#ifdef HAVE_DCGETTEXT +# include <gettext.h> +#endif +#include <autoopts/usage-txt.h> + +static char * AO_gettext(char const * pz); +static void coerce_it(void ** s); + +/** + * AutoGen specific wrapper function for gettext. It relies on the macro _() + * to convert from English to the target language, then strdup-duplicates the + * result string. It tries the "libopts" domain first, then whatever has been + * set via the \a textdomain(3) call. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * +AO_gettext(char const * pz) +{ + char * res; + if (pz == NULL) + return NULL; +#ifdef HAVE_DCGETTEXT + /* + * While processing the option_xlateable_txt data, try to use the + * "libopts" domain. Once we switch to the option descriptor data, + * do *not* use that domain. + */ + if (option_xlateable_txt.field_ct != 0) { + res = dgettext("libopts", pz); + if (res == pz) + res = (char *)VOIDP(_(pz)); + } else + res = (char *)VOIDP(_(pz)); +#else + res = (char *)VOIDP(_(pz)); +#endif + if (res == pz) + return res; + res = strdup(res); + if (res == NULL) { + fputs(_("No memory for duping translated strings\n"), stderr); + exit(GNUTLS_SERV_EXIT_FAILURE); + } + return res; +} + +/** + * All the pointers we use are marked "* const", but they are stored in + * writable memory. Coerce the mutability and set the pointer. + */ +static void coerce_it(void ** s) { *s = AO_gettext(*s); +} + +/** + * Translate all the translatable strings in the gnutls_servOptions + * structure defined above. This is done only once. + */ +static void +translate_option_strings(void) +{ + tOptions * const opts = &gnutls_servOptions; + + /* + * Guard against re-translation. It won't work. The strings will have + * been changed by the first pass through this code. One shot only. + */ + if (option_xlateable_txt.field_ct != 0) { + /* + * Do the translations. The first pointer follows the field count + * field. The field count field is the size of a pointer. + */ + char ** ppz = (char**)VOIDP(&(option_xlateable_txt)); + int ix = option_xlateable_txt.field_ct; + + do { + ppz++; /* skip over field_ct */ + *ppz = AO_gettext(*ppz); + } while (--ix > 0); + /* prevent re-translation and disable "libopts" domain lookup */ + option_xlateable_txt.field_ct = 0; + + coerce_it(VOIDP(&(opts->pzCopyright))); + coerce_it(VOIDP(&(opts->pzCopyNotice))); + coerce_it(VOIDP(&(opts->pzFullVersion))); + coerce_it(VOIDP(&(opts->pzUsageTitle))); + coerce_it(VOIDP(&(opts->pzExplain))); + coerce_it(VOIDP(&(opts->pzDetail))); + { + tOptDesc * od = opts->pOptDesc; + for (ix = opts->optCt; ix > 0; ix--, od++) + coerce_it(VOIDP(&(od->pzText))); + } + } +} +#endif /* ENABLE_NLS */ + +#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT +/** I18N function strictly for xgettext. Do not compile. */ +static void bogus_function(void) { + /* TRANSLATORS: + + The following dummy function was crated solely so that xgettext can + extract the correct strings. These strings are actually referenced + by a field name in the gnutls_servOptions structure noted in the + comments below. The literal text is defined in gnutls_serv_opt_strs. + + NOTE: the strings below are segmented with respect to the source string + gnutls_serv_opt_strs. The strings above are handed off for translation + at run time a paragraph at a time. Consequently, they are presented here + for translation a paragraph at a time. + + ALSO: often the description for an option will reference another option + by name. These are set off with apostrophe quotes (I hope). Do not + translate option names. + */ + /* referenced via gnutls_servOptions.pzCopyright */ + puts(_("gnutls-serv @VERSION@\n\ +Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n\ +This is free software. It is licensed for use, modification and\n\ +redistribution under the terms of the GNU General Public License,\n\ +version 3 or later <http://gnu.org/licenses/gpl.html>\n")); + + /* referenced via gnutls_servOptions.pzCopyNotice */ + puts(_("gnutls-serv is free software: you can redistribute it and/or modify it\n\ +under the terms of the GNU General Public License as published by the Free\n\ +Software Foundation, either version 3 of the License, or (at your option)\n\ +any later version.\n\n")); + puts(_("gnutls-serv is distributed in the hope that it will be useful, but WITHOUT\n\ +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n\ +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n\ +more details.\n\n")); + puts(_("You should have received a copy of the GNU General Public License along\n\ +with this program. If not, see <http://www.gnu.org/licenses/>.\n")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Enable debugging")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Server's hostname for server name extension")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Send fatal alert on sni-hostname mismatch")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Don't accept session tickets")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Generate Diffie-Hellman parameters")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Suppress some messages")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Do not use a resumption database")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Act as an HTTP server")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Act as an Echo server")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Use DTLS (datagram TLS) over UDP")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Set MTU for datagram TLS")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Offer SRTP profiles")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Do not request a client certificate")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Require a client certificate")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("If a client certificate is sent then verify it.")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Activate heartbeat support")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Use DER format for certificates to read from")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Priorities string")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("DH params file to use")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Certificate file or PKCS #11 URL to use")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("CRL file to use")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("PGP Key file to use")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("PGP Key ring file to use")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("PGP Public Key (certificate) file to use")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("X.509 key file or PKCS #11 URL to use")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("X.509 Certificate file or PKCS #11 URL to use")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Alternative X.509 key file or PKCS #11 URL to use")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Alternative X.509 Certificate file or PKCS #11 URL to use")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Alternative X.509 key file or PKCS #11 URL to use")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Alternative X.509 Certificate file or PKCS #11 URL to use")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("PGP subkey to use (hex or auto)")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("SRP password file to use")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("SRP password configuration file to use")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("PSK password file to use")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("PSK identity hint to use")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("The OCSP response to send to client")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("The port to connect to")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Print a list of the supported algorithms and modes")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("Specify the PKCS #11 provider library")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("display extended usage information and exit")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("extended usage information passed thru pager")); + + /* referenced via gnutls_servOptions.pOptDesc->pzText */ + puts(_("output version information and exit")); + + /* referenced via gnutls_servOptions.pzUsageTitle */ + puts(_("gnutls-serv - GnuTLS server\n\ +Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n")); + + /* referenced via gnutls_servOptions.pzExplain */ + puts(_("\n")); + + /* referenced via gnutls_servOptions.pzDetail */ + puts(_("Server program that listens to incoming TLS connections.\n")); + + /* referenced via gnutls_servOptions.pzFullVersion */ + puts(_("gnutls-serv @VERSION@")); + + /* referenced via gnutls_servOptions.pzFullUsage */ + puts(_("<<<NOT-FOUND>>>")); + + /* referenced via gnutls_servOptions.pzShortUsage */ + puts(_("Usage: gnutls-serv [options]\n\ +gnutls-serv --help for usage instructions.\n")); + /* LIBOPTS-MESSAGES: */ +#line 67 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 93 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 53 "../init.c" + puts(_("AutoOpts function called without option descriptor\n")); +#line 86 "../init.c" + puts(_("\tThis exceeds the compiled library version: ")); +#line 84 "../init.c" + puts(_("Automated Options Processing Error!\n" + "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); +#line 80 "../autoopts.c" + puts(_("realloc of %d bytes at 0x%p failed\n")); +#line 88 "../init.c" + puts(_("\tThis is less than the minimum library version: ")); +#line 121 "../version.c" + puts(_("Automated Options version %s\n" + "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); +#line 87 "../makeshell.c" + puts(_("(AutoOpts bug): %s.\n")); +#line 90 "../reset.c" + puts(_("optionResetOpt() called, but reset-option not configured")); +#line 295 "../usage.c" + puts(_("could not locate the 'help' option")); +#line 336 "../autoopts.c" + puts(_("optionProcess() was called with invalid data")); +#line 751 "../usage.c" + puts(_("invalid argument type specified")); +#line 598 "../find.c" + puts(_("defaulted to option with optional arg")); +#line 76 "../alias.c" + puts(_("aliasing option is out of range.")); +#line 235 "../enum.c" + puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); +#line 108 "../find.c" + puts(_(" The following options match:\n")); +#line 293 "../find.c" + puts(_("%s: ambiguous option name: %s (matches %d options)\n")); +#line 161 "../check.c" + puts(_("%s: Command line arguments required\n")); +#line 43 "../alias.c" + puts(_("%d %s%s options allowed\n")); +#line 94 "../makeshell.c" + puts(_("%s error %d (%s) calling %s for '%s'\n")); +#line 306 "../makeshell.c" + puts(_("interprocess pipe")); +#line 168 "../version.c" + puts(_("error: version option argument '%c' invalid. Use:\n" + "\t'v' - version only\n" + "\t'c' - version and copyright\n" + "\t'n' - version and full copyright notice\n")); +#line 58 "../check.c" + puts(_("%s error: the '%s' and '%s' options conflict\n")); +#line 217 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 430 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 38 "../alias.c" + puts(_("-equivalence")); +#line 469 "../find.c" + puts(_("%s: illegal option -- %c\n")); +#line 110 "../reset.c" + puts(_("%s: illegal option -- %c\n")); +#line 271 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 755 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 118 "../reset.c" + puts(_("%s: illegal option -- %s\n")); +#line 335 "../find.c" + puts(_("%s: unknown vendor extension option -- %s\n")); +#line 160 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 170 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 750 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 1084 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 385 "../find.c" + puts(_("%s: invalid option name: %s\n")); +#line 527 "../find.c" + puts(_("%s: The '%s' option requires an argument.\n")); +#line 156 "../autoopts.c" + puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" + "\t'%s' and '%s'.")); +#line 94 "../check.c" + puts(_("%s error: The %s option is required\n")); +#line 632 "../find.c" + puts(_("%s: The '%s' option cannot have an argument.\n")); +#line 151 "../check.c" + puts(_("%s: Command line arguments are not allowed.\n")); +#line 536 "../save.c" + puts(_("error %d (%s) creating %s\n")); +#line 235 "../enum.c" + puts(_("%s error: '%s' does not match any %s keywords.\n")); +#line 93 "../reset.c" + puts(_("%s error: The '%s' option requires an argument.\n")); +#line 186 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 239 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 143 "../restore.c" + puts(_("%s error: no saved option state\n")); +#line 231 "../autoopts.c" + puts(_("'%s' is not a command line option.\n")); +#line 113 "../time.c" + puts(_("%s error: '%s' is not a recognizable date/time.\n")); +#line 131 "../save.c" + puts(_("'%s' not defined\n")); +#line 50 "../time.c" + puts(_("%s error: '%s' is not a recognizable time duration.\n")); +#line 92 "../check.c" + puts(_("%s error: The %s option must appear %d times.\n")); +#line 165 "../numeric.c" + puts(_("%s error: '%s' is not a recognizable number.\n")); +#line 201 "../enum.c" + puts(_("%s error: %s exceeds %s keyword count\n")); +#line 333 "../usage.c" + puts(_("Try '%s %s' for more information.\n")); +#line 45 "../alias.c" + puts(_("one %s%s option allowed\n")); +#line 208 "../makeshell.c" + puts(_("standard output")); +#line 943 "../makeshell.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard output")); +#line 418 "../usage.c" + puts(_("standard output")); +#line 628 "../usage.c" + puts(_("standard output")); +#line 175 "../version.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard error")); +#line 418 "../usage.c" + puts(_("standard error")); +#line 628 "../usage.c" + puts(_("standard error")); +#line 175 "../version.c" + puts(_("standard error")); +#line 208 "../makeshell.c" + puts(_("write")); +#line 943 "../makeshell.c" + puts(_("write")); +#line 276 "../usage.c" + puts(_("write")); +#line 417 "../usage.c" + puts(_("write")); +#line 627 "../usage.c" + puts(_("write")); +#line 174 "../version.c" + puts(_("write")); +#line 60 "../numeric.c" + puts(_("%s error: %s option value %ld is out of range.\n")); +#line 44 "../check.c" + puts(_("%s error: %s option requires the %s option\n")); +#line 130 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 185 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 238 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 257 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 535 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); + /* END-LIBOPTS-MESSAGES */ + + /* USAGE-TEXT: */ +#line 876 "../usage.c" + puts(_("\t\t\t\t- an alternate for '%s'\n")); +#line 1151 "../usage.c" + puts(_("Version, usage and configuration options:")); +#line 927 "../usage.c" + puts(_("\t\t\t\t- default option for unnamed options\n")); +#line 840 "../usage.c" + puts(_("\t\t\t\t- disabled as '--%s'\n")); +#line 1120 "../usage.c" + puts(_(" --- %-14s %s\n")); +#line 1118 "../usage.c" + puts(_("This option has been disabled")); +#line 867 "../usage.c" + puts(_("\t\t\t\t- enabled by default\n")); +#line 40 "../alias.c" + puts(_("%s error: only ")); +#line 1197 "../usage.c" + puts(_(" - examining environment variables named %s_*\n")); +#line 168 "../file.c" + puts(_("\t\t\t\t- file must not pre-exist\n")); +#line 172 "../file.c" + puts(_("\t\t\t\t- file must pre-exist\n")); +#line 383 "../usage.c" + puts(_("Options are specified by doubled hyphens and their name or by a single\n" + "hyphen and the flag character.\n")); +#line 921 "../makeshell.c" + puts(_("\n" + "= = = = = = = =\n\n" + "This incarnation of genshell will produce\n" + "a shell script to parse the options for %s:\n\n")); +#line 167 "../enum.c" + puts(_(" or an integer mask with any of the lower %d bits set\n")); +#line 900 "../usage.c" + puts(_("\t\t\t\t- is a set membership option\n")); +#line 921 "../usage.c" + puts(_("\t\t\t\t- must appear between %d and %d times\n")); +#line 385 "../usage.c" + puts(_("Options are specified by single or double hyphens and their name.\n")); +#line 907 "../usage.c" + puts(_("\t\t\t\t- may appear multiple times\n")); +#line 894 "../usage.c" + puts(_("\t\t\t\t- may not be preset\n")); +#line 1312 "../usage.c" + puts(_(" Arg Option-Name Description\n")); +#line 1248 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1306 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1307 "../usage.c" + puts(_(" %3s %s")); +#line 1313 "../usage.c" + puts(_(" %3s %s")); +#line 390 "../usage.c" + puts(_("The '-#<number>' option may omit the hash char\n")); +#line 386 "../usage.c" + puts(_("All arguments are named options.\n")); +#line 974 "../usage.c" + puts(_(" - reading file %s")); +#line 412 "../usage.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 100 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 129 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 906 "../usage.c" + puts(_("\t\t\t\t- may NOT appear - preset only\n")); +#line 947 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 1195 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 685 "../usage.c" + puts(_("prohibits these options:\n")); +#line 680 "../usage.c" + puts(_("prohibits the option '%s'\n")); +#line 81 "../numeric.c" + puts(_("%s%ld to %ld")); +#line 79 "../numeric.c" + puts(_("%sgreater than or equal to %ld")); +#line 75 "../numeric.c" + puts(_("%s%ld exactly")); +#line 68 "../numeric.c" + puts(_("%sit must lie in one of the ranges:\n")); +#line 68 "../numeric.c" + puts(_("%sit must be in the range:\n")); +#line 88 "../numeric.c" + puts(_(", or\n")); +#line 66 "../numeric.c" + puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); +#line 77 "../numeric.c" + puts(_("%sless than or equal to %ld")); +#line 393 "../usage.c" + puts(_("Operands and options may be intermixed. They will be reordered.\n")); +#line 655 "../usage.c" + puts(_("requires the option '%s'\n")); +#line 658 "../usage.c" + puts(_("requires these options:\n")); +#line 1324 "../usage.c" + puts(_(" Arg Option-Name Req? Description\n")); +#line 1318 "../usage.c" + puts(_(" Flg Arg Option-Name Req? Description\n")); +#line 168 "../enum.c" + puts(_("or you may use a numeric representation. Preceding these with a '!'\n" + "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" + "will set them all. Multiple entries may be passed as an option\n" + "argument list.\n")); +#line 913 "../usage.c" + puts(_("\t\t\t\t- may appear up to %d times\n")); +#line 77 "../enum.c" + puts(_("The valid \"%s\" option keywords are:\n")); +#line 1155 "../usage.c" + puts(_("The next option supports vendor supported extra options:")); +#line 776 "../usage.c" + puts(_("These additional options are:")); + /* END-USAGE-TEXT */ +} +#endif /* uncompilable code */ +#ifdef __cplusplus +} +#endif +/* serv-args.c ends here */ diff --git a/src/serv-args.h.bak b/src/serv-args.h.bak new file mode 100644 index 0000000000..d2ca546b91 --- /dev/null +++ b/src/serv-args.h.bak @@ -0,0 +1,293 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (serv-args.h) + * + * It has been AutoGen-ed + * From the definitions serv-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the gnutls-serv author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The gnutls-serv program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * gnutls-serv is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * gnutls-serv is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ +/** + * This file contains the programmatic interface to the Automated + * Options generated for the gnutls-serv program. + * These macros are documented in the AutoGen info file in the + * "AutoOpts" chapter. Please refer to that doc for usage help. + */ +#ifndef AUTOOPTS_SERV_ARGS_H_GUARD +#define AUTOOPTS_SERV_ARGS_H_GUARD 1 +#include "config.h" +#include <autoopts/options.h> + +/** + * Ensure that the library used for compiling this generated header is at + * least as new as the version current when the header template was released + * (not counting patch version increments). Also ensure that the oldest + * tolerable version is at least as old as what was current when the header + * template was released. + */ +#define AO_TEMPLATE_VERSION 167937 +#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ + || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) +# error option template version mismatches autoopts/options.h header + Choke Me. +#endif + +/** + * Enumeration of each option type for gnutls-serv + */ +typedef enum { + INDEX_OPT_DEBUG = 0, + INDEX_OPT_SNI_HOSTNAME = 1, + INDEX_OPT_SNI_HOSTNAME_FATAL = 2, + INDEX_OPT_NOTICKET = 3, + INDEX_OPT_GENERATE = 4, + INDEX_OPT_QUIET = 5, + INDEX_OPT_NODB = 6, + INDEX_OPT_HTTP = 7, + INDEX_OPT_ECHO = 8, + INDEX_OPT_UDP = 9, + INDEX_OPT_MTU = 10, + INDEX_OPT_SRTP_PROFILES = 11, + INDEX_OPT_DISABLE_CLIENT_CERT = 12, + INDEX_OPT_REQUIRE_CLIENT_CERT = 13, + INDEX_OPT_VERIFY_CLIENT_CERT = 14, + INDEX_OPT_HEARTBEAT = 15, + INDEX_OPT_X509FMTDER = 16, + INDEX_OPT_PRIORITY = 17, + INDEX_OPT_DHPARAMS = 18, + INDEX_OPT_X509CAFILE = 19, + INDEX_OPT_X509CRLFILE = 20, + INDEX_OPT_PGPKEYFILE = 21, + INDEX_OPT_PGPKEYRING = 22, + INDEX_OPT_PGPCERTFILE = 23, + INDEX_OPT_X509KEYFILE = 24, + INDEX_OPT_X509CERTFILE = 25, + INDEX_OPT_X509DSAKEYFILE = 26, + INDEX_OPT_X509DSACERTFILE = 27, + INDEX_OPT_X509ECCKEYFILE = 28, + INDEX_OPT_X509ECCCERTFILE = 29, + INDEX_OPT_PGPSUBKEY = 30, + INDEX_OPT_SRPPASSWD = 31, + INDEX_OPT_SRPPASSWDCONF = 32, + INDEX_OPT_PSKPASSWD = 33, + INDEX_OPT_PSKHINT = 34, + INDEX_OPT_OCSP_RESPONSE = 35, + INDEX_OPT_PORT = 36, + INDEX_OPT_LIST = 37, + INDEX_OPT_PROVIDER = 38, + INDEX_OPT_VERSION = 39, + INDEX_OPT_HELP = 40, + INDEX_OPT_MORE_HELP = 41 +} teOptIndex; +/** count of all options for gnutls-serv */ +#define OPTION_CT 42 +/** gnutls-serv version */ +#define GNUTLS_SERV_VERSION "@VERSION@" +/** Full gnutls-serv version text */ +#define GNUTLS_SERV_FULL_VERSION "gnutls-serv @VERSION@" + +/** + * Interface defines for all options. Replace "n" with the UPPER_CASED + * option name (as in the teOptIndex enumeration above). + * e.g. HAVE_OPT(DEBUG) + */ +#define DESC(n) (gnutls_servOptions.pOptDesc[INDEX_OPT_## n]) +/** 'true' if an option has been specified in any way */ +#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) +/** The string argument to an option. The argument type must be \"string\". */ +#define OPT_ARG(n) (DESC(n).optArg.argString) +/** Mask the option state revealing how an option was specified. + * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET, + * \a OPTST_DEFINED, \a OPTST_RESET or zero. + */ +#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) +/** Count of option's occurrances *on the command line*. */ +#define COUNT_OPT(n) (DESC(n).optOccCt) +/** mask of \a OPTST_SET and \a OPTST_DEFINED. */ +#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) +/** 'true' if \a HAVE_OPT would yield 'false'. */ +#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) +/** 'true' if OPTST_DISABLED bit not set. */ +#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) +/** number of stacked option arguments. + * Valid only for stacked option arguments. */ +#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) +/** stacked argument vector. + * Valid only for stacked option arguments. */ +#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) +/** Reset an option. */ +#define CLEAR_OPT(n) STMTS( \ + DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + DESC(n).fOptState |= OPTST_DISABLED; \ + DESC(n).optCookie = NULL ) +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Enumeration of gnutls-serv exit codes + */ +typedef enum { + GNUTLS_SERV_EXIT_SUCCESS = 0, + GNUTLS_SERV_EXIT_FAILURE = 1, + GNUTLS_SERV_EXIT_USAGE_ERROR = 64, + GNUTLS_SERV_EXIT_LIBOPTS_FAILURE = 70 +} gnutls_serv_exit_code_t; +/** + * Interface defines for specific options. + * @{ + */ +#define VALUE_OPT_DEBUG 'd' + +#define OPT_VALUE_DEBUG (DESC(DEBUG).optArg.argInt) +#define VALUE_OPT_SNI_HOSTNAME 0x1001 +#define VALUE_OPT_SNI_HOSTNAME_FATAL 0x1002 +#define VALUE_OPT_NOTICKET 0x1003 +#define VALUE_OPT_GENERATE 'g' +#define VALUE_OPT_QUIET 'q' +#define VALUE_OPT_NODB 0x1004 +#define VALUE_OPT_HTTP 0x1005 +#define VALUE_OPT_ECHO 0x1006 +#define VALUE_OPT_UDP 'u' +#define VALUE_OPT_MTU 0x1007 + +#define OPT_VALUE_MTU (DESC(MTU).optArg.argInt) +#define VALUE_OPT_SRTP_PROFILES 0x1008 +#define VALUE_OPT_DISABLE_CLIENT_CERT 'a' +#define VALUE_OPT_REQUIRE_CLIENT_CERT 'r' +#define VALUE_OPT_VERIFY_CLIENT_CERT 0x1009 +#define VALUE_OPT_HEARTBEAT 'b' +#define VALUE_OPT_X509FMTDER 0x100A +#define VALUE_OPT_PRIORITY 0x100B +#define VALUE_OPT_DHPARAMS 0x100C +#define VALUE_OPT_X509CAFILE 0x100D +#define VALUE_OPT_X509CRLFILE 0x100E +#define VALUE_OPT_PGPKEYFILE 0x100F +#define VALUE_OPT_PGPKEYRING 0x1010 +#define VALUE_OPT_PGPCERTFILE 0x1011 +#define VALUE_OPT_X509KEYFILE 0x1012 +#define VALUE_OPT_X509CERTFILE 0x1013 +#define VALUE_OPT_X509DSAKEYFILE 0x1014 +#define VALUE_OPT_X509DSACERTFILE 0x1015 +#define VALUE_OPT_X509ECCKEYFILE 0x1016 +#define VALUE_OPT_X509ECCCERTFILE 0x1017 +#define VALUE_OPT_PGPSUBKEY 0x1018 +#define VALUE_OPT_SRPPASSWD 0x1019 +#define VALUE_OPT_SRPPASSWDCONF 0x101A +#define VALUE_OPT_PSKPASSWD 0x101B +#define VALUE_OPT_PSKHINT 0x101C +#define VALUE_OPT_OCSP_RESPONSE 0x101D +#define VALUE_OPT_PORT 'p' + +#define OPT_VALUE_PORT (DESC(PORT).optArg.argInt) +#define VALUE_OPT_LIST 'l' +#define VALUE_OPT_PROVIDER 0x101E +/** option flag (value) for help-value option */ +#define VALUE_OPT_HELP 'h' +/** option flag (value) for more-help-value option */ +#define VALUE_OPT_MORE_HELP '!' +/** option flag (value) for version-value option */ +#define VALUE_OPT_VERSION 'v' +/* + * Interface defines not associated with particular options + */ +#define ERRSKIP_OPTERR STMTS(gnutls_servOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(gnutls_servOptions.fOptSet |= OPTPROC_ERRSTOP) +#define RESTART_OPT(n) STMTS( \ + gnutls_servOptions.curOptIdx = (n); \ + gnutls_servOptions.pzCurOpt = NULL ) +#define START_OPT RESTART_OPT(1) +#define USAGE(c) (*gnutls_servOptions.pUsageProc)(&gnutls_servOptions, c) + +#ifdef __cplusplus +extern "C" { +#endif +/* + * global exported definitions + */ +#include <gettext.h> + + +/* * * * * * + * + * Declare the gnutls-serv option descriptor. + */ +extern tOptions gnutls_servOptions; + +#if defined(ENABLE_NLS) +# ifndef _ +# include <stdio.h> +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include <libintl.h> +# endif + +# ifndef ATTRIBUTE_FORMAT_ARG +# define ATTRIBUTE_FORMAT_ARG(_a) +# endif + +static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1); +static inline char* aoGetsText(char const* pz) { + if (pz == NULL) return NULL; + return (char*)gettext(pz); +} +# define _(s) aoGetsText(s) +# endif /* _() */ + +# define OPT_NO_XLAT_CFG_NAMES STMTS(gnutls_servOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT_CFG;) +# define OPT_NO_XLAT_OPT_NAMES STMTS(gnutls_servOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) + +# define OPT_XLAT_CFG_NAMES STMTS(gnutls_servOptions.fOptSet &= \ + ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) +# define OPT_XLAT_OPT_NAMES STMTS(gnutls_servOptions.fOptSet &= \ + ~OPTPROC_NXLAT_OPT;) + +#else /* ENABLE_NLS */ +# define OPT_NO_XLAT_CFG_NAMES +# define OPT_NO_XLAT_OPT_NAMES + +# define OPT_XLAT_CFG_NAMES +# define OPT_XLAT_OPT_NAMES + +# ifndef _ +# define _(_s) _s +# endif +#endif /* ENABLE_NLS */ + +#ifdef __cplusplus +} +#endif +#endif /* AUTOOPTS_SERV_ARGS_H_GUARD */ + +/* serv-args.h ends here */ diff --git a/src/srptool-args.c.bak b/src/srptool-args.c.bak new file mode 100644 index 0000000000..57cab549a4 --- /dev/null +++ b/src/srptool-args.c.bak @@ -0,0 +1,1067 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (srptool-args.c) + * + * It has been AutoGen-ed + * From the definitions srptool-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the srptool author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The srptool program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * srptool is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * srptool is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "srptool-args.h" +#include <sys/types.h> + +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> + +#ifdef __cplusplus +extern "C" { +#endif +extern FILE * option_usage_fp; +#define zCopyright (srptool_opt_strs+0) +#define zLicenseDescrip (srptool_opt_strs+288) + + +#ifndef NULL +# define NULL 0 +#endif + +/** + * static const strings for srptool options + */ +static char const srptool_opt_strs[2037] = +/* 0 */ "srptool @VERSION@\n" + "Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n" + "This is free software. It is licensed for use, modification and\n" + "redistribution under the terms of the GNU General Public License,\n" + "version 3 or later <http://gnu.org/licenses/gpl.html>\n\0" +/* 288 */ "srptool is free software: you can redistribute it and/or modify it under\n" + "the terms of the GNU General Public License as published by the Free\n" + "Software Foundation, either version 3 of the License, or (at your option)\n" + "any later version.\n\n" + "srptool is distributed in the hope that it will be useful, but WITHOUT ANY\n" + "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n" + "FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n" + "details.\n\n" + "You should have received a copy of the GNU General Public License along\n" + "with this program. If not, see <http://www.gnu.org/licenses/>.\n\0" +/* 891 */ "Enable debugging\0" +/* 908 */ "DEBUG\0" +/* 914 */ "debug\0" +/* 920 */ "specify the index of the group parameters in tpasswd.conf to use\0" +/* 985 */ "INDEX\0" +/* 991 */ "index\0" +/* 997 */ "specify a username\0" +/* 1016 */ "USERNAME\0" +/* 1025 */ "username\0" +/* 1034 */ "specify a password file\0" +/* 1058 */ "PASSWD\0" +/* 1065 */ "passwd\0" +/* 1072 */ "specify salt size\0" +/* 1090 */ "SALT\0" +/* 1095 */ "salt\0" +/* 1100 */ "just verify the password.\0" +/* 1126 */ "VERIFY\0" +/* 1133 */ "verify\0" +/* 1140 */ "specify a password conf file.\0" +/* 1170 */ "PASSWD_CONF\0" +/* 1182 */ "passwd-conf\0" +/* 1194 */ "Generate a password configuration file.\0" +/* 1234 */ "CREATE_CONF\0" +/* 1246 */ "create-conf\0" +/* 1258 */ "display extended usage information and exit\0" +/* 1302 */ "help\0" +/* 1307 */ "extended usage information passed thru pager\0" +/* 1352 */ "more-help\0" +/* 1362 */ "output version information and exit\0" +/* 1398 */ "version\0" +/* 1406 */ "SRPTOOL\0" +/* 1414 */ "srptool - GnuTLS SRP tool\n" + "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0" +/* 1498 */ "@PACKAGE_BUGREPORT@\0" +/* 1518 */ "\n\0" +/* 1520 */ "Simple program that emulates the programs in the Stanford SRP (Secure\n" + "Remote Password) libraries using GnuTLS. It is intended for use in places\n" + "where you don't expect SRP authentication to be the used for system users.\n\n" + "In brief, to use SRP you need to create two files. These are the password\n" + "file that holds the users and the verifiers associated with them and the\n" + "configuration file to hold the group parameters (called tpasswd.conf).\n\0" +/* 1961 */ "srptool @VERSION@\0" +/* 1979 */ "srptool [options]\n" + "srptool --help for usage instructions.\n"; + +/** + * debug option description: + */ +/** Descriptive text for the debug option */ +#define DEBUG_DESC (srptool_opt_strs+891) +/** Upper-cased name for the debug option */ +#define DEBUG_NAME (srptool_opt_strs+908) +/** Name string for the debug option */ +#define DEBUG_name (srptool_opt_strs+914) +/** Compiled in flag settings for the debug option */ +#define DEBUG_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * index option description: + */ +/** Descriptive text for the index option */ +#define INDEX_DESC (srptool_opt_strs+920) +/** Upper-cased name for the index option */ +#define INDEX_NAME (srptool_opt_strs+985) +/** Name string for the index option */ +#define INDEX_name (srptool_opt_strs+991) +/** The compiled in default value for the index option argument */ +#define INDEX_DFT_ARG ((char const*)1) +/** Compiled in flag settings for the index option */ +#define INDEX_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * username option description: + */ +/** Descriptive text for the username option */ +#define USERNAME_DESC (srptool_opt_strs+997) +/** Upper-cased name for the username option */ +#define USERNAME_NAME (srptool_opt_strs+1016) +/** Name string for the username option */ +#define USERNAME_name (srptool_opt_strs+1025) +/** Compiled in flag settings for the username option */ +#define USERNAME_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * passwd option description: + */ +/** Descriptive text for the passwd option */ +#define PASSWD_DESC (srptool_opt_strs+1034) +/** Upper-cased name for the passwd option */ +#define PASSWD_NAME (srptool_opt_strs+1058) +/** Name string for the passwd option */ +#define PASSWD_name (srptool_opt_strs+1065) +/** Compiled in flag settings for the passwd option */ +#define PASSWD_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * salt option description: + */ +/** Descriptive text for the salt option */ +#define SALT_DESC (srptool_opt_strs+1072) +/** Upper-cased name for the salt option */ +#define SALT_NAME (srptool_opt_strs+1090) +/** Name string for the salt option */ +#define SALT_name (srptool_opt_strs+1095) +/** Compiled in flag settings for the salt option */ +#define SALT_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * verify option description: + */ +/** Descriptive text for the verify option */ +#define VERIFY_DESC (srptool_opt_strs+1100) +/** Upper-cased name for the verify option */ +#define VERIFY_NAME (srptool_opt_strs+1126) +/** Name string for the verify option */ +#define VERIFY_name (srptool_opt_strs+1133) +/** Compiled in flag settings for the verify option */ +#define VERIFY_FLAGS (OPTST_DISABLED) + +/** + * passwd-conf option description: + */ +/** Descriptive text for the passwd-conf option */ +#define PASSWD_CONF_DESC (srptool_opt_strs+1140) +/** Upper-cased name for the passwd-conf option */ +#define PASSWD_CONF_NAME (srptool_opt_strs+1170) +/** Name string for the passwd-conf option */ +#define PASSWD_CONF_name (srptool_opt_strs+1182) +/** Compiled in flag settings for the passwd-conf option */ +#define PASSWD_CONF_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * create-conf option description: + */ +/** Descriptive text for the create-conf option */ +#define CREATE_CONF_DESC (srptool_opt_strs+1194) +/** Upper-cased name for the create-conf option */ +#define CREATE_CONF_NAME (srptool_opt_strs+1234) +/** Name string for the create-conf option */ +#define CREATE_CONF_name (srptool_opt_strs+1246) +/** Compiled in flag settings for the create-conf option */ +#define CREATE_CONF_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/* + * Help/More_Help/Version option descriptions: + */ +#define HELP_DESC (srptool_opt_strs+1258) +#define HELP_name (srptool_opt_strs+1302) +#ifdef HAVE_WORKING_FORK +#define MORE_HELP_DESC (srptool_opt_strs+1307) +#define MORE_HELP_name (srptool_opt_strs+1352) +#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +#define MORE_HELP_DESC HELP_DESC +#define MORE_HELP_name HELP_name +#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#endif +#ifdef NO_OPTIONAL_OPT_ARGS +# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ + OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) +#endif +#define VER_DESC (srptool_opt_strs+1362) +#define VER_name (srptool_opt_strs+1398) +/** + * Declare option callback procedures + */ +extern tOptProc + optionBooleanVal, optionNestedVal, optionNumericVal, + optionPagedUsage, optionPrintVersion, optionResetOpt, + optionStackArg, optionTimeDate, optionTimeVal, + optionUnstackArg, optionVendorOption; +static tOptProc + doOptDebug, doUsageOpt; +#define VER_PROC optionPrintVersion + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the srptool Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the srptool program responds to. + */ +static tOptDesc optDesc[OPTION_CT] = { + { /* entry idx, value */ 0, VALUE_OPT_DEBUG, + /* equiv idx, value */ 0, VALUE_OPT_DEBUG, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DEBUG_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --debug */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptDebug, + /* desc, NAME, name */ DEBUG_DESC, DEBUG_NAME, DEBUG_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 1, VALUE_OPT_INDEX, + /* equiv idx, value */ 1, VALUE_OPT_INDEX, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INDEX_FLAGS, 0, + /* last opt argumnt */ { INDEX_DFT_ARG }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionNumericVal, + /* desc, NAME, name */ INDEX_DESC, INDEX_NAME, INDEX_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 2, VALUE_OPT_USERNAME, + /* equiv idx, value */ 2, VALUE_OPT_USERNAME, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ USERNAME_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --username */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ USERNAME_DESC, USERNAME_NAME, USERNAME_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 3, VALUE_OPT_PASSWD, + /* equiv idx, value */ 3, VALUE_OPT_PASSWD, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PASSWD_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --passwd */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PASSWD_DESC, PASSWD_NAME, PASSWD_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 4, VALUE_OPT_SALT, + /* equiv idx, value */ 4, VALUE_OPT_SALT, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SALT_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --salt */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionNumericVal, + /* desc, NAME, name */ SALT_DESC, SALT_NAME, SALT_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 5, VALUE_OPT_VERIFY, + /* equiv idx, value */ 5, VALUE_OPT_VERIFY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VERIFY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --verify */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ VERIFY_DESC, VERIFY_NAME, VERIFY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 6, VALUE_OPT_PASSWD_CONF, + /* equiv idx, value */ 6, VALUE_OPT_PASSWD_CONF, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PASSWD_CONF_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --passwd-conf */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PASSWD_CONF_DESC, PASSWD_CONF_NAME, PASSWD_CONF_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 7, VALUE_OPT_CREATE_CONF, + /* equiv idx, value */ 7, VALUE_OPT_CREATE_CONF, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ CREATE_CONF_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --create-conf */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ CREATE_CONF_DESC, CREATE_CONF_NAME, CREATE_CONF_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VER_FLAGS, AOUSE_VERSION, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ VER_PROC, + /* desc, NAME, name */ VER_DESC, NULL, VER_name, + /* disablement strs */ NULL, NULL }, + + + + { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doUsageOpt, + /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionPagedUsage, + /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, + /* disablement strs */ NULL, NULL } +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** Reference to the upper cased version of srptool. */ +#define zPROGNAME (srptool_opt_strs+1406) +/** Reference to the title line for srptool usage. */ +#define zUsageTitle (srptool_opt_strs+1414) +/** There is no srptool configuration file. */ +#define zRcName NULL +/** There are no directories to search for srptool config files. */ +#define apzHomeList NULL +/** The srptool program bug email address. */ +#define zBugsAddr (srptool_opt_strs+1498) +/** Clarification/explanation of what srptool does. */ +#define zExplain (srptool_opt_strs+1518) +/** Extra detail explaining what srptool does. */ +#define zDetail (srptool_opt_strs+1520) +/** The full version string for srptool. */ +#define zFullVersion (srptool_opt_strs+1961) +/* extracted from optcode.tlib near line 364 */ + +#if defined(ENABLE_NLS) +# define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT + static tOptionXlateProc translate_option_strings; +#else +# define OPTPROC_BASE OPTPROC_NONE +# define translate_option_strings NULL +#endif /* ENABLE_NLS */ + +#define srptool_full_usage (NULL) +#define srptool_short_usage (srptool_opt_strs+1979) + +#endif /* not defined __doxygen__ */ + +/* + * Create the static procedure(s) declared above. + */ +/** + * The callout function that invokes the optionUsage function. + * + * @param[in] opts the AutoOpts option description structure + * @param[in] od the descriptor for the "help" (usage) option. + * @noreturn + */ +static void +doUsageOpt(tOptions * opts, tOptDesc * od) +{ + int ex_code; + ex_code = SRPTOOL_EXIT_SUCCESS; + optionUsage(&srptoolOptions, ex_code); + /* NOTREACHED */ + exit(SRPTOOL_EXIT_FAILURE); + (void)opts; + (void)od; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the debug option. + * Specifies the debug level. + * @param[in] pOptions the srptool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptDebug(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[1] = { + { 0 , 9999 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 1; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + + emit_ranges: +optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); +} +/* extracted from optmain.tlib near line 1250 */ + +/** + * The directory containing the data associated with srptool. + */ +#ifndef PKGDATADIR +# define PKGDATADIR "" +#endif + +/** + * Information about the person or institution that packaged srptool + * for the current distribution. + */ +#ifndef WITH_PACKAGER +# define srptool_packager_info NULL +#else +/** Packager information for srptool. */ +static char const srptool_packager_info[] = + "Packaged by " WITH_PACKAGER + +# ifdef WITH_PACKAGER_VERSION + " ("WITH_PACKAGER_VERSION")" +# endif + +# ifdef WITH_PACKAGER_BUG_REPORTS + "\nReport srptool bugs to " WITH_PACKAGER_BUG_REPORTS +# endif + "\n"; +#endif +#ifndef __doxygen__ + +#endif /* __doxygen__ */ +/** + * The option definitions for srptool. The one structure that + * binds them all. + */ +tOptions srptoolOptions = { + OPTIONS_STRUCT_VERSION, + 0, NULL, /* original argc + argv */ + ( OPTPROC_BASE + + OPTPROC_ERRSTOP + + OPTPROC_SHORTOPT + + OPTPROC_LONGOPT + + OPTPROC_NO_REQ_OPT + + OPTPROC_NO_ARGS + + OPTPROC_GNUUSAGE + + OPTPROC_MISUSE ), + 0, NULL, /* current option index, current option */ + NULL, NULL, zPROGNAME, + zRcName, zCopyright, zLicenseDescrip, + zFullVersion, apzHomeList, zUsageTitle, + zExplain, zDetail, optDesc, + zBugsAddr, /* address to send bugs to */ + NULL, NULL, /* extensions/saved state */ + optionUsage, /* usage procedure */ + translate_option_strings, /* translation procedure */ + /* + * Indexes to special options + */ + { INDEX_OPT_MORE_HELP, /* more-help option index */ + NO_EQUIVALENT, /* save option index */ + NO_EQUIVALENT, /* '-#' option index */ + NO_EQUIVALENT /* index of default opt */ + }, + 11 /* full option count */, 8 /* user option count */, + srptool_full_usage, srptool_short_usage, + NULL, NULL, + PKGDATADIR, srptool_packager_info +}; + +#if ENABLE_NLS +/** + * This code is designed to translate translatable option text for the + * srptool program. These translations happen upon entry + * to optionProcess(). + */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#ifdef HAVE_DCGETTEXT +# include <gettext.h> +#endif +#include <autoopts/usage-txt.h> + +static char * AO_gettext(char const * pz); +static void coerce_it(void ** s); + +/** + * AutoGen specific wrapper function for gettext. It relies on the macro _() + * to convert from English to the target language, then strdup-duplicates the + * result string. It tries the "libopts" domain first, then whatever has been + * set via the \a textdomain(3) call. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * +AO_gettext(char const * pz) +{ + char * res; + if (pz == NULL) + return NULL; +#ifdef HAVE_DCGETTEXT + /* + * While processing the option_xlateable_txt data, try to use the + * "libopts" domain. Once we switch to the option descriptor data, + * do *not* use that domain. + */ + if (option_xlateable_txt.field_ct != 0) { + res = dgettext("libopts", pz); + if (res == pz) + res = (char *)VOIDP(_(pz)); + } else + res = (char *)VOIDP(_(pz)); +#else + res = (char *)VOIDP(_(pz)); +#endif + if (res == pz) + return res; + res = strdup(res); + if (res == NULL) { + fputs(_("No memory for duping translated strings\n"), stderr); + exit(SRPTOOL_EXIT_FAILURE); + } + return res; +} + +/** + * All the pointers we use are marked "* const", but they are stored in + * writable memory. Coerce the mutability and set the pointer. + */ +static void coerce_it(void ** s) { *s = AO_gettext(*s); +} + +/** + * Translate all the translatable strings in the srptoolOptions + * structure defined above. This is done only once. + */ +static void +translate_option_strings(void) +{ + tOptions * const opts = &srptoolOptions; + + /* + * Guard against re-translation. It won't work. The strings will have + * been changed by the first pass through this code. One shot only. + */ + if (option_xlateable_txt.field_ct != 0) { + /* + * Do the translations. The first pointer follows the field count + * field. The field count field is the size of a pointer. + */ + char ** ppz = (char**)VOIDP(&(option_xlateable_txt)); + int ix = option_xlateable_txt.field_ct; + + do { + ppz++; /* skip over field_ct */ + *ppz = AO_gettext(*ppz); + } while (--ix > 0); + /* prevent re-translation and disable "libopts" domain lookup */ + option_xlateable_txt.field_ct = 0; + + coerce_it(VOIDP(&(opts->pzCopyright))); + coerce_it(VOIDP(&(opts->pzCopyNotice))); + coerce_it(VOIDP(&(opts->pzFullVersion))); + coerce_it(VOIDP(&(opts->pzUsageTitle))); + coerce_it(VOIDP(&(opts->pzExplain))); + coerce_it(VOIDP(&(opts->pzDetail))); + { + tOptDesc * od = opts->pOptDesc; + for (ix = opts->optCt; ix > 0; ix--, od++) + coerce_it(VOIDP(&(od->pzText))); + } + } +} +#endif /* ENABLE_NLS */ + +#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT +/** I18N function strictly for xgettext. Do not compile. */ +static void bogus_function(void) { + /* TRANSLATORS: + + The following dummy function was crated solely so that xgettext can + extract the correct strings. These strings are actually referenced + by a field name in the srptoolOptions structure noted in the + comments below. The literal text is defined in srptool_opt_strs. + + NOTE: the strings below are segmented with respect to the source string + srptool_opt_strs. The strings above are handed off for translation + at run time a paragraph at a time. Consequently, they are presented here + for translation a paragraph at a time. + + ALSO: often the description for an option will reference another option + by name. These are set off with apostrophe quotes (I hope). Do not + translate option names. + */ + /* referenced via srptoolOptions.pzCopyright */ + puts(_("srptool @VERSION@\n\ +Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n\ +This is free software. It is licensed for use, modification and\n\ +redistribution under the terms of the GNU General Public License,\n\ +version 3 or later <http://gnu.org/licenses/gpl.html>\n")); + + /* referenced via srptoolOptions.pzCopyNotice */ + puts(_("srptool is free software: you can redistribute it and/or modify it under\n\ +the terms of the GNU General Public License as published by the Free\n\ +Software Foundation, either version 3 of the License, or (at your option)\n\ +any later version.\n\n")); + puts(_("srptool is distributed in the hope that it will be useful, but WITHOUT ANY\n\ +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n\ +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n\ +details.\n\n")); + puts(_("You should have received a copy of the GNU General Public License along\n\ +with this program. If not, see <http://www.gnu.org/licenses/>.\n")); + + /* referenced via srptoolOptions.pOptDesc->pzText */ + puts(_("Enable debugging")); + + /* referenced via srptoolOptions.pOptDesc->pzText */ + puts(_("specify the index of the group parameters in tpasswd.conf to use")); + + /* referenced via srptoolOptions.pOptDesc->pzText */ + puts(_("specify a username")); + + /* referenced via srptoolOptions.pOptDesc->pzText */ + puts(_("specify a password file")); + + /* referenced via srptoolOptions.pOptDesc->pzText */ + puts(_("specify salt size")); + + /* referenced via srptoolOptions.pOptDesc->pzText */ + puts(_("just verify the password.")); + + /* referenced via srptoolOptions.pOptDesc->pzText */ + puts(_("specify a password conf file.")); + + /* referenced via srptoolOptions.pOptDesc->pzText */ + puts(_("Generate a password configuration file.")); + + /* referenced via srptoolOptions.pOptDesc->pzText */ + puts(_("display extended usage information and exit")); + + /* referenced via srptoolOptions.pOptDesc->pzText */ + puts(_("extended usage information passed thru pager")); + + /* referenced via srptoolOptions.pOptDesc->pzText */ + puts(_("output version information and exit")); + + /* referenced via srptoolOptions.pzUsageTitle */ + puts(_("srptool - GnuTLS SRP tool\n\ +Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n")); + + /* referenced via srptoolOptions.pzExplain */ + puts(_("\n")); + + /* referenced via srptoolOptions.pzDetail */ + puts(_("Simple program that emulates the programs in the Stanford SRP (Secure\n\ +Remote Password) libraries using GnuTLS. It is intended for use in places\n\ +where you don't expect SRP authentication to be the used for system users.\n\n")); + puts(_("In brief, to use SRP you need to create two files. These are the password\n\ +file that holds the users and the verifiers associated with them and the\n\ +configuration file to hold the group parameters (called tpasswd.conf).\n")); + + /* referenced via srptoolOptions.pzFullVersion */ + puts(_("srptool @VERSION@")); + + /* referenced via srptoolOptions.pzFullUsage */ + puts(_("<<<NOT-FOUND>>>")); + + /* referenced via srptoolOptions.pzShortUsage */ + puts(_("srptool [options]\n\ +srptool --help for usage instructions.\n")); + /* LIBOPTS-MESSAGES: */ +#line 67 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 93 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 53 "../init.c" + puts(_("AutoOpts function called without option descriptor\n")); +#line 86 "../init.c" + puts(_("\tThis exceeds the compiled library version: ")); +#line 84 "../init.c" + puts(_("Automated Options Processing Error!\n" + "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); +#line 80 "../autoopts.c" + puts(_("realloc of %d bytes at 0x%p failed\n")); +#line 88 "../init.c" + puts(_("\tThis is less than the minimum library version: ")); +#line 121 "../version.c" + puts(_("Automated Options version %s\n" + "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); +#line 87 "../makeshell.c" + puts(_("(AutoOpts bug): %s.\n")); +#line 90 "../reset.c" + puts(_("optionResetOpt() called, but reset-option not configured")); +#line 295 "../usage.c" + puts(_("could not locate the 'help' option")); +#line 336 "../autoopts.c" + puts(_("optionProcess() was called with invalid data")); +#line 751 "../usage.c" + puts(_("invalid argument type specified")); +#line 598 "../find.c" + puts(_("defaulted to option with optional arg")); +#line 76 "../alias.c" + puts(_("aliasing option is out of range.")); +#line 235 "../enum.c" + puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); +#line 108 "../find.c" + puts(_(" The following options match:\n")); +#line 293 "../find.c" + puts(_("%s: ambiguous option name: %s (matches %d options)\n")); +#line 161 "../check.c" + puts(_("%s: Command line arguments required\n")); +#line 43 "../alias.c" + puts(_("%d %s%s options allowed\n")); +#line 94 "../makeshell.c" + puts(_("%s error %d (%s) calling %s for '%s'\n")); +#line 306 "../makeshell.c" + puts(_("interprocess pipe")); +#line 168 "../version.c" + puts(_("error: version option argument '%c' invalid. Use:\n" + "\t'v' - version only\n" + "\t'c' - version and copyright\n" + "\t'n' - version and full copyright notice\n")); +#line 58 "../check.c" + puts(_("%s error: the '%s' and '%s' options conflict\n")); +#line 217 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 430 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 38 "../alias.c" + puts(_("-equivalence")); +#line 469 "../find.c" + puts(_("%s: illegal option -- %c\n")); +#line 110 "../reset.c" + puts(_("%s: illegal option -- %c\n")); +#line 271 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 755 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 118 "../reset.c" + puts(_("%s: illegal option -- %s\n")); +#line 335 "../find.c" + puts(_("%s: unknown vendor extension option -- %s\n")); +#line 160 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 170 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 750 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 1084 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 385 "../find.c" + puts(_("%s: invalid option name: %s\n")); +#line 527 "../find.c" + puts(_("%s: The '%s' option requires an argument.\n")); +#line 156 "../autoopts.c" + puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" + "\t'%s' and '%s'.")); +#line 94 "../check.c" + puts(_("%s error: The %s option is required\n")); +#line 632 "../find.c" + puts(_("%s: The '%s' option cannot have an argument.\n")); +#line 151 "../check.c" + puts(_("%s: Command line arguments are not allowed.\n")); +#line 536 "../save.c" + puts(_("error %d (%s) creating %s\n")); +#line 235 "../enum.c" + puts(_("%s error: '%s' does not match any %s keywords.\n")); +#line 93 "../reset.c" + puts(_("%s error: The '%s' option requires an argument.\n")); +#line 186 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 239 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 143 "../restore.c" + puts(_("%s error: no saved option state\n")); +#line 231 "../autoopts.c" + puts(_("'%s' is not a command line option.\n")); +#line 113 "../time.c" + puts(_("%s error: '%s' is not a recognizable date/time.\n")); +#line 131 "../save.c" + puts(_("'%s' not defined\n")); +#line 50 "../time.c" + puts(_("%s error: '%s' is not a recognizable time duration.\n")); +#line 92 "../check.c" + puts(_("%s error: The %s option must appear %d times.\n")); +#line 165 "../numeric.c" + puts(_("%s error: '%s' is not a recognizable number.\n")); +#line 201 "../enum.c" + puts(_("%s error: %s exceeds %s keyword count\n")); +#line 333 "../usage.c" + puts(_("Try '%s %s' for more information.\n")); +#line 45 "../alias.c" + puts(_("one %s%s option allowed\n")); +#line 208 "../makeshell.c" + puts(_("standard output")); +#line 943 "../makeshell.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard output")); +#line 418 "../usage.c" + puts(_("standard output")); +#line 628 "../usage.c" + puts(_("standard output")); +#line 175 "../version.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard error")); +#line 418 "../usage.c" + puts(_("standard error")); +#line 628 "../usage.c" + puts(_("standard error")); +#line 175 "../version.c" + puts(_("standard error")); +#line 208 "../makeshell.c" + puts(_("write")); +#line 943 "../makeshell.c" + puts(_("write")); +#line 276 "../usage.c" + puts(_("write")); +#line 417 "../usage.c" + puts(_("write")); +#line 627 "../usage.c" + puts(_("write")); +#line 174 "../version.c" + puts(_("write")); +#line 60 "../numeric.c" + puts(_("%s error: %s option value %ld is out of range.\n")); +#line 44 "../check.c" + puts(_("%s error: %s option requires the %s option\n")); +#line 130 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 185 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 238 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 257 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 535 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); + /* END-LIBOPTS-MESSAGES */ + + /* USAGE-TEXT: */ +#line 876 "../usage.c" + puts(_("\t\t\t\t- an alternate for '%s'\n")); +#line 1151 "../usage.c" + puts(_("Version, usage and configuration options:")); +#line 927 "../usage.c" + puts(_("\t\t\t\t- default option for unnamed options\n")); +#line 840 "../usage.c" + puts(_("\t\t\t\t- disabled as '--%s'\n")); +#line 1120 "../usage.c" + puts(_(" --- %-14s %s\n")); +#line 1118 "../usage.c" + puts(_("This option has been disabled")); +#line 867 "../usage.c" + puts(_("\t\t\t\t- enabled by default\n")); +#line 40 "../alias.c" + puts(_("%s error: only ")); +#line 1197 "../usage.c" + puts(_(" - examining environment variables named %s_*\n")); +#line 168 "../file.c" + puts(_("\t\t\t\t- file must not pre-exist\n")); +#line 172 "../file.c" + puts(_("\t\t\t\t- file must pre-exist\n")); +#line 383 "../usage.c" + puts(_("Options are specified by doubled hyphens and their name or by a single\n" + "hyphen and the flag character.\n")); +#line 921 "../makeshell.c" + puts(_("\n" + "= = = = = = = =\n\n" + "This incarnation of genshell will produce\n" + "a shell script to parse the options for %s:\n\n")); +#line 167 "../enum.c" + puts(_(" or an integer mask with any of the lower %d bits set\n")); +#line 900 "../usage.c" + puts(_("\t\t\t\t- is a set membership option\n")); +#line 921 "../usage.c" + puts(_("\t\t\t\t- must appear between %d and %d times\n")); +#line 385 "../usage.c" + puts(_("Options are specified by single or double hyphens and their name.\n")); +#line 907 "../usage.c" + puts(_("\t\t\t\t- may appear multiple times\n")); +#line 894 "../usage.c" + puts(_("\t\t\t\t- may not be preset\n")); +#line 1312 "../usage.c" + puts(_(" Arg Option-Name Description\n")); +#line 1248 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1306 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1307 "../usage.c" + puts(_(" %3s %s")); +#line 1313 "../usage.c" + puts(_(" %3s %s")); +#line 390 "../usage.c" + puts(_("The '-#<number>' option may omit the hash char\n")); +#line 386 "../usage.c" + puts(_("All arguments are named options.\n")); +#line 974 "../usage.c" + puts(_(" - reading file %s")); +#line 412 "../usage.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 100 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 129 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 906 "../usage.c" + puts(_("\t\t\t\t- may NOT appear - preset only\n")); +#line 947 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 1195 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 685 "../usage.c" + puts(_("prohibits these options:\n")); +#line 680 "../usage.c" + puts(_("prohibits the option '%s'\n")); +#line 81 "../numeric.c" + puts(_("%s%ld to %ld")); +#line 79 "../numeric.c" + puts(_("%sgreater than or equal to %ld")); +#line 75 "../numeric.c" + puts(_("%s%ld exactly")); +#line 68 "../numeric.c" + puts(_("%sit must lie in one of the ranges:\n")); +#line 68 "../numeric.c" + puts(_("%sit must be in the range:\n")); +#line 88 "../numeric.c" + puts(_(", or\n")); +#line 66 "../numeric.c" + puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); +#line 77 "../numeric.c" + puts(_("%sless than or equal to %ld")); +#line 393 "../usage.c" + puts(_("Operands and options may be intermixed. They will be reordered.\n")); +#line 655 "../usage.c" + puts(_("requires the option '%s'\n")); +#line 658 "../usage.c" + puts(_("requires these options:\n")); +#line 1324 "../usage.c" + puts(_(" Arg Option-Name Req? Description\n")); +#line 1318 "../usage.c" + puts(_(" Flg Arg Option-Name Req? Description\n")); +#line 168 "../enum.c" + puts(_("or you may use a numeric representation. Preceding these with a '!'\n" + "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" + "will set them all. Multiple entries may be passed as an option\n" + "argument list.\n")); +#line 913 "../usage.c" + puts(_("\t\t\t\t- may appear up to %d times\n")); +#line 77 "../enum.c" + puts(_("The valid \"%s\" option keywords are:\n")); +#line 1155 "../usage.c" + puts(_("The next option supports vendor supported extra options:")); +#line 776 "../usage.c" + puts(_("These additional options are:")); + /* END-USAGE-TEXT */ +} +#endif /* uncompilable code */ +#ifdef __cplusplus +} +#endif +/* srptool-args.c ends here */ diff --git a/src/srptool-args.h.bak b/src/srptool-args.h.bak new file mode 100644 index 0000000000..6abdea8796 --- /dev/null +++ b/src/srptool-args.h.bak @@ -0,0 +1,231 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (srptool-args.h) + * + * It has been AutoGen-ed + * From the definitions srptool-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the srptool author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The srptool program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * srptool is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * srptool is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ +/** + * This file contains the programmatic interface to the Automated + * Options generated for the srptool program. + * These macros are documented in the AutoGen info file in the + * "AutoOpts" chapter. Please refer to that doc for usage help. + */ +#ifndef AUTOOPTS_SRPTOOL_ARGS_H_GUARD +#define AUTOOPTS_SRPTOOL_ARGS_H_GUARD 1 +#include "config.h" +#include <autoopts/options.h> + +/** + * Ensure that the library used for compiling this generated header is at + * least as new as the version current when the header template was released + * (not counting patch version increments). Also ensure that the oldest + * tolerable version is at least as old as what was current when the header + * template was released. + */ +#define AO_TEMPLATE_VERSION 167937 +#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ + || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) +# error option template version mismatches autoopts/options.h header + Choke Me. +#endif + +/** + * Enumeration of each option type for srptool + */ +typedef enum { + INDEX_OPT_DEBUG = 0, + INDEX_OPT_INDEX = 1, + INDEX_OPT_USERNAME = 2, + INDEX_OPT_PASSWD = 3, + INDEX_OPT_SALT = 4, + INDEX_OPT_VERIFY = 5, + INDEX_OPT_PASSWD_CONF = 6, + INDEX_OPT_CREATE_CONF = 7, + INDEX_OPT_VERSION = 8, + INDEX_OPT_HELP = 9, + INDEX_OPT_MORE_HELP = 10 +} teOptIndex; +/** count of all options for srptool */ +#define OPTION_CT 11 +/** srptool version */ +#define SRPTOOL_VERSION "@VERSION@" +/** Full srptool version text */ +#define SRPTOOL_FULL_VERSION "srptool @VERSION@" + +/** + * Interface defines for all options. Replace "n" with the UPPER_CASED + * option name (as in the teOptIndex enumeration above). + * e.g. HAVE_OPT(DEBUG) + */ +#define DESC(n) (srptoolOptions.pOptDesc[INDEX_OPT_## n]) +/** 'true' if an option has been specified in any way */ +#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) +/** The string argument to an option. The argument type must be \"string\". */ +#define OPT_ARG(n) (DESC(n).optArg.argString) +/** Mask the option state revealing how an option was specified. + * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET, + * \a OPTST_DEFINED, \a OPTST_RESET or zero. + */ +#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) +/** Count of option's occurrances *on the command line*. */ +#define COUNT_OPT(n) (DESC(n).optOccCt) +/** mask of \a OPTST_SET and \a OPTST_DEFINED. */ +#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) +/** 'true' if \a HAVE_OPT would yield 'false'. */ +#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) +/** 'true' if OPTST_DISABLED bit not set. */ +#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) +/** number of stacked option arguments. + * Valid only for stacked option arguments. */ +#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) +/** stacked argument vector. + * Valid only for stacked option arguments. */ +#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) +/** Reset an option. */ +#define CLEAR_OPT(n) STMTS( \ + DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + DESC(n).fOptState |= OPTST_DISABLED; \ + DESC(n).optCookie = NULL ) +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Enumeration of srptool exit codes + */ +typedef enum { + SRPTOOL_EXIT_SUCCESS = 0, + SRPTOOL_EXIT_FAILURE = 1, + SRPTOOL_EXIT_USAGE_ERROR = 64, + SRPTOOL_EXIT_LIBOPTS_FAILURE = 70 +} srptool_exit_code_t; +/** + * Interface defines for specific options. + * @{ + */ +#define VALUE_OPT_DEBUG 'd' + +#define OPT_VALUE_DEBUG (DESC(DEBUG).optArg.argInt) +#define VALUE_OPT_INDEX 'i' + +#define OPT_VALUE_INDEX (DESC(INDEX).optArg.argInt) +#define VALUE_OPT_USERNAME 'u' +#define VALUE_OPT_PASSWD 'p' +#define VALUE_OPT_SALT 's' + +#define OPT_VALUE_SALT (DESC(SALT).optArg.argInt) +#define VALUE_OPT_VERIFY 0x1001 +#define VALUE_OPT_PASSWD_CONF 'v' +#define VALUE_OPT_CREATE_CONF 0x1002 +/** option flag (value) for help-value option */ +#define VALUE_OPT_HELP 'h' +/** option flag (value) for more-help-value option */ +#define VALUE_OPT_MORE_HELP '!' +/** option flag (value) for version-value option */ +#define VALUE_OPT_VERSION 'v' +/* + * Interface defines not associated with particular options + */ +#define ERRSKIP_OPTERR STMTS(srptoolOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(srptoolOptions.fOptSet |= OPTPROC_ERRSTOP) +#define RESTART_OPT(n) STMTS( \ + srptoolOptions.curOptIdx = (n); \ + srptoolOptions.pzCurOpt = NULL ) +#define START_OPT RESTART_OPT(1) +#define USAGE(c) (*srptoolOptions.pUsageProc)(&srptoolOptions, c) + +#ifdef __cplusplus +extern "C" { +#endif +/* + * global exported definitions + */ +#include <gettext.h> + + +/* * * * * * + * + * Declare the srptool option descriptor. + */ +extern tOptions srptoolOptions; + +#if defined(ENABLE_NLS) +# ifndef _ +# include <stdio.h> +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include <libintl.h> +# endif + +# ifndef ATTRIBUTE_FORMAT_ARG +# define ATTRIBUTE_FORMAT_ARG(_a) +# endif + +static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1); +static inline char* aoGetsText(char const* pz) { + if (pz == NULL) return NULL; + return (char*)gettext(pz); +} +# define _(s) aoGetsText(s) +# endif /* _() */ + +# define OPT_NO_XLAT_CFG_NAMES STMTS(srptoolOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT_CFG;) +# define OPT_NO_XLAT_OPT_NAMES STMTS(srptoolOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) + +# define OPT_XLAT_CFG_NAMES STMTS(srptoolOptions.fOptSet &= \ + ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) +# define OPT_XLAT_OPT_NAMES STMTS(srptoolOptions.fOptSet &= \ + ~OPTPROC_NXLAT_OPT;) + +#else /* ENABLE_NLS */ +# define OPT_NO_XLAT_CFG_NAMES +# define OPT_NO_XLAT_OPT_NAMES + +# define OPT_XLAT_CFG_NAMES +# define OPT_XLAT_OPT_NAMES + +# ifndef _ +# define _(_s) _s +# endif +#endif /* ENABLE_NLS */ + +#ifdef __cplusplus +} +#endif +#endif /* AUTOOPTS_SRPTOOL_ARGS_H_GUARD */ + +/* srptool-args.h ends here */ diff --git a/src/systemkey-args.c.bak b/src/systemkey-args.c.bak new file mode 100644 index 0000000000..7f0f872ab5 --- /dev/null +++ b/src/systemkey-args.c.bak @@ -0,0 +1,1058 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (systemkey-args.c) + * + * It has been AutoGen-ed + * From the definitions systemkey-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the systemkey-tool author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The systemkey-tool program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * systemkey-tool is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * systemkey-tool is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "systemkey-args.h" +#include <sys/types.h> + +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> + +#ifdef __cplusplus +extern "C" { +#endif +extern FILE * option_usage_fp; +#define zCopyright (systemkey_tool_opt_strs+0) +#define zLicenseDescrip (systemkey_tool_opt_strs+295) + + +#ifndef NULL +# define NULL 0 +#endif + +/** + * static const strings for systemkey-tool options + */ +static char const systemkey_tool_opt_strs[1642] = +/* 0 */ "systemkey-tool @VERSION@\n" + "Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n" + "This is free software. It is licensed for use, modification and\n" + "redistribution under the terms of the GNU General Public License,\n" + "version 3 or later <http://gnu.org/licenses/gpl.html>\n\0" +/* 295 */ "systemkey-tool is free software: you can redistribute it and/or modify it\n" + "under the terms of the GNU General Public License as published by the Free\n" + "Software Foundation, either version 3 of the License, or (at your option)\n" + "any later version.\n\n" + "systemkey-tool is distributed in the hope that it will be useful, but\n" + "WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n" + "or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n" + "for more details.\n\n" + "You should have received a copy of the GNU General Public License along\n" + "with this program. If not, see <http://www.gnu.org/licenses/>.\n\0" +/* 912 */ "Enable debugging\0" +/* 929 */ "DEBUG\0" +/* 935 */ "debug\0" +/* 941 */ "Input file\0" +/* 952 */ "INFILE\0" +/* 959 */ "infile\0" +/* 966 */ "Output file\0" +/* 978 */ "OUTFILE\0" +/* 986 */ "outfile\0" +/* 994 */ "Lists all stored keys.\0" +/* 1017 */ "LIST\0" +/* 1022 */ "list\0" +/* 1027 */ "Delete the key identified by the given URL.\0" +/* 1071 */ "DELETE\0" +/* 1078 */ "delete\0" +/* 1085 */ "Use the DER format for keys.\0" +/* 1114 */ "INDER\0" +/* 1120 */ "no-inder\0" +/* 1129 */ "no\0" +/* 1132 */ "Use DER format for output keys\0" +/* 1163 */ "OUTDER\0" +/* 1170 */ "no-outder\0" +/* 1180 */ "display extended usage information and exit\0" +/* 1224 */ "help\0" +/* 1229 */ "extended usage information passed thru pager\0" +/* 1274 */ "more-help\0" +/* 1284 */ "output version information and exit\0" +/* 1320 */ "version\0" +/* 1328 */ "SYSTEMKEY_TOOL\0" +/* 1343 */ "systemkey-tool - GnuTLS system key tool\n" + "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0" +/* 1441 */ "@PACKAGE_BUGREPORT@\0" +/* 1461 */ "\n\0" +/* 1463 */ "Program that allows handling user keys as stored in the system in a uniform\n" + "way.\n\0" +/* 1545 */ "systemkey-tool @VERSION@\0" +/* 1570 */ "systemkey-tool [options]\n" + "systemkey-tool --help for usage instructions.\n"; + +/** + * debug option description: + */ +/** Descriptive text for the debug option */ +#define DEBUG_DESC (systemkey_tool_opt_strs+912) +/** Upper-cased name for the debug option */ +#define DEBUG_NAME (systemkey_tool_opt_strs+929) +/** Name string for the debug option */ +#define DEBUG_name (systemkey_tool_opt_strs+935) +/** Compiled in flag settings for the debug option */ +#define DEBUG_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * infile option description: + */ +/** Descriptive text for the infile option */ +#define INFILE_DESC (systemkey_tool_opt_strs+941) +/** Upper-cased name for the infile option */ +#define INFILE_NAME (systemkey_tool_opt_strs+952) +/** Name string for the infile option */ +#define INFILE_name (systemkey_tool_opt_strs+959) +/** Compiled in flag settings for the infile option */ +#define INFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * outfile option description: + */ +/** Descriptive text for the outfile option */ +#define OUTFILE_DESC (systemkey_tool_opt_strs+966) +/** Upper-cased name for the outfile option */ +#define OUTFILE_NAME (systemkey_tool_opt_strs+978) +/** Name string for the outfile option */ +#define OUTFILE_name (systemkey_tool_opt_strs+986) +/** Compiled in flag settings for the outfile option */ +#define OUTFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * list option description: + */ +/** Descriptive text for the list option */ +#define LIST_DESC (systemkey_tool_opt_strs+994) +/** Upper-cased name for the list option */ +#define LIST_NAME (systemkey_tool_opt_strs+1017) +/** Name string for the list option */ +#define LIST_name (systemkey_tool_opt_strs+1022) +/** Compiled in flag settings for the list option */ +#define LIST_FLAGS (OPTST_DISABLED) + +/** + * delete option description: + */ +/** Descriptive text for the delete option */ +#define DELETE_DESC (systemkey_tool_opt_strs+1027) +/** Upper-cased name for the delete option */ +#define DELETE_NAME (systemkey_tool_opt_strs+1071) +/** Name string for the delete option */ +#define DELETE_name (systemkey_tool_opt_strs+1078) +/** Compiled in flag settings for the delete option */ +#define DELETE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * inder option description: + */ +/** Descriptive text for the inder option */ +#define INDER_DESC (systemkey_tool_opt_strs+1085) +/** Upper-cased name for the inder option */ +#define INDER_NAME (systemkey_tool_opt_strs+1114) +/** disablement name for the inder option */ +#define NOT_INDER_name (systemkey_tool_opt_strs+1120) +/** disablement prefix for the inder option */ +#define NOT_INDER_PFX (systemkey_tool_opt_strs+1129) +/** Name string for the inder option */ +#define INDER_name (NOT_INDER_name + 3) +/** Compiled in flag settings for the inder option */ +#define INDER_FLAGS (OPTST_DISABLED) + +/** + * outder option description: + */ +/** Descriptive text for the outder option */ +#define OUTDER_DESC (systemkey_tool_opt_strs+1132) +/** Upper-cased name for the outder option */ +#define OUTDER_NAME (systemkey_tool_opt_strs+1163) +/** disablement name for the outder option */ +#define NOT_OUTDER_name (systemkey_tool_opt_strs+1170) +/** disablement prefix for the outder option */ +#define NOT_OUTDER_PFX (systemkey_tool_opt_strs+1129) +/** Name string for the outder option */ +#define OUTDER_name (NOT_OUTDER_name + 3) +/** Compiled in flag settings for the outder option */ +#define OUTDER_FLAGS (OPTST_DISABLED) + +/* + * Help/More_Help/Version option descriptions: + */ +#define HELP_DESC (systemkey_tool_opt_strs+1180) +#define HELP_name (systemkey_tool_opt_strs+1224) +#ifdef HAVE_WORKING_FORK +#define MORE_HELP_DESC (systemkey_tool_opt_strs+1229) +#define MORE_HELP_name (systemkey_tool_opt_strs+1274) +#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +#define MORE_HELP_DESC HELP_DESC +#define MORE_HELP_name HELP_name +#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#endif +#ifdef NO_OPTIONAL_OPT_ARGS +# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ + OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) +#endif +#define VER_DESC (systemkey_tool_opt_strs+1284) +#define VER_name (systemkey_tool_opt_strs+1320) +/** + * Declare option callback procedures + */ +extern tOptProc + optionBooleanVal, optionNestedVal, optionNumericVal, + optionPagedUsage, optionPrintVersion, optionResetOpt, + optionStackArg, optionTimeDate, optionTimeVal, + optionUnstackArg, optionVendorOption; +static tOptProc + doOptDebug, doOptInfile, doUsageOpt; +#define VER_PROC optionPrintVersion + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the systemkey-tool Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the systemkey-tool program responds to. + */ +static tOptDesc optDesc[OPTION_CT] = { + { /* entry idx, value */ 0, VALUE_OPT_DEBUG, + /* equiv idx, value */ 0, VALUE_OPT_DEBUG, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DEBUG_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --debug */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptDebug, + /* desc, NAME, name */ DEBUG_DESC, DEBUG_NAME, DEBUG_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 1, VALUE_OPT_INFILE, + /* equiv idx, value */ 1, VALUE_OPT_INFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --infile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptInfile, + /* desc, NAME, name */ INFILE_DESC, INFILE_NAME, INFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 2, VALUE_OPT_OUTFILE, + /* equiv idx, value */ 2, VALUE_OPT_OUTFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OUTFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --outfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ OUTFILE_DESC, OUTFILE_NAME, OUTFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 3, VALUE_OPT_LIST, + /* equiv idx, value */ 3, VALUE_OPT_LIST, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LIST_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --list */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LIST_DESC, LIST_NAME, LIST_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 4, VALUE_OPT_DELETE, + /* equiv idx, value */ 4, VALUE_OPT_DELETE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DELETE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --delete */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ DELETE_DESC, DELETE_NAME, DELETE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 5, VALUE_OPT_INDER, + /* equiv idx, value */ 5, VALUE_OPT_INDER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INDER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --inder */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ INDER_DESC, INDER_NAME, INDER_name, + /* disablement strs */ NOT_INDER_name, NOT_INDER_PFX }, + + { /* entry idx, value */ 6, VALUE_OPT_OUTDER, + /* equiv idx, value */ 6, VALUE_OPT_OUTDER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OUTDER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --outder */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ OUTDER_DESC, OUTDER_NAME, OUTDER_name, + /* disablement strs */ NOT_OUTDER_name, NOT_OUTDER_PFX }, + + { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VER_FLAGS, AOUSE_VERSION, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ VER_PROC, + /* desc, NAME, name */ VER_DESC, NULL, VER_name, + /* disablement strs */ NULL, NULL }, + + + + { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doUsageOpt, + /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionPagedUsage, + /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, + /* disablement strs */ NULL, NULL } +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** Reference to the upper cased version of systemkey-tool. */ +#define zPROGNAME (systemkey_tool_opt_strs+1328) +/** Reference to the title line for systemkey-tool usage. */ +#define zUsageTitle (systemkey_tool_opt_strs+1343) +/** There is no systemkey-tool configuration file. */ +#define zRcName NULL +/** There are no directories to search for systemkey-tool config files. */ +#define apzHomeList NULL +/** The systemkey-tool program bug email address. */ +#define zBugsAddr (systemkey_tool_opt_strs+1441) +/** Clarification/explanation of what systemkey-tool does. */ +#define zExplain (systemkey_tool_opt_strs+1461) +/** Extra detail explaining what systemkey-tool does. */ +#define zDetail (systemkey_tool_opt_strs+1463) +/** The full version string for systemkey-tool. */ +#define zFullVersion (systemkey_tool_opt_strs+1545) +/* extracted from optcode.tlib near line 364 */ + +#if defined(ENABLE_NLS) +# define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT + static tOptionXlateProc translate_option_strings; +#else +# define OPTPROC_BASE OPTPROC_NONE +# define translate_option_strings NULL +#endif /* ENABLE_NLS */ + +#define systemkey_tool_full_usage (NULL) +#define systemkey_tool_short_usage (systemkey_tool_opt_strs+1570) + +#endif /* not defined __doxygen__ */ + +/* + * Create the static procedure(s) declared above. + */ +/** + * The callout function that invokes the optionUsage function. + * + * @param[in] opts the AutoOpts option description structure + * @param[in] od the descriptor for the "help" (usage) option. + * @noreturn + */ +static void +doUsageOpt(tOptions * opts, tOptDesc * od) +{ + int ex_code; + ex_code = SYSTEMKEY_TOOL_EXIT_SUCCESS; + optionUsage(&systemkey_toolOptions, ex_code); + /* NOTREACHED */ + exit(SYSTEMKEY_TOOL_EXIT_FAILURE); + (void)opts; + (void)od; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the debug option. + * Specifies the debug level. + * @param[in] pOptions the systemkey-tool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptDebug(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[1] = { + { 0 , 9999 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 1; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + + emit_ranges: +optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the infile option. + * + * @param[in] pOptions the systemkey-tool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptInfile(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} +/* extracted from optmain.tlib near line 1250 */ + +/** + * The directory containing the data associated with systemkey-tool. + */ +#ifndef PKGDATADIR +# define PKGDATADIR "" +#endif + +/** + * Information about the person or institution that packaged systemkey-tool + * for the current distribution. + */ +#ifndef WITH_PACKAGER +# define systemkey_tool_packager_info NULL +#else +/** Packager information for systemkey-tool. */ +static char const systemkey_tool_packager_info[] = + "Packaged by " WITH_PACKAGER + +# ifdef WITH_PACKAGER_VERSION + " ("WITH_PACKAGER_VERSION")" +# endif + +# ifdef WITH_PACKAGER_BUG_REPORTS + "\nReport systemkey_tool bugs to " WITH_PACKAGER_BUG_REPORTS +# endif + "\n"; +#endif +#ifndef __doxygen__ + +#endif /* __doxygen__ */ +/** + * The option definitions for systemkey-tool. The one structure that + * binds them all. + */ +tOptions systemkey_toolOptions = { + OPTIONS_STRUCT_VERSION, + 0, NULL, /* original argc + argv */ + ( OPTPROC_BASE + + OPTPROC_ERRSTOP + + OPTPROC_SHORTOPT + + OPTPROC_LONGOPT + + OPTPROC_NO_REQ_OPT + + OPTPROC_NEGATIONS + + OPTPROC_NO_ARGS + + OPTPROC_GNUUSAGE + + OPTPROC_MISUSE ), + 0, NULL, /* current option index, current option */ + NULL, NULL, zPROGNAME, + zRcName, zCopyright, zLicenseDescrip, + zFullVersion, apzHomeList, zUsageTitle, + zExplain, zDetail, optDesc, + zBugsAddr, /* address to send bugs to */ + NULL, NULL, /* extensions/saved state */ + optionUsage, /* usage procedure */ + translate_option_strings, /* translation procedure */ + /* + * Indexes to special options + */ + { INDEX_OPT_MORE_HELP, /* more-help option index */ + NO_EQUIVALENT, /* save option index */ + NO_EQUIVALENT, /* '-#' option index */ + NO_EQUIVALENT /* index of default opt */ + }, + 10 /* full option count */, 7 /* user option count */, + systemkey_tool_full_usage, systemkey_tool_short_usage, + NULL, NULL, + PKGDATADIR, systemkey_tool_packager_info +}; + +#if ENABLE_NLS +/** + * This code is designed to translate translatable option text for the + * systemkey-tool program. These translations happen upon entry + * to optionProcess(). + */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#ifdef HAVE_DCGETTEXT +# include <gettext.h> +#endif +#include <autoopts/usage-txt.h> + +static char * AO_gettext(char const * pz); +static void coerce_it(void ** s); + +/** + * AutoGen specific wrapper function for gettext. It relies on the macro _() + * to convert from English to the target language, then strdup-duplicates the + * result string. It tries the "libopts" domain first, then whatever has been + * set via the \a textdomain(3) call. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * +AO_gettext(char const * pz) +{ + char * res; + if (pz == NULL) + return NULL; +#ifdef HAVE_DCGETTEXT + /* + * While processing the option_xlateable_txt data, try to use the + * "libopts" domain. Once we switch to the option descriptor data, + * do *not* use that domain. + */ + if (option_xlateable_txt.field_ct != 0) { + res = dgettext("libopts", pz); + if (res == pz) + res = (char *)VOIDP(_(pz)); + } else + res = (char *)VOIDP(_(pz)); +#else + res = (char *)VOIDP(_(pz)); +#endif + if (res == pz) + return res; + res = strdup(res); + if (res == NULL) { + fputs(_("No memory for duping translated strings\n"), stderr); + exit(SYSTEMKEY_TOOL_EXIT_FAILURE); + } + return res; +} + +/** + * All the pointers we use are marked "* const", but they are stored in + * writable memory. Coerce the mutability and set the pointer. + */ +static void coerce_it(void ** s) { *s = AO_gettext(*s); +} + +/** + * Translate all the translatable strings in the systemkey_toolOptions + * structure defined above. This is done only once. + */ +static void +translate_option_strings(void) +{ + tOptions * const opts = &systemkey_toolOptions; + + /* + * Guard against re-translation. It won't work. The strings will have + * been changed by the first pass through this code. One shot only. + */ + if (option_xlateable_txt.field_ct != 0) { + /* + * Do the translations. The first pointer follows the field count + * field. The field count field is the size of a pointer. + */ + char ** ppz = (char**)VOIDP(&(option_xlateable_txt)); + int ix = option_xlateable_txt.field_ct; + + do { + ppz++; /* skip over field_ct */ + *ppz = AO_gettext(*ppz); + } while (--ix > 0); + /* prevent re-translation and disable "libopts" domain lookup */ + option_xlateable_txt.field_ct = 0; + + coerce_it(VOIDP(&(opts->pzCopyright))); + coerce_it(VOIDP(&(opts->pzCopyNotice))); + coerce_it(VOIDP(&(opts->pzFullVersion))); + coerce_it(VOIDP(&(opts->pzUsageTitle))); + coerce_it(VOIDP(&(opts->pzExplain))); + coerce_it(VOIDP(&(opts->pzDetail))); + { + tOptDesc * od = opts->pOptDesc; + for (ix = opts->optCt; ix > 0; ix--, od++) + coerce_it(VOIDP(&(od->pzText))); + } + } +} +#endif /* ENABLE_NLS */ + +#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT +/** I18N function strictly for xgettext. Do not compile. */ +static void bogus_function(void) { + /* TRANSLATORS: + + The following dummy function was crated solely so that xgettext can + extract the correct strings. These strings are actually referenced + by a field name in the systemkey_toolOptions structure noted in the + comments below. The literal text is defined in systemkey_tool_opt_strs. + + NOTE: the strings below are segmented with respect to the source string + systemkey_tool_opt_strs. The strings above are handed off for translation + at run time a paragraph at a time. Consequently, they are presented here + for translation a paragraph at a time. + + ALSO: often the description for an option will reference another option + by name. These are set off with apostrophe quotes (I hope). Do not + translate option names. + */ + /* referenced via systemkey_toolOptions.pzCopyright */ + puts(_("systemkey-tool @VERSION@\n\ +Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n\ +This is free software. It is licensed for use, modification and\n\ +redistribution under the terms of the GNU General Public License,\n\ +version 3 or later <http://gnu.org/licenses/gpl.html>\n")); + + /* referenced via systemkey_toolOptions.pzCopyNotice */ + puts(_("systemkey-tool is free software: you can redistribute it and/or modify it\n\ +under the terms of the GNU General Public License as published by the Free\n\ +Software Foundation, either version 3 of the License, or (at your option)\n\ +any later version.\n\n")); + puts(_("systemkey-tool is distributed in the hope that it will be useful, but\n\ +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n\ +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n\ +for more details.\n\n")); + puts(_("You should have received a copy of the GNU General Public License along\n\ +with this program. If not, see <http://www.gnu.org/licenses/>.\n")); + + /* referenced via systemkey_toolOptions.pOptDesc->pzText */ + puts(_("Enable debugging")); + + /* referenced via systemkey_toolOptions.pOptDesc->pzText */ + puts(_("Input file")); + + /* referenced via systemkey_toolOptions.pOptDesc->pzText */ + puts(_("Output file")); + + /* referenced via systemkey_toolOptions.pOptDesc->pzText */ + puts(_("Lists all stored keys.")); + + /* referenced via systemkey_toolOptions.pOptDesc->pzText */ + puts(_("Delete the key identified by the given URL.")); + + /* referenced via systemkey_toolOptions.pOptDesc->pzText */ + puts(_("Use the DER format for keys.")); + + /* referenced via systemkey_toolOptions.pOptDesc->pzText */ + puts(_("Use DER format for output keys")); + + /* referenced via systemkey_toolOptions.pOptDesc->pzText */ + puts(_("display extended usage information and exit")); + + /* referenced via systemkey_toolOptions.pOptDesc->pzText */ + puts(_("extended usage information passed thru pager")); + + /* referenced via systemkey_toolOptions.pOptDesc->pzText */ + puts(_("output version information and exit")); + + /* referenced via systemkey_toolOptions.pzUsageTitle */ + puts(_("systemkey-tool - GnuTLS system key tool\n\ +Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n")); + + /* referenced via systemkey_toolOptions.pzExplain */ + puts(_("\n")); + + /* referenced via systemkey_toolOptions.pzDetail */ + puts(_("Program that allows handling user keys as stored in the system in a uniform\n\ +way.\n")); + + /* referenced via systemkey_toolOptions.pzFullVersion */ + puts(_("systemkey-tool @VERSION@")); + + /* referenced via systemkey_toolOptions.pzFullUsage */ + puts(_("<<<NOT-FOUND>>>")); + + /* referenced via systemkey_toolOptions.pzShortUsage */ + puts(_("systemkey-tool [options]\n\ +systemkey-tool --help for usage instructions.\n")); + /* LIBOPTS-MESSAGES: */ +#line 67 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 93 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 53 "../init.c" + puts(_("AutoOpts function called without option descriptor\n")); +#line 86 "../init.c" + puts(_("\tThis exceeds the compiled library version: ")); +#line 84 "../init.c" + puts(_("Automated Options Processing Error!\n" + "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); +#line 80 "../autoopts.c" + puts(_("realloc of %d bytes at 0x%p failed\n")); +#line 88 "../init.c" + puts(_("\tThis is less than the minimum library version: ")); +#line 121 "../version.c" + puts(_("Automated Options version %s\n" + "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); +#line 87 "../makeshell.c" + puts(_("(AutoOpts bug): %s.\n")); +#line 90 "../reset.c" + puts(_("optionResetOpt() called, but reset-option not configured")); +#line 295 "../usage.c" + puts(_("could not locate the 'help' option")); +#line 336 "../autoopts.c" + puts(_("optionProcess() was called with invalid data")); +#line 751 "../usage.c" + puts(_("invalid argument type specified")); +#line 598 "../find.c" + puts(_("defaulted to option with optional arg")); +#line 76 "../alias.c" + puts(_("aliasing option is out of range.")); +#line 235 "../enum.c" + puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); +#line 108 "../find.c" + puts(_(" The following options match:\n")); +#line 293 "../find.c" + puts(_("%s: ambiguous option name: %s (matches %d options)\n")); +#line 161 "../check.c" + puts(_("%s: Command line arguments required\n")); +#line 43 "../alias.c" + puts(_("%d %s%s options allowed\n")); +#line 94 "../makeshell.c" + puts(_("%s error %d (%s) calling %s for '%s'\n")); +#line 306 "../makeshell.c" + puts(_("interprocess pipe")); +#line 168 "../version.c" + puts(_("error: version option argument '%c' invalid. Use:\n" + "\t'v' - version only\n" + "\t'c' - version and copyright\n" + "\t'n' - version and full copyright notice\n")); +#line 58 "../check.c" + puts(_("%s error: the '%s' and '%s' options conflict\n")); +#line 217 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 430 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 38 "../alias.c" + puts(_("-equivalence")); +#line 469 "../find.c" + puts(_("%s: illegal option -- %c\n")); +#line 110 "../reset.c" + puts(_("%s: illegal option -- %c\n")); +#line 271 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 755 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 118 "../reset.c" + puts(_("%s: illegal option -- %s\n")); +#line 335 "../find.c" + puts(_("%s: unknown vendor extension option -- %s\n")); +#line 160 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 170 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 750 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 1084 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 385 "../find.c" + puts(_("%s: invalid option name: %s\n")); +#line 527 "../find.c" + puts(_("%s: The '%s' option requires an argument.\n")); +#line 156 "../autoopts.c" + puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" + "\t'%s' and '%s'.")); +#line 94 "../check.c" + puts(_("%s error: The %s option is required\n")); +#line 632 "../find.c" + puts(_("%s: The '%s' option cannot have an argument.\n")); +#line 151 "../check.c" + puts(_("%s: Command line arguments are not allowed.\n")); +#line 536 "../save.c" + puts(_("error %d (%s) creating %s\n")); +#line 235 "../enum.c" + puts(_("%s error: '%s' does not match any %s keywords.\n")); +#line 93 "../reset.c" + puts(_("%s error: The '%s' option requires an argument.\n")); +#line 186 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 239 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 143 "../restore.c" + puts(_("%s error: no saved option state\n")); +#line 231 "../autoopts.c" + puts(_("'%s' is not a command line option.\n")); +#line 113 "../time.c" + puts(_("%s error: '%s' is not a recognizable date/time.\n")); +#line 131 "../save.c" + puts(_("'%s' not defined\n")); +#line 50 "../time.c" + puts(_("%s error: '%s' is not a recognizable time duration.\n")); +#line 92 "../check.c" + puts(_("%s error: The %s option must appear %d times.\n")); +#line 165 "../numeric.c" + puts(_("%s error: '%s' is not a recognizable number.\n")); +#line 201 "../enum.c" + puts(_("%s error: %s exceeds %s keyword count\n")); +#line 333 "../usage.c" + puts(_("Try '%s %s' for more information.\n")); +#line 45 "../alias.c" + puts(_("one %s%s option allowed\n")); +#line 208 "../makeshell.c" + puts(_("standard output")); +#line 943 "../makeshell.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard output")); +#line 418 "../usage.c" + puts(_("standard output")); +#line 628 "../usage.c" + puts(_("standard output")); +#line 175 "../version.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard error")); +#line 418 "../usage.c" + puts(_("standard error")); +#line 628 "../usage.c" + puts(_("standard error")); +#line 175 "../version.c" + puts(_("standard error")); +#line 208 "../makeshell.c" + puts(_("write")); +#line 943 "../makeshell.c" + puts(_("write")); +#line 276 "../usage.c" + puts(_("write")); +#line 417 "../usage.c" + puts(_("write")); +#line 627 "../usage.c" + puts(_("write")); +#line 174 "../version.c" + puts(_("write")); +#line 60 "../numeric.c" + puts(_("%s error: %s option value %ld is out of range.\n")); +#line 44 "../check.c" + puts(_("%s error: %s option requires the %s option\n")); +#line 130 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 185 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 238 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 257 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 535 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); + /* END-LIBOPTS-MESSAGES */ + + /* USAGE-TEXT: */ +#line 876 "../usage.c" + puts(_("\t\t\t\t- an alternate for '%s'\n")); +#line 1151 "../usage.c" + puts(_("Version, usage and configuration options:")); +#line 927 "../usage.c" + puts(_("\t\t\t\t- default option for unnamed options\n")); +#line 840 "../usage.c" + puts(_("\t\t\t\t- disabled as '--%s'\n")); +#line 1120 "../usage.c" + puts(_(" --- %-14s %s\n")); +#line 1118 "../usage.c" + puts(_("This option has been disabled")); +#line 867 "../usage.c" + puts(_("\t\t\t\t- enabled by default\n")); +#line 40 "../alias.c" + puts(_("%s error: only ")); +#line 1197 "../usage.c" + puts(_(" - examining environment variables named %s_*\n")); +#line 168 "../file.c" + puts(_("\t\t\t\t- file must not pre-exist\n")); +#line 172 "../file.c" + puts(_("\t\t\t\t- file must pre-exist\n")); +#line 383 "../usage.c" + puts(_("Options are specified by doubled hyphens and their name or by a single\n" + "hyphen and the flag character.\n")); +#line 921 "../makeshell.c" + puts(_("\n" + "= = = = = = = =\n\n" + "This incarnation of genshell will produce\n" + "a shell script to parse the options for %s:\n\n")); +#line 167 "../enum.c" + puts(_(" or an integer mask with any of the lower %d bits set\n")); +#line 900 "../usage.c" + puts(_("\t\t\t\t- is a set membership option\n")); +#line 921 "../usage.c" + puts(_("\t\t\t\t- must appear between %d and %d times\n")); +#line 385 "../usage.c" + puts(_("Options are specified by single or double hyphens and their name.\n")); +#line 907 "../usage.c" + puts(_("\t\t\t\t- may appear multiple times\n")); +#line 894 "../usage.c" + puts(_("\t\t\t\t- may not be preset\n")); +#line 1312 "../usage.c" + puts(_(" Arg Option-Name Description\n")); +#line 1248 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1306 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1307 "../usage.c" + puts(_(" %3s %s")); +#line 1313 "../usage.c" + puts(_(" %3s %s")); +#line 390 "../usage.c" + puts(_("The '-#<number>' option may omit the hash char\n")); +#line 386 "../usage.c" + puts(_("All arguments are named options.\n")); +#line 974 "../usage.c" + puts(_(" - reading file %s")); +#line 412 "../usage.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 100 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 129 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 906 "../usage.c" + puts(_("\t\t\t\t- may NOT appear - preset only\n")); +#line 947 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 1195 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 685 "../usage.c" + puts(_("prohibits these options:\n")); +#line 680 "../usage.c" + puts(_("prohibits the option '%s'\n")); +#line 81 "../numeric.c" + puts(_("%s%ld to %ld")); +#line 79 "../numeric.c" + puts(_("%sgreater than or equal to %ld")); +#line 75 "../numeric.c" + puts(_("%s%ld exactly")); +#line 68 "../numeric.c" + puts(_("%sit must lie in one of the ranges:\n")); +#line 68 "../numeric.c" + puts(_("%sit must be in the range:\n")); +#line 88 "../numeric.c" + puts(_(", or\n")); +#line 66 "../numeric.c" + puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); +#line 77 "../numeric.c" + puts(_("%sless than or equal to %ld")); +#line 393 "../usage.c" + puts(_("Operands and options may be intermixed. They will be reordered.\n")); +#line 655 "../usage.c" + puts(_("requires the option '%s'\n")); +#line 658 "../usage.c" + puts(_("requires these options:\n")); +#line 1324 "../usage.c" + puts(_(" Arg Option-Name Req? Description\n")); +#line 1318 "../usage.c" + puts(_(" Flg Arg Option-Name Req? Description\n")); +#line 168 "../enum.c" + puts(_("or you may use a numeric representation. Preceding these with a '!'\n" + "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" + "will set them all. Multiple entries may be passed as an option\n" + "argument list.\n")); +#line 913 "../usage.c" + puts(_("\t\t\t\t- may appear up to %d times\n")); +#line 77 "../enum.c" + puts(_("The valid \"%s\" option keywords are:\n")); +#line 1155 "../usage.c" + puts(_("The next option supports vendor supported extra options:")); +#line 776 "../usage.c" + puts(_("These additional options are:")); + /* END-USAGE-TEXT */ +} +#endif /* uncompilable code */ +#ifdef __cplusplus +} +#endif +/* systemkey-args.c ends here */ diff --git a/src/systemkey-args.h.bak b/src/systemkey-args.h.bak new file mode 100644 index 0000000000..a7972151fa --- /dev/null +++ b/src/systemkey-args.h.bak @@ -0,0 +1,225 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (systemkey-args.h) + * + * It has been AutoGen-ed + * From the definitions systemkey-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the systemkey-tool author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The systemkey-tool program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * systemkey-tool is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * systemkey-tool is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ +/** + * This file contains the programmatic interface to the Automated + * Options generated for the systemkey-tool program. + * These macros are documented in the AutoGen info file in the + * "AutoOpts" chapter. Please refer to that doc for usage help. + */ +#ifndef AUTOOPTS_SYSTEMKEY_ARGS_H_GUARD +#define AUTOOPTS_SYSTEMKEY_ARGS_H_GUARD 1 +#include "config.h" +#include <autoopts/options.h> + +/** + * Ensure that the library used for compiling this generated header is at + * least as new as the version current when the header template was released + * (not counting patch version increments). Also ensure that the oldest + * tolerable version is at least as old as what was current when the header + * template was released. + */ +#define AO_TEMPLATE_VERSION 167937 +#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ + || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) +# error option template version mismatches autoopts/options.h header + Choke Me. +#endif + +/** + * Enumeration of each option type for systemkey-tool + */ +typedef enum { + INDEX_OPT_DEBUG = 0, + INDEX_OPT_INFILE = 1, + INDEX_OPT_OUTFILE = 2, + INDEX_OPT_LIST = 3, + INDEX_OPT_DELETE = 4, + INDEX_OPT_INDER = 5, + INDEX_OPT_OUTDER = 6, + INDEX_OPT_VERSION = 7, + INDEX_OPT_HELP = 8, + INDEX_OPT_MORE_HELP = 9 +} teOptIndex; +/** count of all options for systemkey-tool */ +#define OPTION_CT 10 +/** systemkey-tool version */ +#define SYSTEMKEY_TOOL_VERSION "@VERSION@" +/** Full systemkey-tool version text */ +#define SYSTEMKEY_TOOL_FULL_VERSION "systemkey-tool @VERSION@" + +/** + * Interface defines for all options. Replace "n" with the UPPER_CASED + * option name (as in the teOptIndex enumeration above). + * e.g. HAVE_OPT(DEBUG) + */ +#define DESC(n) (systemkey_toolOptions.pOptDesc[INDEX_OPT_## n]) +/** 'true' if an option has been specified in any way */ +#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) +/** The string argument to an option. The argument type must be \"string\". */ +#define OPT_ARG(n) (DESC(n).optArg.argString) +/** Mask the option state revealing how an option was specified. + * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET, + * \a OPTST_DEFINED, \a OPTST_RESET or zero. + */ +#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) +/** Count of option's occurrances *on the command line*. */ +#define COUNT_OPT(n) (DESC(n).optOccCt) +/** mask of \a OPTST_SET and \a OPTST_DEFINED. */ +#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) +/** 'true' if \a HAVE_OPT would yield 'false'. */ +#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) +/** 'true' if OPTST_DISABLED bit not set. */ +#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) +/** number of stacked option arguments. + * Valid only for stacked option arguments. */ +#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) +/** stacked argument vector. + * Valid only for stacked option arguments. */ +#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) +/** Reset an option. */ +#define CLEAR_OPT(n) STMTS( \ + DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + DESC(n).fOptState |= OPTST_DISABLED; \ + DESC(n).optCookie = NULL ) +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Enumeration of systemkey-tool exit codes + */ +typedef enum { + SYSTEMKEY_TOOL_EXIT_SUCCESS = 0, + SYSTEMKEY_TOOL_EXIT_FAILURE = 1, + SYSTEMKEY_TOOL_EXIT_USAGE_ERROR = 64, + SYSTEMKEY_TOOL_EXIT_LIBOPTS_FAILURE = 70 +} systemkey_tool_exit_code_t; +/** + * Interface defines for specific options. + * @{ + */ +#define VALUE_OPT_DEBUG 'd' + +#define OPT_VALUE_DEBUG (DESC(DEBUG).optArg.argInt) +#define VALUE_OPT_INFILE 0x1001 +#define VALUE_OPT_OUTFILE 0x1002 +#define VALUE_OPT_LIST 0x1003 +#define VALUE_OPT_DELETE 0x1004 +#define VALUE_OPT_INDER 0x1005 +#define VALUE_OPT_OUTDER 0x1006 +/** option flag (value) for help-value option */ +#define VALUE_OPT_HELP 'h' +/** option flag (value) for more-help-value option */ +#define VALUE_OPT_MORE_HELP '!' +/** option flag (value) for version-value option */ +#define VALUE_OPT_VERSION 'v' +/* + * Interface defines not associated with particular options + */ +#define ERRSKIP_OPTERR STMTS(systemkey_toolOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(systemkey_toolOptions.fOptSet |= OPTPROC_ERRSTOP) +#define RESTART_OPT(n) STMTS( \ + systemkey_toolOptions.curOptIdx = (n); \ + systemkey_toolOptions.pzCurOpt = NULL ) +#define START_OPT RESTART_OPT(1) +#define USAGE(c) (*systemkey_toolOptions.pUsageProc)(&systemkey_toolOptions, c) + +#ifdef __cplusplus +extern "C" { +#endif +/* + * global exported definitions + */ +#include <gettext.h> + + +/* * * * * * + * + * Declare the systemkey-tool option descriptor. + */ +extern tOptions systemkey_toolOptions; + +#if defined(ENABLE_NLS) +# ifndef _ +# include <stdio.h> +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include <libintl.h> +# endif + +# ifndef ATTRIBUTE_FORMAT_ARG +# define ATTRIBUTE_FORMAT_ARG(_a) +# endif + +static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1); +static inline char* aoGetsText(char const* pz) { + if (pz == NULL) return NULL; + return (char*)gettext(pz); +} +# define _(s) aoGetsText(s) +# endif /* _() */ + +# define OPT_NO_XLAT_CFG_NAMES STMTS(systemkey_toolOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT_CFG;) +# define OPT_NO_XLAT_OPT_NAMES STMTS(systemkey_toolOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) + +# define OPT_XLAT_CFG_NAMES STMTS(systemkey_toolOptions.fOptSet &= \ + ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) +# define OPT_XLAT_OPT_NAMES STMTS(systemkey_toolOptions.fOptSet &= \ + ~OPTPROC_NXLAT_OPT;) + +#else /* ENABLE_NLS */ +# define OPT_NO_XLAT_CFG_NAMES +# define OPT_NO_XLAT_OPT_NAMES + +# define OPT_XLAT_CFG_NAMES +# define OPT_XLAT_OPT_NAMES + +# ifndef _ +# define _(_s) _s +# endif +#endif /* ENABLE_NLS */ + +#ifdef __cplusplus +} +#endif +#endif /* AUTOOPTS_SYSTEMKEY_ARGS_H_GUARD */ + +/* systemkey-args.h ends here */ diff --git a/src/tpmtool-args.c.bak b/src/tpmtool-args.c.bak new file mode 100644 index 0000000000..d5c9168330 --- /dev/null +++ b/src/tpmtool-args.c.bak @@ -0,0 +1,1392 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (tpmtool-args.c) + * + * It has been AutoGen-ed + * From the definitions tpmtool-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This source file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the tpmtool author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The tpmtool program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * tpmtool is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * tpmtool is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef __doxygen__ +#define OPTION_CODE_COMPILE 1 +#include "tpmtool-args.h" +#include <sys/types.h> + +#include <limits.h> +#include <stdio.h> +#include <stdlib.h> +#include <errno.h> + +#ifdef __cplusplus +extern "C" { +#endif +extern FILE * option_usage_fp; +#define zCopyright (tpmtool_opt_strs+0) +#define zLicenseDescrip (tpmtool_opt_strs+288) + + +#ifndef NULL +# define NULL 0 +#endif + +/** + * static const strings for tpmtool options + */ +static char const tpmtool_opt_strs[2191] = +/* 0 */ "tpmtool @VERSION@\n" + "Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n" + "This is free software. It is licensed for use, modification and\n" + "redistribution under the terms of the GNU General Public License,\n" + "version 3 or later <http://gnu.org/licenses/gpl.html>\n\0" +/* 288 */ "tpmtool is free software: you can redistribute it and/or modify it under\n" + "the terms of the GNU General Public License as published by the Free\n" + "Software Foundation, either version 3 of the License, or (at your option)\n" + "any later version.\n\n" + "tpmtool is distributed in the hope that it will be useful, but WITHOUT ANY\n" + "WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n" + "FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n" + "details.\n\n" + "You should have received a copy of the GNU General Public License along\n" + "with this program. If not, see <http://www.gnu.org/licenses/>.\n\0" +/* 891 */ "Enable debugging\0" +/* 908 */ "DEBUG\0" +/* 914 */ "debug\0" +/* 920 */ "Input file\0" +/* 931 */ "INFILE\0" +/* 938 */ "infile\0" +/* 945 */ "Output file\0" +/* 957 */ "OUTFILE\0" +/* 965 */ "outfile\0" +/* 973 */ "Generate an RSA private-public key pair\0" +/* 1013 */ "GENERATE_RSA\0" +/* 1026 */ "generate-rsa\0" +/* 1039 */ "Any generated key will be registered in the TPM\0" +/* 1087 */ "REGISTER\0" +/* 1096 */ "register\0" +/* 1105 */ "Any generated key will be a signing key\0" +/* 1145 */ "SIGNING\0" +/* 1153 */ "signing\0" +/* 1161 */ "Any generated key will be a legacy key\0" +/* 1200 */ "LEGACY\0" +/* 1207 */ "legacy\0" +/* 1214 */ "Any registered key will be a user key\0" +/* 1252 */ "USER\0" +/* 1257 */ "user\0" +/* 1262 */ "Any registered key will be a system key\0" +/* 1302 */ "SYSTEM\0" +/* 1309 */ "system\0" +/* 1316 */ "Prints the public key of the provided key\0" +/* 1358 */ "PUBKEY\0" +/* 1365 */ "pubkey\0" +/* 1372 */ "Lists all stored keys in the TPM\0" +/* 1405 */ "LIST\0" +/* 1410 */ "list\0" +/* 1415 */ "Delete the key identified by the given URL (UUID).\0" +/* 1466 */ "DELETE\0" +/* 1473 */ "delete\0" +/* 1480 */ "Tests the signature operation of the provided object\0" +/* 1533 */ "TEST_SIGN\0" +/* 1543 */ "test-sign\0" +/* 1553 */ "Specify the security level [low, legacy, medium, high, ultra].\0" +/* 1616 */ "SEC_PARAM\0" +/* 1626 */ "sec-param\0" +/* 1636 */ "Specify the number of bits for key generate\0" +/* 1680 */ "BITS\0" +/* 1685 */ "bits\0" +/* 1690 */ "Use the DER format for keys.\0" +/* 1719 */ "INDER\0" +/* 1725 */ "no-inder\0" +/* 1734 */ "no\0" +/* 1737 */ "Use DER format for output keys\0" +/* 1768 */ "OUTDER\0" +/* 1775 */ "no-outder\0" +/* 1785 */ "display extended usage information and exit\0" +/* 1829 */ "help\0" +/* 1834 */ "extended usage information passed thru pager\0" +/* 1879 */ "more-help\0" +/* 1889 */ "output version information and exit\0" +/* 1925 */ "version\0" +/* 1933 */ "TPMTOOL\0" +/* 1941 */ "tpmtool - GnuTLS TPM tool\n" + "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0" +/* 2025 */ "@PACKAGE_BUGREPORT@\0" +/* 2045 */ "\n\0" +/* 2047 */ "Program that allows handling cryptographic data from the TPM chip.\n\0" +/* 2115 */ "tpmtool @VERSION@\0" +/* 2133 */ "tpmtool [options]\n" + "tpmtool --help for usage instructions.\n"; + +/** + * debug option description: + */ +/** Descriptive text for the debug option */ +#define DEBUG_DESC (tpmtool_opt_strs+891) +/** Upper-cased name for the debug option */ +#define DEBUG_NAME (tpmtool_opt_strs+908) +/** Name string for the debug option */ +#define DEBUG_name (tpmtool_opt_strs+914) +/** Compiled in flag settings for the debug option */ +#define DEBUG_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * infile option description: + */ +/** Descriptive text for the infile option */ +#define INFILE_DESC (tpmtool_opt_strs+920) +/** Upper-cased name for the infile option */ +#define INFILE_NAME (tpmtool_opt_strs+931) +/** Name string for the infile option */ +#define INFILE_name (tpmtool_opt_strs+938) +/** Compiled in flag settings for the infile option */ +#define INFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_FILE)) + +/** + * outfile option description: + */ +/** Descriptive text for the outfile option */ +#define OUTFILE_DESC (tpmtool_opt_strs+945) +/** Upper-cased name for the outfile option */ +#define OUTFILE_NAME (tpmtool_opt_strs+957) +/** Name string for the outfile option */ +#define OUTFILE_name (tpmtool_opt_strs+965) +/** Compiled in flag settings for the outfile option */ +#define OUTFILE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * generate-rsa option description: + */ +/** Descriptive text for the generate-rsa option */ +#define GENERATE_RSA_DESC (tpmtool_opt_strs+973) +/** Upper-cased name for the generate-rsa option */ +#define GENERATE_RSA_NAME (tpmtool_opt_strs+1013) +/** Name string for the generate-rsa option */ +#define GENERATE_RSA_name (tpmtool_opt_strs+1026) +/** Compiled in flag settings for the generate-rsa option */ +#define GENERATE_RSA_FLAGS (OPTST_DISABLED) + +/** + * register option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the register option */ +#define REGISTER_DESC (tpmtool_opt_strs+1039) +/** Upper-cased name for the register option */ +#define REGISTER_NAME (tpmtool_opt_strs+1087) +/** Name string for the register option */ +#define REGISTER_name (tpmtool_opt_strs+1096) +/** Other options that are required by the register option */ +static int const aRegisterMustList[] = { + INDEX_OPT_GENERATE_RSA, NO_EQUIVALENT }; +/** Compiled in flag settings for the register option */ +#define REGISTER_FLAGS (OPTST_DISABLED) + +/** + * signing option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the signing option */ +#define SIGNING_DESC (tpmtool_opt_strs+1105) +/** Upper-cased name for the signing option */ +#define SIGNING_NAME (tpmtool_opt_strs+1145) +/** Name string for the signing option */ +#define SIGNING_name (tpmtool_opt_strs+1153) +/** Other options that are required by the signing option */ +static int const aSigningMustList[] = { + INDEX_OPT_GENERATE_RSA, NO_EQUIVALENT }; +/** Other options that appear in conjunction with the signing option */ +static int const aSigningCantList[] = { + INDEX_OPT_LEGACY, NO_EQUIVALENT }; +/** Compiled in flag settings for the signing option */ +#define SIGNING_FLAGS (OPTST_DISABLED) + +/** + * legacy option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the legacy option */ +#define LEGACY_DESC (tpmtool_opt_strs+1161) +/** Upper-cased name for the legacy option */ +#define LEGACY_NAME (tpmtool_opt_strs+1200) +/** Name string for the legacy option */ +#define LEGACY_name (tpmtool_opt_strs+1207) +/** Other options that are required by the legacy option */ +static int const aLegacyMustList[] = { + INDEX_OPT_GENERATE_RSA, NO_EQUIVALENT }; +/** Other options that appear in conjunction with the legacy option */ +static int const aLegacyCantList[] = { + INDEX_OPT_SIGNING, NO_EQUIVALENT }; +/** Compiled in flag settings for the legacy option */ +#define LEGACY_FLAGS (OPTST_DISABLED) + +/** + * user option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the user option */ +#define USER_DESC (tpmtool_opt_strs+1214) +/** Upper-cased name for the user option */ +#define USER_NAME (tpmtool_opt_strs+1252) +/** Name string for the user option */ +#define USER_name (tpmtool_opt_strs+1257) +/** Other options that are required by the user option */ +static int const aUserMustList[] = { + INDEX_OPT_REGISTER, NO_EQUIVALENT }; +/** Other options that appear in conjunction with the user option */ +static int const aUserCantList[] = { + INDEX_OPT_SYSTEM, NO_EQUIVALENT }; +/** Compiled in flag settings for the user option */ +#define USER_FLAGS (OPTST_DISABLED) + +/** + * system option description with + * "Must also have options" and "Incompatible options": + */ +/** Descriptive text for the system option */ +#define SYSTEM_DESC (tpmtool_opt_strs+1262) +/** Upper-cased name for the system option */ +#define SYSTEM_NAME (tpmtool_opt_strs+1302) +/** Name string for the system option */ +#define SYSTEM_name (tpmtool_opt_strs+1309) +/** Other options that are required by the system option */ +static int const aSystemMustList[] = { + INDEX_OPT_REGISTER, NO_EQUIVALENT }; +/** Other options that appear in conjunction with the system option */ +static int const aSystemCantList[] = { + INDEX_OPT_USER, NO_EQUIVALENT }; +/** Compiled in flag settings for the system option */ +#define SYSTEM_FLAGS (OPTST_DISABLED) + +/** + * pubkey option description: + */ +/** Descriptive text for the pubkey option */ +#define PUBKEY_DESC (tpmtool_opt_strs+1316) +/** Upper-cased name for the pubkey option */ +#define PUBKEY_NAME (tpmtool_opt_strs+1358) +/** Name string for the pubkey option */ +#define PUBKEY_name (tpmtool_opt_strs+1365) +/** Compiled in flag settings for the pubkey option */ +#define PUBKEY_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * list option description: + */ +/** Descriptive text for the list option */ +#define LIST_DESC (tpmtool_opt_strs+1372) +/** Upper-cased name for the list option */ +#define LIST_NAME (tpmtool_opt_strs+1405) +/** Name string for the list option */ +#define LIST_name (tpmtool_opt_strs+1410) +/** Compiled in flag settings for the list option */ +#define LIST_FLAGS (OPTST_DISABLED) + +/** + * delete option description: + */ +/** Descriptive text for the delete option */ +#define DELETE_DESC (tpmtool_opt_strs+1415) +/** Upper-cased name for the delete option */ +#define DELETE_NAME (tpmtool_opt_strs+1466) +/** Name string for the delete option */ +#define DELETE_name (tpmtool_opt_strs+1473) +/** Compiled in flag settings for the delete option */ +#define DELETE_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * test-sign option description: + */ +/** Descriptive text for the test-sign option */ +#define TEST_SIGN_DESC (tpmtool_opt_strs+1480) +/** Upper-cased name for the test-sign option */ +#define TEST_SIGN_NAME (tpmtool_opt_strs+1533) +/** Name string for the test-sign option */ +#define TEST_SIGN_name (tpmtool_opt_strs+1543) +/** Compiled in flag settings for the test-sign option */ +#define TEST_SIGN_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * sec-param option description: + */ +/** Descriptive text for the sec-param option */ +#define SEC_PARAM_DESC (tpmtool_opt_strs+1553) +/** Upper-cased name for the sec-param option */ +#define SEC_PARAM_NAME (tpmtool_opt_strs+1616) +/** Name string for the sec-param option */ +#define SEC_PARAM_name (tpmtool_opt_strs+1626) +/** Compiled in flag settings for the sec-param option */ +#define SEC_PARAM_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)) + +/** + * bits option description: + */ +/** Descriptive text for the bits option */ +#define BITS_DESC (tpmtool_opt_strs+1636) +/** Upper-cased name for the bits option */ +#define BITS_NAME (tpmtool_opt_strs+1680) +/** Name string for the bits option */ +#define BITS_name (tpmtool_opt_strs+1685) +/** Compiled in flag settings for the bits option */ +#define BITS_FLAGS (OPTST_DISABLED \ + | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC)) + +/** + * inder option description: + */ +/** Descriptive text for the inder option */ +#define INDER_DESC (tpmtool_opt_strs+1690) +/** Upper-cased name for the inder option */ +#define INDER_NAME (tpmtool_opt_strs+1719) +/** disablement name for the inder option */ +#define NOT_INDER_name (tpmtool_opt_strs+1725) +/** disablement prefix for the inder option */ +#define NOT_INDER_PFX (tpmtool_opt_strs+1734) +/** Name string for the inder option */ +#define INDER_name (NOT_INDER_name + 3) +/** Compiled in flag settings for the inder option */ +#define INDER_FLAGS (OPTST_DISABLED) + +/** + * outder option description: + */ +/** Descriptive text for the outder option */ +#define OUTDER_DESC (tpmtool_opt_strs+1737) +/** Upper-cased name for the outder option */ +#define OUTDER_NAME (tpmtool_opt_strs+1768) +/** disablement name for the outder option */ +#define NOT_OUTDER_name (tpmtool_opt_strs+1775) +/** disablement prefix for the outder option */ +#define NOT_OUTDER_PFX (tpmtool_opt_strs+1734) +/** Name string for the outder option */ +#define OUTDER_name (NOT_OUTDER_name + 3) +/** Compiled in flag settings for the outder option */ +#define OUTDER_FLAGS (OPTST_DISABLED) + +/* + * Help/More_Help/Version option descriptions: + */ +#define HELP_DESC (tpmtool_opt_strs+1785) +#define HELP_name (tpmtool_opt_strs+1829) +#ifdef HAVE_WORKING_FORK +#define MORE_HELP_DESC (tpmtool_opt_strs+1834) +#define MORE_HELP_name (tpmtool_opt_strs+1879) +#define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +#define MORE_HELP_DESC HELP_DESC +#define MORE_HELP_name HELP_name +#define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT) +#endif +#ifdef NO_OPTIONAL_OPT_ARGS +# define VER_FLAGS (OPTST_IMM | OPTST_NO_INIT) +#else +# define VER_FLAGS (OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) | \ + OPTST_ARG_OPTIONAL | OPTST_IMM | OPTST_NO_INIT) +#endif +#define VER_DESC (tpmtool_opt_strs+1889) +#define VER_name (tpmtool_opt_strs+1925) +/** + * Declare option callback procedures + */ +extern tOptProc + optionBooleanVal, optionNestedVal, optionNumericVal, + optionPagedUsage, optionPrintVersion, optionResetOpt, + optionStackArg, optionTimeDate, optionTimeVal, + optionUnstackArg, optionVendorOption; +static tOptProc + doOptDebug, doOptInfile, doUsageOpt; +#define VER_PROC optionPrintVersion + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Define the tpmtool Option Descriptions. + * This is an array of OPTION_CT entries, one for each + * option that the tpmtool program responds to. + */ +static tOptDesc optDesc[OPTION_CT] = { + { /* entry idx, value */ 0, VALUE_OPT_DEBUG, + /* equiv idx, value */ 0, VALUE_OPT_DEBUG, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DEBUG_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --debug */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptDebug, + /* desc, NAME, name */ DEBUG_DESC, DEBUG_NAME, DEBUG_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 1, VALUE_OPT_INFILE, + /* equiv idx, value */ 1, VALUE_OPT_INFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --infile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doOptInfile, + /* desc, NAME, name */ INFILE_DESC, INFILE_NAME, INFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 2, VALUE_OPT_OUTFILE, + /* equiv idx, value */ 2, VALUE_OPT_OUTFILE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OUTFILE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --outfile */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ OUTFILE_DESC, OUTFILE_NAME, OUTFILE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 3, VALUE_OPT_GENERATE_RSA, + /* equiv idx, value */ 3, VALUE_OPT_GENERATE_RSA, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ GENERATE_RSA_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --generate-rsa */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ GENERATE_RSA_DESC, GENERATE_RSA_NAME, GENERATE_RSA_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 4, VALUE_OPT_REGISTER, + /* equiv idx, value */ 4, VALUE_OPT_REGISTER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ REGISTER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --register */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ aRegisterMustList, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ REGISTER_DESC, REGISTER_NAME, REGISTER_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 5, VALUE_OPT_SIGNING, + /* equiv idx, value */ 5, VALUE_OPT_SIGNING, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SIGNING_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --signing */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ aSigningMustList, aSigningCantList, + /* option proc */ NULL, + /* desc, NAME, name */ SIGNING_DESC, SIGNING_NAME, SIGNING_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 6, VALUE_OPT_LEGACY, + /* equiv idx, value */ 6, VALUE_OPT_LEGACY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LEGACY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --legacy */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ aLegacyMustList, aLegacyCantList, + /* option proc */ NULL, + /* desc, NAME, name */ LEGACY_DESC, LEGACY_NAME, LEGACY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 7, VALUE_OPT_USER, + /* equiv idx, value */ 7, VALUE_OPT_USER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ USER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --user */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ aUserMustList, aUserCantList, + /* option proc */ NULL, + /* desc, NAME, name */ USER_DESC, USER_NAME, USER_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 8, VALUE_OPT_SYSTEM, + /* equiv idx, value */ 8, VALUE_OPT_SYSTEM, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SYSTEM_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --system */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ aSystemMustList, aSystemCantList, + /* option proc */ NULL, + /* desc, NAME, name */ SYSTEM_DESC, SYSTEM_NAME, SYSTEM_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 9, VALUE_OPT_PUBKEY, + /* equiv idx, value */ 9, VALUE_OPT_PUBKEY, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ PUBKEY_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --pubkey */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ PUBKEY_DESC, PUBKEY_NAME, PUBKEY_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 10, VALUE_OPT_LIST, + /* equiv idx, value */ 10, VALUE_OPT_LIST, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ LIST_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --list */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ LIST_DESC, LIST_NAME, LIST_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 11, VALUE_OPT_DELETE, + /* equiv idx, value */ 11, VALUE_OPT_DELETE, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ DELETE_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --delete */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ DELETE_DESC, DELETE_NAME, DELETE_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 12, VALUE_OPT_TEST_SIGN, + /* equiv idx, value */ 12, VALUE_OPT_TEST_SIGN, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ TEST_SIGN_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --test-sign */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ TEST_SIGN_DESC, TEST_SIGN_NAME, TEST_SIGN_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 13, VALUE_OPT_SEC_PARAM, + /* equiv idx, value */ 13, VALUE_OPT_SEC_PARAM, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ SEC_PARAM_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --sec-param */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ SEC_PARAM_DESC, SEC_PARAM_NAME, SEC_PARAM_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 14, VALUE_OPT_BITS, + /* equiv idx, value */ 14, VALUE_OPT_BITS, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ BITS_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --bits */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionNumericVal, + /* desc, NAME, name */ BITS_DESC, BITS_NAME, BITS_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ 15, VALUE_OPT_INDER, + /* equiv idx, value */ 15, VALUE_OPT_INDER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ INDER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --inder */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ INDER_DESC, INDER_NAME, INDER_name, + /* disablement strs */ NOT_INDER_name, NOT_INDER_PFX }, + + { /* entry idx, value */ 16, VALUE_OPT_OUTDER, + /* equiv idx, value */ 16, VALUE_OPT_OUTDER, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OUTDER_FLAGS, 0, + /* last opt argumnt */ { NULL }, /* --outder */ + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ NULL, + /* desc, NAME, name */ OUTDER_DESC, OUTDER_NAME, OUTDER_name, + /* disablement strs */ NOT_OUTDER_name, NOT_OUTDER_PFX }, + + { /* entry idx, value */ INDEX_OPT_VERSION, VALUE_OPT_VERSION, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_VERSION, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ VER_FLAGS, AOUSE_VERSION, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ VER_PROC, + /* desc, NAME, name */ VER_DESC, NULL, VER_name, + /* disablement strs */ NULL, NULL }, + + + + { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ doUsageOpt, + /* desc, NAME, name */ HELP_DESC, NULL, HELP_name, + /* disablement strs */ NULL, NULL }, + + { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP, + /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP, + /* equivalenced to */ NO_EQUIVALENT, + /* min, max, act ct */ 0, 1, 0, + /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP, + /* last opt argumnt */ { NULL }, + /* arg list/cookie */ NULL, + /* must/cannot opts */ NULL, NULL, + /* option proc */ optionPagedUsage, + /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name, + /* disablement strs */ NULL, NULL } +}; + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** Reference to the upper cased version of tpmtool. */ +#define zPROGNAME (tpmtool_opt_strs+1933) +/** Reference to the title line for tpmtool usage. */ +#define zUsageTitle (tpmtool_opt_strs+1941) +/** There is no tpmtool configuration file. */ +#define zRcName NULL +/** There are no directories to search for tpmtool config files. */ +#define apzHomeList NULL +/** The tpmtool program bug email address. */ +#define zBugsAddr (tpmtool_opt_strs+2025) +/** Clarification/explanation of what tpmtool does. */ +#define zExplain (tpmtool_opt_strs+2045) +/** Extra detail explaining what tpmtool does. */ +#define zDetail (tpmtool_opt_strs+2047) +/** The full version string for tpmtool. */ +#define zFullVersion (tpmtool_opt_strs+2115) +/* extracted from optcode.tlib near line 364 */ + +#if defined(ENABLE_NLS) +# define OPTPROC_BASE OPTPROC_TRANSLATE | OPTPROC_NXLAT_OPT + static tOptionXlateProc translate_option_strings; +#else +# define OPTPROC_BASE OPTPROC_NONE +# define translate_option_strings NULL +#endif /* ENABLE_NLS */ + +#define tpmtool_full_usage (NULL) +#define tpmtool_short_usage (tpmtool_opt_strs+2133) + +#endif /* not defined __doxygen__ */ + +/* + * Create the static procedure(s) declared above. + */ +/** + * The callout function that invokes the optionUsage function. + * + * @param[in] opts the AutoOpts option description structure + * @param[in] od the descriptor for the "help" (usage) option. + * @noreturn + */ +static void +doUsageOpt(tOptions * opts, tOptDesc * od) +{ + int ex_code; + ex_code = TPMTOOL_EXIT_SUCCESS; + optionUsage(&tpmtoolOptions, ex_code); + /* NOTREACHED */ + exit(TPMTOOL_EXIT_FAILURE); + (void)opts; + (void)od; +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the debug option. + * Specifies the debug level. + * @param[in] pOptions the tpmtool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptDebug(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static struct {long rmin, rmax;} const rng[1] = { + { 0 , 9999 } }; + int ix; + + if (pOptions <= OPTPROC_EMIT_LIMIT) + goto emit_ranges; + optionNumericVal(pOptions, pOptDesc); + + for (ix = 0; ix < 1; ix++) { + if (pOptDesc->optArg.argInt < rng[ix].rmin) + continue; /* ranges need not be ordered. */ + if (pOptDesc->optArg.argInt == rng[ix].rmin) + return; + if (rng[ix].rmax == LONG_MIN) + continue; + if (pOptDesc->optArg.argInt <= rng[ix].rmax) + return; + } + + option_usage_fp = stderr; + + emit_ranges: +optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1); +} + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Code to handle the infile option. + * + * @param[in] pOptions the tpmtool options data structure + * @param[in,out] pOptDesc the option descriptor for this option. + */ +static void +doOptInfile(tOptions* pOptions, tOptDesc* pOptDesc) +{ + static teOptFileType const type = + FTYPE_MODE_MUST_EXIST + FTYPE_MODE_NO_OPEN; + static tuFileMode mode; +#ifndef O_CLOEXEC +# define O_CLOEXEC 0 +#endif + mode.file_flags = O_CLOEXEC; + + /* + * This function handles special invalid values for "pOptions" + */ + optionFileCheck(pOptions, pOptDesc, type, mode); +} +/* extracted from optmain.tlib near line 1250 */ + +/** + * The directory containing the data associated with tpmtool. + */ +#ifndef PKGDATADIR +# define PKGDATADIR "" +#endif + +/** + * Information about the person or institution that packaged tpmtool + * for the current distribution. + */ +#ifndef WITH_PACKAGER +# define tpmtool_packager_info NULL +#else +/** Packager information for tpmtool. */ +static char const tpmtool_packager_info[] = + "Packaged by " WITH_PACKAGER + +# ifdef WITH_PACKAGER_VERSION + " ("WITH_PACKAGER_VERSION")" +# endif + +# ifdef WITH_PACKAGER_BUG_REPORTS + "\nReport tpmtool bugs to " WITH_PACKAGER_BUG_REPORTS +# endif + "\n"; +#endif +#ifndef __doxygen__ + +#endif /* __doxygen__ */ +/** + * The option definitions for tpmtool. The one structure that + * binds them all. + */ +tOptions tpmtoolOptions = { + OPTIONS_STRUCT_VERSION, + 0, NULL, /* original argc + argv */ + ( OPTPROC_BASE + + OPTPROC_ERRSTOP + + OPTPROC_SHORTOPT + + OPTPROC_LONGOPT + + OPTPROC_NO_REQ_OPT + + OPTPROC_NEGATIONS + + OPTPROC_NO_ARGS + + OPTPROC_GNUUSAGE + + OPTPROC_MISUSE ), + 0, NULL, /* current option index, current option */ + NULL, NULL, zPROGNAME, + zRcName, zCopyright, zLicenseDescrip, + zFullVersion, apzHomeList, zUsageTitle, + zExplain, zDetail, optDesc, + zBugsAddr, /* address to send bugs to */ + NULL, NULL, /* extensions/saved state */ + optionUsage, /* usage procedure */ + translate_option_strings, /* translation procedure */ + /* + * Indexes to special options + */ + { INDEX_OPT_MORE_HELP, /* more-help option index */ + NO_EQUIVALENT, /* save option index */ + NO_EQUIVALENT, /* '-#' option index */ + NO_EQUIVALENT /* index of default opt */ + }, + 20 /* full option count */, 17 /* user option count */, + tpmtool_full_usage, tpmtool_short_usage, + NULL, NULL, + PKGDATADIR, tpmtool_packager_info +}; + +#if ENABLE_NLS +/** + * This code is designed to translate translatable option text for the + * tpmtool program. These translations happen upon entry + * to optionProcess(). + */ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#ifdef HAVE_DCGETTEXT +# include <gettext.h> +#endif +#include <autoopts/usage-txt.h> + +static char * AO_gettext(char const * pz); +static void coerce_it(void ** s); + +/** + * AutoGen specific wrapper function for gettext. It relies on the macro _() + * to convert from English to the target language, then strdup-duplicates the + * result string. It tries the "libopts" domain first, then whatever has been + * set via the \a textdomain(3) call. + * + * @param[in] pz the input text used as a lookup key. + * @returns the translated text (if there is one), + * or the original text (if not). + */ +static char * +AO_gettext(char const * pz) +{ + char * res; + if (pz == NULL) + return NULL; +#ifdef HAVE_DCGETTEXT + /* + * While processing the option_xlateable_txt data, try to use the + * "libopts" domain. Once we switch to the option descriptor data, + * do *not* use that domain. + */ + if (option_xlateable_txt.field_ct != 0) { + res = dgettext("libopts", pz); + if (res == pz) + res = (char *)VOIDP(_(pz)); + } else + res = (char *)VOIDP(_(pz)); +#else + res = (char *)VOIDP(_(pz)); +#endif + if (res == pz) + return res; + res = strdup(res); + if (res == NULL) { + fputs(_("No memory for duping translated strings\n"), stderr); + exit(TPMTOOL_EXIT_FAILURE); + } + return res; +} + +/** + * All the pointers we use are marked "* const", but they are stored in + * writable memory. Coerce the mutability and set the pointer. + */ +static void coerce_it(void ** s) { *s = AO_gettext(*s); +} + +/** + * Translate all the translatable strings in the tpmtoolOptions + * structure defined above. This is done only once. + */ +static void +translate_option_strings(void) +{ + tOptions * const opts = &tpmtoolOptions; + + /* + * Guard against re-translation. It won't work. The strings will have + * been changed by the first pass through this code. One shot only. + */ + if (option_xlateable_txt.field_ct != 0) { + /* + * Do the translations. The first pointer follows the field count + * field. The field count field is the size of a pointer. + */ + char ** ppz = (char**)VOIDP(&(option_xlateable_txt)); + int ix = option_xlateable_txt.field_ct; + + do { + ppz++; /* skip over field_ct */ + *ppz = AO_gettext(*ppz); + } while (--ix > 0); + /* prevent re-translation and disable "libopts" domain lookup */ + option_xlateable_txt.field_ct = 0; + + coerce_it(VOIDP(&(opts->pzCopyright))); + coerce_it(VOIDP(&(opts->pzCopyNotice))); + coerce_it(VOIDP(&(opts->pzFullVersion))); + coerce_it(VOIDP(&(opts->pzUsageTitle))); + coerce_it(VOIDP(&(opts->pzExplain))); + coerce_it(VOIDP(&(opts->pzDetail))); + { + tOptDesc * od = opts->pOptDesc; + for (ix = opts->optCt; ix > 0; ix--, od++) + coerce_it(VOIDP(&(od->pzText))); + } + } +} +#endif /* ENABLE_NLS */ + +#ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT +/** I18N function strictly for xgettext. Do not compile. */ +static void bogus_function(void) { + /* TRANSLATORS: + + The following dummy function was crated solely so that xgettext can + extract the correct strings. These strings are actually referenced + by a field name in the tpmtoolOptions structure noted in the + comments below. The literal text is defined in tpmtool_opt_strs. + + NOTE: the strings below are segmented with respect to the source string + tpmtool_opt_strs. The strings above are handed off for translation + at run time a paragraph at a time. Consequently, they are presented here + for translation a paragraph at a time. + + ALSO: often the description for an option will reference another option + by name. These are set off with apostrophe quotes (I hope). Do not + translate option names. + */ + /* referenced via tpmtoolOptions.pzCopyright */ + puts(_("tpmtool @VERSION@\n\ +Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved.\n\ +This is free software. It is licensed for use, modification and\n\ +redistribution under the terms of the GNU General Public License,\n\ +version 3 or later <http://gnu.org/licenses/gpl.html>\n")); + + /* referenced via tpmtoolOptions.pzCopyNotice */ + puts(_("tpmtool is free software: you can redistribute it and/or modify it under\n\ +the terms of the GNU General Public License as published by the Free\n\ +Software Foundation, either version 3 of the License, or (at your option)\n\ +any later version.\n\n")); + puts(_("tpmtool is distributed in the hope that it will be useful, but WITHOUT ANY\n\ +WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\n\ +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more\n\ +details.\n\n")); + puts(_("You should have received a copy of the GNU General Public License along\n\ +with this program. If not, see <http://www.gnu.org/licenses/>.\n")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("Enable debugging")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("Input file")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("Output file")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("Generate an RSA private-public key pair")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("Any generated key will be registered in the TPM")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("Any generated key will be a signing key")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("Any generated key will be a legacy key")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("Any registered key will be a user key")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("Any registered key will be a system key")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("Prints the public key of the provided key")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("Lists all stored keys in the TPM")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("Delete the key identified by the given URL (UUID).")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("Tests the signature operation of the provided object")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("Specify the security level [low, legacy, medium, high, ultra].")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("Specify the number of bits for key generate")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("Use the DER format for keys.")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("Use DER format for output keys")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("display extended usage information and exit")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("extended usage information passed thru pager")); + + /* referenced via tpmtoolOptions.pOptDesc->pzText */ + puts(_("output version information and exit")); + + /* referenced via tpmtoolOptions.pzUsageTitle */ + puts(_("tpmtool - GnuTLS TPM tool\n\ +Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n")); + + /* referenced via tpmtoolOptions.pzExplain */ + puts(_("\n")); + + /* referenced via tpmtoolOptions.pzDetail */ + puts(_("Program that allows handling cryptographic data from the TPM chip.\n")); + + /* referenced via tpmtoolOptions.pzFullVersion */ + puts(_("tpmtool @VERSION@")); + + /* referenced via tpmtoolOptions.pzFullUsage */ + puts(_("<<<NOT-FOUND>>>")); + + /* referenced via tpmtoolOptions.pzShortUsage */ + puts(_("tpmtool [options]\n\ +tpmtool --help for usage instructions.\n")); + /* LIBOPTS-MESSAGES: */ +#line 67 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 93 "../autoopts.c" + puts(_("allocation of %d bytes failed\n")); +#line 53 "../init.c" + puts(_("AutoOpts function called without option descriptor\n")); +#line 86 "../init.c" + puts(_("\tThis exceeds the compiled library version: ")); +#line 84 "../init.c" + puts(_("Automated Options Processing Error!\n" + "\t%s called AutoOpts function with structure version %d:%d:%d.\n")); +#line 80 "../autoopts.c" + puts(_("realloc of %d bytes at 0x%p failed\n")); +#line 88 "../init.c" + puts(_("\tThis is less than the minimum library version: ")); +#line 121 "../version.c" + puts(_("Automated Options version %s\n" + "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n")); +#line 87 "../makeshell.c" + puts(_("(AutoOpts bug): %s.\n")); +#line 90 "../reset.c" + puts(_("optionResetOpt() called, but reset-option not configured")); +#line 295 "../usage.c" + puts(_("could not locate the 'help' option")); +#line 336 "../autoopts.c" + puts(_("optionProcess() was called with invalid data")); +#line 751 "../usage.c" + puts(_("invalid argument type specified")); +#line 598 "../find.c" + puts(_("defaulted to option with optional arg")); +#line 76 "../alias.c" + puts(_("aliasing option is out of range.")); +#line 235 "../enum.c" + puts(_("%s error: the keyword '%s' is ambiguous for %s\n")); +#line 108 "../find.c" + puts(_(" The following options match:\n")); +#line 293 "../find.c" + puts(_("%s: ambiguous option name: %s (matches %d options)\n")); +#line 161 "../check.c" + puts(_("%s: Command line arguments required\n")); +#line 43 "../alias.c" + puts(_("%d %s%s options allowed\n")); +#line 94 "../makeshell.c" + puts(_("%s error %d (%s) calling %s for '%s'\n")); +#line 306 "../makeshell.c" + puts(_("interprocess pipe")); +#line 168 "../version.c" + puts(_("error: version option argument '%c' invalid. Use:\n" + "\t'v' - version only\n" + "\t'c' - version and copyright\n" + "\t'n' - version and full copyright notice\n")); +#line 58 "../check.c" + puts(_("%s error: the '%s' and '%s' options conflict\n")); +#line 217 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 430 "../find.c" + puts(_("%s: The '%s' option has been disabled.")); +#line 38 "../alias.c" + puts(_("-equivalence")); +#line 469 "../find.c" + puts(_("%s: illegal option -- %c\n")); +#line 110 "../reset.c" + puts(_("%s: illegal option -- %c\n")); +#line 271 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 755 "../find.c" + puts(_("%s: illegal option -- %s\n")); +#line 118 "../reset.c" + puts(_("%s: illegal option -- %s\n")); +#line 335 "../find.c" + puts(_("%s: unknown vendor extension option -- %s\n")); +#line 160 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 170 "../enum.c" + puts(_(" or an integer from %d through %d\n")); +#line 750 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 1084 "../usage.c" + puts(_("%s error: invalid option descriptor for %s\n")); +#line 385 "../find.c" + puts(_("%s: invalid option name: %s\n")); +#line 527 "../find.c" + puts(_("%s: The '%s' option requires an argument.\n")); +#line 156 "../autoopts.c" + puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n" + "\t'%s' and '%s'.")); +#line 94 "../check.c" + puts(_("%s error: The %s option is required\n")); +#line 632 "../find.c" + puts(_("%s: The '%s' option cannot have an argument.\n")); +#line 151 "../check.c" + puts(_("%s: Command line arguments are not allowed.\n")); +#line 536 "../save.c" + puts(_("error %d (%s) creating %s\n")); +#line 235 "../enum.c" + puts(_("%s error: '%s' does not match any %s keywords.\n")); +#line 93 "../reset.c" + puts(_("%s error: The '%s' option requires an argument.\n")); +#line 186 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 239 "../save.c" + puts(_("error %d (%s) stat-ing %s\n")); +#line 143 "../restore.c" + puts(_("%s error: no saved option state\n")); +#line 231 "../autoopts.c" + puts(_("'%s' is not a command line option.\n")); +#line 113 "../time.c" + puts(_("%s error: '%s' is not a recognizable date/time.\n")); +#line 131 "../save.c" + puts(_("'%s' not defined\n")); +#line 50 "../time.c" + puts(_("%s error: '%s' is not a recognizable time duration.\n")); +#line 92 "../check.c" + puts(_("%s error: The %s option must appear %d times.\n")); +#line 165 "../numeric.c" + puts(_("%s error: '%s' is not a recognizable number.\n")); +#line 201 "../enum.c" + puts(_("%s error: %s exceeds %s keyword count\n")); +#line 333 "../usage.c" + puts(_("Try '%s %s' for more information.\n")); +#line 45 "../alias.c" + puts(_("one %s%s option allowed\n")); +#line 208 "../makeshell.c" + puts(_("standard output")); +#line 943 "../makeshell.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard output")); +#line 418 "../usage.c" + puts(_("standard output")); +#line 628 "../usage.c" + puts(_("standard output")); +#line 175 "../version.c" + puts(_("standard output")); +#line 277 "../usage.c" + puts(_("standard error")); +#line 418 "../usage.c" + puts(_("standard error")); +#line 628 "../usage.c" + puts(_("standard error")); +#line 175 "../version.c" + puts(_("standard error")); +#line 208 "../makeshell.c" + puts(_("write")); +#line 943 "../makeshell.c" + puts(_("write")); +#line 276 "../usage.c" + puts(_("write")); +#line 417 "../usage.c" + puts(_("write")); +#line 627 "../usage.c" + puts(_("write")); +#line 174 "../version.c" + puts(_("write")); +#line 60 "../numeric.c" + puts(_("%s error: %s option value %ld is out of range.\n")); +#line 44 "../check.c" + puts(_("%s error: %s option requires the %s option\n")); +#line 130 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 185 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 238 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 257 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); +#line 535 "../save.c" + puts(_("%s warning: cannot save options - %s not regular file\n")); + /* END-LIBOPTS-MESSAGES */ + + /* USAGE-TEXT: */ +#line 876 "../usage.c" + puts(_("\t\t\t\t- an alternate for '%s'\n")); +#line 1151 "../usage.c" + puts(_("Version, usage and configuration options:")); +#line 927 "../usage.c" + puts(_("\t\t\t\t- default option for unnamed options\n")); +#line 840 "../usage.c" + puts(_("\t\t\t\t- disabled as '--%s'\n")); +#line 1120 "../usage.c" + puts(_(" --- %-14s %s\n")); +#line 1118 "../usage.c" + puts(_("This option has been disabled")); +#line 867 "../usage.c" + puts(_("\t\t\t\t- enabled by default\n")); +#line 40 "../alias.c" + puts(_("%s error: only ")); +#line 1197 "../usage.c" + puts(_(" - examining environment variables named %s_*\n")); +#line 168 "../file.c" + puts(_("\t\t\t\t- file must not pre-exist\n")); +#line 172 "../file.c" + puts(_("\t\t\t\t- file must pre-exist\n")); +#line 383 "../usage.c" + puts(_("Options are specified by doubled hyphens and their name or by a single\n" + "hyphen and the flag character.\n")); +#line 921 "../makeshell.c" + puts(_("\n" + "= = = = = = = =\n\n" + "This incarnation of genshell will produce\n" + "a shell script to parse the options for %s:\n\n")); +#line 167 "../enum.c" + puts(_(" or an integer mask with any of the lower %d bits set\n")); +#line 900 "../usage.c" + puts(_("\t\t\t\t- is a set membership option\n")); +#line 921 "../usage.c" + puts(_("\t\t\t\t- must appear between %d and %d times\n")); +#line 385 "../usage.c" + puts(_("Options are specified by single or double hyphens and their name.\n")); +#line 907 "../usage.c" + puts(_("\t\t\t\t- may appear multiple times\n")); +#line 894 "../usage.c" + puts(_("\t\t\t\t- may not be preset\n")); +#line 1312 "../usage.c" + puts(_(" Arg Option-Name Description\n")); +#line 1248 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1306 "../usage.c" + puts(_(" Flg Arg Option-Name Description\n")); +#line 1307 "../usage.c" + puts(_(" %3s %s")); +#line 1313 "../usage.c" + puts(_(" %3s %s")); +#line 390 "../usage.c" + puts(_("The '-#<number>' option may omit the hash char\n")); +#line 386 "../usage.c" + puts(_("All arguments are named options.\n")); +#line 974 "../usage.c" + puts(_(" - reading file %s")); +#line 412 "../usage.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 100 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 129 "../version.c" + puts(_("\n" + "Please send bug reports to: <%s>\n")); +#line 906 "../usage.c" + puts(_("\t\t\t\t- may NOT appear - preset only\n")); +#line 947 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 1195 "../usage.c" + puts(_("\n" + "The following option preset mechanisms are supported:\n")); +#line 685 "../usage.c" + puts(_("prohibits these options:\n")); +#line 680 "../usage.c" + puts(_("prohibits the option '%s'\n")); +#line 81 "../numeric.c" + puts(_("%s%ld to %ld")); +#line 79 "../numeric.c" + puts(_("%sgreater than or equal to %ld")); +#line 75 "../numeric.c" + puts(_("%s%ld exactly")); +#line 68 "../numeric.c" + puts(_("%sit must lie in one of the ranges:\n")); +#line 68 "../numeric.c" + puts(_("%sit must be in the range:\n")); +#line 88 "../numeric.c" + puts(_(", or\n")); +#line 66 "../numeric.c" + puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n")); +#line 77 "../numeric.c" + puts(_("%sless than or equal to %ld")); +#line 393 "../usage.c" + puts(_("Operands and options may be intermixed. They will be reordered.\n")); +#line 655 "../usage.c" + puts(_("requires the option '%s'\n")); +#line 658 "../usage.c" + puts(_("requires these options:\n")); +#line 1324 "../usage.c" + puts(_(" Arg Option-Name Req? Description\n")); +#line 1318 "../usage.c" + puts(_(" Flg Arg Option-Name Req? Description\n")); +#line 168 "../enum.c" + puts(_("or you may use a numeric representation. Preceding these with a '!'\n" + "will clear the bits, specifying 'none' will clear all bits, and 'all'\n" + "will set them all. Multiple entries may be passed as an option\n" + "argument list.\n")); +#line 913 "../usage.c" + puts(_("\t\t\t\t- may appear up to %d times\n")); +#line 77 "../enum.c" + puts(_("The valid \"%s\" option keywords are:\n")); +#line 1155 "../usage.c" + puts(_("The next option supports vendor supported extra options:")); +#line 776 "../usage.c" + puts(_("These additional options are:")); + /* END-USAGE-TEXT */ +} +#endif /* uncompilable code */ +#ifdef __cplusplus +} +#endif +/* tpmtool-args.c ends here */ diff --git a/src/tpmtool-args.h.bak b/src/tpmtool-args.h.bak new file mode 100644 index 0000000000..b7ab92d0ed --- /dev/null +++ b/src/tpmtool-args.h.bak @@ -0,0 +1,247 @@ +/* -*- buffer-read-only: t -*- vi: set ro: + * + * DO NOT EDIT THIS FILE (tpmtool-args.h) + * + * It has been AutoGen-ed + * From the definitions tpmtool-args.def + * and the template file options + * + * Generated from AutoOpts 41:1:16 templates. + * + * AutoOpts is a copyrighted work. This header file is not encumbered + * by AutoOpts licensing, but is provided under the licensing terms chosen + * by the tpmtool author or copyright holder. AutoOpts is + * licensed under the terms of the LGPL. The redistributable library + * (``libopts'') is licensed under the terms of either the LGPL or, at the + * users discretion, the BSD license. See the AutoOpts and/or libopts sources + * for details. + * + * The tpmtool program is copyrighted and licensed + * under the following terms: + * + * Copyright (C) 2000-@YEAR@ Free Software Foundation, and others, all rights reserved. + * This is free software. It is licensed for use, modification and + * redistribution under the terms of the GNU General Public License, + * version 3 or later <http://gnu.org/licenses/gpl.html> + * + * tpmtool is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * tpmtool is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ +/** + * This file contains the programmatic interface to the Automated + * Options generated for the tpmtool program. + * These macros are documented in the AutoGen info file in the + * "AutoOpts" chapter. Please refer to that doc for usage help. + */ +#ifndef AUTOOPTS_TPMTOOL_ARGS_H_GUARD +#define AUTOOPTS_TPMTOOL_ARGS_H_GUARD 1 +#include "config.h" +#include <autoopts/options.h> + +/** + * Ensure that the library used for compiling this generated header is at + * least as new as the version current when the header template was released + * (not counting patch version increments). Also ensure that the oldest + * tolerable version is at least as old as what was current when the header + * template was released. + */ +#define AO_TEMPLATE_VERSION 167937 +#if (AO_TEMPLATE_VERSION < OPTIONS_MINIMUM_VERSION) \ + || (AO_TEMPLATE_VERSION > OPTIONS_STRUCT_VERSION) +# error option template version mismatches autoopts/options.h header + Choke Me. +#endif + +/** + * Enumeration of each option type for tpmtool + */ +typedef enum { + INDEX_OPT_DEBUG = 0, + INDEX_OPT_INFILE = 1, + INDEX_OPT_OUTFILE = 2, + INDEX_OPT_GENERATE_RSA = 3, + INDEX_OPT_REGISTER = 4, + INDEX_OPT_SIGNING = 5, + INDEX_OPT_LEGACY = 6, + INDEX_OPT_USER = 7, + INDEX_OPT_SYSTEM = 8, + INDEX_OPT_PUBKEY = 9, + INDEX_OPT_LIST = 10, + INDEX_OPT_DELETE = 11, + INDEX_OPT_TEST_SIGN = 12, + INDEX_OPT_SEC_PARAM = 13, + INDEX_OPT_BITS = 14, + INDEX_OPT_INDER = 15, + INDEX_OPT_OUTDER = 16, + INDEX_OPT_VERSION = 17, + INDEX_OPT_HELP = 18, + INDEX_OPT_MORE_HELP = 19 +} teOptIndex; +/** count of all options for tpmtool */ +#define OPTION_CT 20 +/** tpmtool version */ +#define TPMTOOL_VERSION "@VERSION@" +/** Full tpmtool version text */ +#define TPMTOOL_FULL_VERSION "tpmtool @VERSION@" + +/** + * Interface defines for all options. Replace "n" with the UPPER_CASED + * option name (as in the teOptIndex enumeration above). + * e.g. HAVE_OPT(DEBUG) + */ +#define DESC(n) (tpmtoolOptions.pOptDesc[INDEX_OPT_## n]) +/** 'true' if an option has been specified in any way */ +#define HAVE_OPT(n) (! UNUSED_OPT(& DESC(n))) +/** The string argument to an option. The argument type must be \"string\". */ +#define OPT_ARG(n) (DESC(n).optArg.argString) +/** Mask the option state revealing how an option was specified. + * It will be one and only one of \a OPTST_SET, \a OPTST_PRESET, + * \a OPTST_DEFINED, \a OPTST_RESET or zero. + */ +#define STATE_OPT(n) (DESC(n).fOptState & OPTST_SET_MASK) +/** Count of option's occurrances *on the command line*. */ +#define COUNT_OPT(n) (DESC(n).optOccCt) +/** mask of \a OPTST_SET and \a OPTST_DEFINED. */ +#define ISSEL_OPT(n) (SELECTED_OPT(&DESC(n))) +/** 'true' if \a HAVE_OPT would yield 'false'. */ +#define ISUNUSED_OPT(n) (UNUSED_OPT(& DESC(n))) +/** 'true' if OPTST_DISABLED bit not set. */ +#define ENABLED_OPT(n) (! DISABLED_OPT(& DESC(n))) +/** number of stacked option arguments. + * Valid only for stacked option arguments. */ +#define STACKCT_OPT(n) (((tArgList*)(DESC(n).optCookie))->useCt) +/** stacked argument vector. + * Valid only for stacked option arguments. */ +#define STACKLST_OPT(n) (((tArgList*)(DESC(n).optCookie))->apzArgs) +/** Reset an option. */ +#define CLEAR_OPT(n) STMTS( \ + DESC(n).fOptState &= OPTST_PERSISTENT_MASK; \ + if ((DESC(n).fOptState & OPTST_INITENABLED) == 0) \ + DESC(n).fOptState |= OPTST_DISABLED; \ + DESC(n).optCookie = NULL ) +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/** + * Enumeration of tpmtool exit codes + */ +typedef enum { + TPMTOOL_EXIT_SUCCESS = 0, + TPMTOOL_EXIT_FAILURE = 1, + TPMTOOL_EXIT_USAGE_ERROR = 64, + TPMTOOL_EXIT_LIBOPTS_FAILURE = 70 +} tpmtool_exit_code_t; +/** + * Interface defines for specific options. + * @{ + */ +#define VALUE_OPT_DEBUG 'd' + +#define OPT_VALUE_DEBUG (DESC(DEBUG).optArg.argInt) +#define VALUE_OPT_INFILE 0x1001 +#define VALUE_OPT_OUTFILE 0x1002 +#define VALUE_OPT_GENERATE_RSA 0x1003 +#define VALUE_OPT_REGISTER 0x1004 +#define VALUE_OPT_SIGNING 0x1005 +#define VALUE_OPT_LEGACY 0x1006 +#define VALUE_OPT_USER 0x1007 +#define VALUE_OPT_SYSTEM 0x1008 +#define VALUE_OPT_PUBKEY 0x1009 +#define VALUE_OPT_LIST 0x100A +#define VALUE_OPT_DELETE 0x100B +#define VALUE_OPT_TEST_SIGN 0x100C +#define VALUE_OPT_SEC_PARAM 0x100D +#define VALUE_OPT_BITS 0x100E + +#define OPT_VALUE_BITS (DESC(BITS).optArg.argInt) +#define VALUE_OPT_INDER 0x100F +#define VALUE_OPT_OUTDER 0x1010 +/** option flag (value) for help-value option */ +#define VALUE_OPT_HELP 'h' +/** option flag (value) for more-help-value option */ +#define VALUE_OPT_MORE_HELP '!' +/** option flag (value) for version-value option */ +#define VALUE_OPT_VERSION 'v' +/* + * Interface defines not associated with particular options + */ +#define ERRSKIP_OPTERR STMTS(tpmtoolOptions.fOptSet &= ~OPTPROC_ERRSTOP) +#define ERRSTOP_OPTERR STMTS(tpmtoolOptions.fOptSet |= OPTPROC_ERRSTOP) +#define RESTART_OPT(n) STMTS( \ + tpmtoolOptions.curOptIdx = (n); \ + tpmtoolOptions.pzCurOpt = NULL ) +#define START_OPT RESTART_OPT(1) +#define USAGE(c) (*tpmtoolOptions.pUsageProc)(&tpmtoolOptions, c) + +#ifdef __cplusplus +extern "C" { +#endif +/* + * global exported definitions + */ +#include <gettext.h> + + +/* * * * * * + * + * Declare the tpmtool option descriptor. + */ +extern tOptions tpmtoolOptions; + +#if defined(ENABLE_NLS) +# ifndef _ +# include <stdio.h> +# ifndef HAVE_GETTEXT + extern char * gettext(char const *); +# else +# include <libintl.h> +# endif + +# ifndef ATTRIBUTE_FORMAT_ARG +# define ATTRIBUTE_FORMAT_ARG(_a) +# endif + +static inline char* aoGetsText(char const* pz) ATTRIBUTE_FORMAT_ARG(1); +static inline char* aoGetsText(char const* pz) { + if (pz == NULL) return NULL; + return (char*)gettext(pz); +} +# define _(s) aoGetsText(s) +# endif /* _() */ + +# define OPT_NO_XLAT_CFG_NAMES STMTS(tpmtoolOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT_CFG;) +# define OPT_NO_XLAT_OPT_NAMES STMTS(tpmtoolOptions.fOptSet |= \ + OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG;) + +# define OPT_XLAT_CFG_NAMES STMTS(tpmtoolOptions.fOptSet &= \ + ~(OPTPROC_NXLAT_OPT|OPTPROC_NXLAT_OPT_CFG);) +# define OPT_XLAT_OPT_NAMES STMTS(tpmtoolOptions.fOptSet &= \ + ~OPTPROC_NXLAT_OPT;) + +#else /* ENABLE_NLS */ +# define OPT_NO_XLAT_CFG_NAMES +# define OPT_NO_XLAT_OPT_NAMES + +# define OPT_XLAT_CFG_NAMES +# define OPT_XLAT_OPT_NAMES + +# ifndef _ +# define _(_s) _s +# endif +#endif /* ENABLE_NLS */ + +#ifdef __cplusplus +} +#endif +#endif /* AUTOOPTS_TPMTOOL_ARGS_H_GUARD */ + +/* tpmtool-args.h ends here */ |