opt.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. /*
  2. * Copyright 2018-2022 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #ifndef OSSL_APPS_OPT_H
  10. #define OSSL_APPS_OPT_H
  11. #include <sys/types.h>
  12. #include <openssl/e_os2.h>
  13. #include <openssl/types.h>
  14. #include <stdarg.h>
  15. #define OPT_COMMON OPT_ERR = -1, OPT_EOF = 0, OPT_HELP
  16. /*
  17. * Common verification options.
  18. */
  19. # define OPT_V_ENUM \
  20. OPT_V__FIRST=2000, \
  21. OPT_V_POLICY, OPT_V_PURPOSE, OPT_V_VERIFY_NAME, OPT_V_VERIFY_DEPTH, \
  22. OPT_V_ATTIME, OPT_V_VERIFY_HOSTNAME, OPT_V_VERIFY_EMAIL, \
  23. OPT_V_VERIFY_IP, OPT_V_IGNORE_CRITICAL, OPT_V_ISSUER_CHECKS, \
  24. OPT_V_CRL_CHECK, OPT_V_CRL_CHECK_ALL, OPT_V_POLICY_CHECK, \
  25. OPT_V_EXPLICIT_POLICY, OPT_V_INHIBIT_ANY, OPT_V_INHIBIT_MAP, \
  26. OPT_V_X509_STRICT, OPT_V_EXTENDED_CRL, OPT_V_USE_DELTAS, \
  27. OPT_V_POLICY_PRINT, OPT_V_CHECK_SS_SIG, OPT_V_TRUSTED_FIRST, \
  28. OPT_V_SUITEB_128_ONLY, OPT_V_SUITEB_128, OPT_V_SUITEB_192, \
  29. OPT_V_PARTIAL_CHAIN, OPT_V_NO_ALT_CHAINS, OPT_V_NO_CHECK_TIME, \
  30. OPT_V_VERIFY_AUTH_LEVEL, OPT_V_ALLOW_PROXY_CERTS, \
  31. OPT_V__LAST
  32. # define OPT_V_OPTIONS \
  33. OPT_SECTION("Validation"), \
  34. { "policy", OPT_V_POLICY, 's', "adds policy to the acceptable policy set"}, \
  35. { "purpose", OPT_V_PURPOSE, 's', \
  36. "certificate chain purpose"}, \
  37. { "verify_name", OPT_V_VERIFY_NAME, 's', "verification policy name"}, \
  38. { "verify_depth", OPT_V_VERIFY_DEPTH, 'n', \
  39. "chain depth limit" }, \
  40. { "auth_level", OPT_V_VERIFY_AUTH_LEVEL, 'n', \
  41. "chain authentication security level" }, \
  42. { "attime", OPT_V_ATTIME, 'M', "verification epoch time" }, \
  43. { "verify_hostname", OPT_V_VERIFY_HOSTNAME, 's', \
  44. "expected peer hostname" }, \
  45. { "verify_email", OPT_V_VERIFY_EMAIL, 's', \
  46. "expected peer email" }, \
  47. { "verify_ip", OPT_V_VERIFY_IP, 's', \
  48. "expected peer IP address" }, \
  49. { "ignore_critical", OPT_V_IGNORE_CRITICAL, '-', \
  50. "permit unhandled critical extensions"}, \
  51. { "issuer_checks", OPT_V_ISSUER_CHECKS, '-', "(deprecated)"}, \
  52. { "crl_check", OPT_V_CRL_CHECK, '-', "check leaf certificate revocation" }, \
  53. { "crl_check_all", OPT_V_CRL_CHECK_ALL, '-', "check full chain revocation" }, \
  54. { "policy_check", OPT_V_POLICY_CHECK, '-', "perform rfc5280 policy checks"}, \
  55. { "explicit_policy", OPT_V_EXPLICIT_POLICY, '-', \
  56. "set policy variable require-explicit-policy"}, \
  57. { "inhibit_any", OPT_V_INHIBIT_ANY, '-', \
  58. "set policy variable inhibit-any-policy"}, \
  59. { "inhibit_map", OPT_V_INHIBIT_MAP, '-', \
  60. "set policy variable inhibit-policy-mapping"}, \
  61. { "x509_strict", OPT_V_X509_STRICT, '-', \
  62. "disable certificate compatibility work-arounds"}, \
  63. { "extended_crl", OPT_V_EXTENDED_CRL, '-', \
  64. "enable extended CRL features"}, \
  65. { "use_deltas", OPT_V_USE_DELTAS, '-', \
  66. "use delta CRLs"}, \
  67. { "policy_print", OPT_V_POLICY_PRINT, '-', \
  68. "print policy processing diagnostics"}, \
  69. { "check_ss_sig", OPT_V_CHECK_SS_SIG, '-', \
  70. "check root CA self-signatures"}, \
  71. { "trusted_first", OPT_V_TRUSTED_FIRST, '-', \
  72. "search trust store first (default)" }, \
  73. { "suiteB_128_only", OPT_V_SUITEB_128_ONLY, '-', "Suite B 128-bit-only mode"}, \
  74. { "suiteB_128", OPT_V_SUITEB_128, '-', \
  75. "Suite B 128-bit mode allowing 192-bit algorithms"}, \
  76. { "suiteB_192", OPT_V_SUITEB_192, '-', "Suite B 192-bit-only mode" }, \
  77. { "partial_chain", OPT_V_PARTIAL_CHAIN, '-', \
  78. "accept chains anchored by intermediate trust-store CAs"}, \
  79. { "no_alt_chains", OPT_V_NO_ALT_CHAINS, '-', "(deprecated)" }, \
  80. { "no_check_time", OPT_V_NO_CHECK_TIME, '-', "ignore certificate validity time" }, \
  81. { "allow_proxy_certs", OPT_V_ALLOW_PROXY_CERTS, '-', "allow the use of proxy certificates" }
  82. # define OPT_V_CASES \
  83. OPT_V__FIRST: case OPT_V__LAST: break; \
  84. case OPT_V_POLICY: \
  85. case OPT_V_PURPOSE: \
  86. case OPT_V_VERIFY_NAME: \
  87. case OPT_V_VERIFY_DEPTH: \
  88. case OPT_V_VERIFY_AUTH_LEVEL: \
  89. case OPT_V_ATTIME: \
  90. case OPT_V_VERIFY_HOSTNAME: \
  91. case OPT_V_VERIFY_EMAIL: \
  92. case OPT_V_VERIFY_IP: \
  93. case OPT_V_IGNORE_CRITICAL: \
  94. case OPT_V_ISSUER_CHECKS: \
  95. case OPT_V_CRL_CHECK: \
  96. case OPT_V_CRL_CHECK_ALL: \
  97. case OPT_V_POLICY_CHECK: \
  98. case OPT_V_EXPLICIT_POLICY: \
  99. case OPT_V_INHIBIT_ANY: \
  100. case OPT_V_INHIBIT_MAP: \
  101. case OPT_V_X509_STRICT: \
  102. case OPT_V_EXTENDED_CRL: \
  103. case OPT_V_USE_DELTAS: \
  104. case OPT_V_POLICY_PRINT: \
  105. case OPT_V_CHECK_SS_SIG: \
  106. case OPT_V_TRUSTED_FIRST: \
  107. case OPT_V_SUITEB_128_ONLY: \
  108. case OPT_V_SUITEB_128: \
  109. case OPT_V_SUITEB_192: \
  110. case OPT_V_PARTIAL_CHAIN: \
  111. case OPT_V_NO_ALT_CHAINS: \
  112. case OPT_V_NO_CHECK_TIME: \
  113. case OPT_V_ALLOW_PROXY_CERTS
  114. /*
  115. * Common "extended validation" options.
  116. */
  117. # define OPT_X_ENUM \
  118. OPT_X__FIRST=1000, \
  119. OPT_X_KEY, OPT_X_CERT, OPT_X_CHAIN, OPT_X_CHAIN_BUILD, \
  120. OPT_X_CERTFORM, OPT_X_KEYFORM, \
  121. OPT_X__LAST
  122. # define OPT_X_OPTIONS \
  123. OPT_SECTION("Extended certificate"), \
  124. { "xkey", OPT_X_KEY, '<', "key for Extended certificates"}, \
  125. { "xcert", OPT_X_CERT, '<', "cert for Extended certificates"}, \
  126. { "xchain", OPT_X_CHAIN, '<', "chain for Extended certificates"}, \
  127. { "xchain_build", OPT_X_CHAIN_BUILD, '-', \
  128. "build certificate chain for the extended certificates"}, \
  129. { "xcertform", OPT_X_CERTFORM, 'F', \
  130. "format of Extended certificate (PEM/DER/P12); has no effect" }, \
  131. { "xkeyform", OPT_X_KEYFORM, 'F', \
  132. "format of Extended certificate's key (DER/PEM/P12); has no effect"}
  133. # define OPT_X_CASES \
  134. OPT_X__FIRST: case OPT_X__LAST: break; \
  135. case OPT_X_KEY: \
  136. case OPT_X_CERT: \
  137. case OPT_X_CHAIN: \
  138. case OPT_X_CHAIN_BUILD: \
  139. case OPT_X_CERTFORM: \
  140. case OPT_X_KEYFORM
  141. /*
  142. * Common SSL options.
  143. * Any changes here must be coordinated with ../ssl/ssl_conf.c
  144. */
  145. # define OPT_S_ENUM \
  146. OPT_S__FIRST=3000, \
  147. OPT_S_NOSSL3, OPT_S_NOTLS1, OPT_S_NOTLS1_1, OPT_S_NOTLS1_2, \
  148. OPT_S_NOTLS1_3, OPT_S_BUGS, OPT_S_NO_COMP, OPT_S_NOTICKET, \
  149. OPT_S_SERVERPREF, OPT_S_LEGACYRENEG, OPT_S_CLIENTRENEG, \
  150. OPT_S_LEGACYCONN, \
  151. OPT_S_ONRESUMP, OPT_S_NOLEGACYCONN, OPT_S_ALLOW_NO_DHE_KEX, \
  152. OPT_S_PRIORITIZE_CHACHA, \
  153. OPT_S_STRICT, OPT_S_SIGALGS, OPT_S_CLIENTSIGALGS, OPT_S_GROUPS, \
  154. OPT_S_CURVES, OPT_S_NAMEDCURVE, OPT_S_CIPHER, OPT_S_CIPHERSUITES, \
  155. OPT_S_RECORD_PADDING, OPT_S_DEBUGBROKE, OPT_S_COMP, \
  156. OPT_S_MINPROTO, OPT_S_MAXPROTO, \
  157. OPT_S_NO_RENEGOTIATION, OPT_S_NO_MIDDLEBOX, OPT_S_NO_ETM, \
  158. OPT_S_NO_EMS, \
  159. OPT_S_NO_TX_CERT_COMP, \
  160. OPT_S_NO_RX_CERT_COMP, \
  161. OPT_S__LAST
  162. # define OPT_S_OPTIONS \
  163. OPT_SECTION("TLS/SSL"), \
  164. {"no_ssl3", OPT_S_NOSSL3, '-',"Just disable SSLv3" }, \
  165. {"no_tls1", OPT_S_NOTLS1, '-', "Just disable TLSv1"}, \
  166. {"no_tls1_1", OPT_S_NOTLS1_1, '-', "Just disable TLSv1.1" }, \
  167. {"no_tls1_2", OPT_S_NOTLS1_2, '-', "Just disable TLSv1.2"}, \
  168. {"no_tls1_3", OPT_S_NOTLS1_3, '-', "Just disable TLSv1.3"}, \
  169. {"bugs", OPT_S_BUGS, '-', "Turn on SSL bug compatibility"}, \
  170. {"no_comp", OPT_S_NO_COMP, '-', "Disable SSL/TLS compression (default)" }, \
  171. {"comp", OPT_S_COMP, '-', "Use SSL/TLS-level compression" }, \
  172. {"no_tx_cert_comp", OPT_S_NO_TX_CERT_COMP, '-', "Disable sending TLSv1.3 compressed certificates" }, \
  173. {"no_rx_cert_comp", OPT_S_NO_RX_CERT_COMP, '-', "Disable receiving TLSv1.3 compressed certificates" }, \
  174. {"no_ticket", OPT_S_NOTICKET, '-', \
  175. "Disable use of TLS session tickets"}, \
  176. {"serverpref", OPT_S_SERVERPREF, '-', "Use server's cipher preferences"}, \
  177. {"legacy_renegotiation", OPT_S_LEGACYRENEG, '-', \
  178. "Enable use of legacy renegotiation (dangerous)"}, \
  179. {"client_renegotiation", OPT_S_CLIENTRENEG, '-', \
  180. "Allow client-initiated renegotiation" }, \
  181. {"no_renegotiation", OPT_S_NO_RENEGOTIATION, '-', \
  182. "Disable all renegotiation."}, \
  183. {"legacy_server_connect", OPT_S_LEGACYCONN, '-', \
  184. "Allow initial connection to servers that don't support RI"}, \
  185. {"no_resumption_on_reneg", OPT_S_ONRESUMP, '-', \
  186. "Disallow session resumption on renegotiation"}, \
  187. {"no_legacy_server_connect", OPT_S_NOLEGACYCONN, '-', \
  188. "Disallow initial connection to servers that don't support RI"}, \
  189. {"allow_no_dhe_kex", OPT_S_ALLOW_NO_DHE_KEX, '-', \
  190. "In TLSv1.3 allow non-(ec)dhe based key exchange on resumption"}, \
  191. {"prioritize_chacha", OPT_S_PRIORITIZE_CHACHA, '-', \
  192. "Prioritize ChaCha ciphers when preferred by clients"}, \
  193. {"strict", OPT_S_STRICT, '-', \
  194. "Enforce strict certificate checks as per TLS standard"}, \
  195. {"sigalgs", OPT_S_SIGALGS, 's', \
  196. "Signature algorithms to support (colon-separated list)" }, \
  197. {"client_sigalgs", OPT_S_CLIENTSIGALGS, 's', \
  198. "Signature algorithms to support for client certificate" \
  199. " authentication (colon-separated list)" }, \
  200. {"groups", OPT_S_GROUPS, 's', \
  201. "Groups to advertise (colon-separated list)" }, \
  202. {"curves", OPT_S_CURVES, 's', \
  203. "Groups to advertise (colon-separated list)" }, \
  204. {"named_curve", OPT_S_NAMEDCURVE, 's', \
  205. "Elliptic curve used for ECDHE (server-side only)" }, \
  206. {"cipher", OPT_S_CIPHER, 's', "Specify TLSv1.2 and below cipher list to be used"}, \
  207. {"ciphersuites", OPT_S_CIPHERSUITES, 's', "Specify TLSv1.3 ciphersuites to be used"}, \
  208. {"min_protocol", OPT_S_MINPROTO, 's', "Specify the minimum protocol version to be used"}, \
  209. {"max_protocol", OPT_S_MAXPROTO, 's', "Specify the maximum protocol version to be used"}, \
  210. {"record_padding", OPT_S_RECORD_PADDING, 's', \
  211. "Block size to pad TLS 1.3 records to."}, \
  212. {"debug_broken_protocol", OPT_S_DEBUGBROKE, '-', \
  213. "Perform all sorts of protocol violations for testing purposes"}, \
  214. {"no_middlebox", OPT_S_NO_MIDDLEBOX, '-', \
  215. "Disable TLSv1.3 middlebox compat mode" }, \
  216. {"no_etm", OPT_S_NO_ETM, '-', \
  217. "Disable Encrypt-then-Mac extension"}, \
  218. {"no_ems", OPT_S_NO_EMS, '-', \
  219. "Disable Extended master secret extension"}
  220. # define OPT_S_CASES \
  221. OPT_S__FIRST: case OPT_S__LAST: break; \
  222. case OPT_S_NOSSL3: \
  223. case OPT_S_NOTLS1: \
  224. case OPT_S_NOTLS1_1: \
  225. case OPT_S_NOTLS1_2: \
  226. case OPT_S_NOTLS1_3: \
  227. case OPT_S_BUGS: \
  228. case OPT_S_NO_COMP: \
  229. case OPT_S_COMP: \
  230. case OPT_S_NO_TX_CERT_COMP: \
  231. case OPT_S_NO_RX_CERT_COMP: \
  232. case OPT_S_NOTICKET: \
  233. case OPT_S_SERVERPREF: \
  234. case OPT_S_LEGACYRENEG: \
  235. case OPT_S_CLIENTRENEG: \
  236. case OPT_S_LEGACYCONN: \
  237. case OPT_S_ONRESUMP: \
  238. case OPT_S_NOLEGACYCONN: \
  239. case OPT_S_ALLOW_NO_DHE_KEX: \
  240. case OPT_S_PRIORITIZE_CHACHA: \
  241. case OPT_S_STRICT: \
  242. case OPT_S_SIGALGS: \
  243. case OPT_S_CLIENTSIGALGS: \
  244. case OPT_S_GROUPS: \
  245. case OPT_S_CURVES: \
  246. case OPT_S_NAMEDCURVE: \
  247. case OPT_S_CIPHER: \
  248. case OPT_S_CIPHERSUITES: \
  249. case OPT_S_RECORD_PADDING: \
  250. case OPT_S_NO_RENEGOTIATION: \
  251. case OPT_S_MINPROTO: \
  252. case OPT_S_MAXPROTO: \
  253. case OPT_S_DEBUGBROKE: \
  254. case OPT_S_NO_MIDDLEBOX: \
  255. case OPT_S_NO_ETM: \
  256. case OPT_S_NO_EMS
  257. #define IS_NO_PROT_FLAG(o) \
  258. (o == OPT_S_NOSSL3 || o == OPT_S_NOTLS1 || o == OPT_S_NOTLS1_1 \
  259. || o == OPT_S_NOTLS1_2 || o == OPT_S_NOTLS1_3)
  260. /*
  261. * Random state options.
  262. */
  263. # define OPT_R_ENUM \
  264. OPT_R__FIRST=1500, OPT_R_RAND, OPT_R_WRITERAND, OPT_R__LAST
  265. # define OPT_R_OPTIONS \
  266. OPT_SECTION("Random state"), \
  267. {"rand", OPT_R_RAND, 's', "Load the given file(s) into the random number generator"}, \
  268. {"writerand", OPT_R_WRITERAND, '>', "Write random data to the specified file"}
  269. # define OPT_R_CASES \
  270. OPT_R__FIRST: case OPT_R__LAST: break; \
  271. case OPT_R_RAND: case OPT_R_WRITERAND
  272. /*
  273. * Provider options.
  274. */
  275. # define OPT_PROV_ENUM \
  276. OPT_PROV__FIRST=1600, \
  277. OPT_PROV_PROVIDER, OPT_PROV_PROVIDER_PATH, OPT_PROV_PROPQUERY, \
  278. OPT_PROV__LAST
  279. # define OPT_CONFIG_OPTION \
  280. { "config", OPT_CONFIG, '<', "Load a configuration file (this may load modules)" }
  281. # define OPT_PROV_OPTIONS \
  282. OPT_SECTION("Provider"), \
  283. { "provider-path", OPT_PROV_PROVIDER_PATH, 's', "Provider load path (must be before 'provider' argument if required)" }, \
  284. { "provider", OPT_PROV_PROVIDER, 's', "Provider to load (can be specified multiple times)" }, \
  285. { "propquery", OPT_PROV_PROPQUERY, 's', "Property query used when fetching algorithms" }
  286. # define OPT_PROV_CASES \
  287. OPT_PROV__FIRST: case OPT_PROV__LAST: break; \
  288. case OPT_PROV_PROVIDER: \
  289. case OPT_PROV_PROVIDER_PATH: \
  290. case OPT_PROV_PROPQUERY
  291. /*
  292. * Option parsing.
  293. */
  294. extern const char OPT_HELP_STR[];
  295. extern const char OPT_MORE_STR[];
  296. extern const char OPT_SECTION_STR[];
  297. extern const char OPT_PARAM_STR[];
  298. typedef struct options_st {
  299. const char *name;
  300. int retval;
  301. /*
  302. * value type: - no value (also the value zero), n number, p positive
  303. * number, u unsigned, l long, s string, < input file, > output file,
  304. * f any format, F der/pem format, E der/pem/engine format identifier.
  305. * l, n and u include zero; p does not.
  306. */
  307. int valtype;
  308. const char *helpstr;
  309. } OPTIONS;
  310. /* Special retval values: */
  311. #define OPT_PARAM 0 /* same as OPT_EOF usually defined in apps */
  312. #define OPT_DUP -2 /* marks duplicate occurrence of option in help output */
  313. /*
  314. * A string/int pairing; widely use for option value lookup, hence the
  315. * name OPT_PAIR. But that name is misleading in s_cb.c, so we also use
  316. * the "generic" name STRINT_PAIR.
  317. */
  318. typedef struct string_int_pair_st {
  319. const char *name;
  320. int retval;
  321. } OPT_PAIR, STRINT_PAIR;
  322. /* Flags to pass into opt_format; see FORMAT_xxx, below. */
  323. # define OPT_FMT_PEMDER (1L << 1)
  324. # define OPT_FMT_PKCS12 (1L << 2)
  325. # define OPT_FMT_SMIME (1L << 3)
  326. # define OPT_FMT_ENGINE (1L << 4)
  327. # define OPT_FMT_MSBLOB (1L << 5)
  328. /* (1L << 6) was OPT_FMT_NETSCAPE, but wasn't used */
  329. # define OPT_FMT_NSS (1L << 7)
  330. # define OPT_FMT_TEXT (1L << 8)
  331. # define OPT_FMT_HTTP (1L << 9)
  332. # define OPT_FMT_PVK (1L << 10)
  333. # define OPT_FMT_PDE (OPT_FMT_PEMDER | OPT_FMT_ENGINE)
  334. # define OPT_FMT_PDS (OPT_FMT_PEMDER | OPT_FMT_SMIME)
  335. # define OPT_FMT_ANY ( \
  336. OPT_FMT_PEMDER | OPT_FMT_PKCS12 | OPT_FMT_SMIME | \
  337. OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NSS | \
  338. OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK)
  339. /* Divide options into sections when displaying usage */
  340. #define OPT_SECTION(sec) { OPT_SECTION_STR, 1, '-', sec " options:\n" }
  341. #define OPT_PARAMETERS() { OPT_PARAM_STR, 1, '-', "Parameters:\n" }
  342. const char *opt_path_end(const char *filename);
  343. char *opt_init(int ac, char **av, const OPTIONS * o);
  344. char *opt_progname(const char *argv0);
  345. char *opt_appname(const char *argv0);
  346. char *opt_getprog(void);
  347. void opt_help(const OPTIONS * list);
  348. void opt_begin(void);
  349. int opt_next(void);
  350. char *opt_flag(void);
  351. char *opt_arg(void);
  352. char *opt_unknown(void);
  353. void reset_unknown(void);
  354. int opt_cipher(const char *name, EVP_CIPHER **cipherp);
  355. int opt_cipher_any(const char *name, EVP_CIPHER **cipherp);
  356. int opt_cipher_silent(const char *name, EVP_CIPHER **cipherp);
  357. int opt_check_md(const char *name);
  358. int opt_md(const char *name, EVP_MD **mdp);
  359. int opt_md_silent(const char *name, EVP_MD **mdp);
  360. int opt_int(const char *arg, int *result);
  361. void opt_set_unknown_name(const char *name);
  362. int opt_int_arg(void);
  363. int opt_long(const char *arg, long *result);
  364. int opt_ulong(const char *arg, unsigned long *result);
  365. int opt_intmax(const char *arg, ossl_intmax_t *result);
  366. int opt_uintmax(const char *arg, ossl_uintmax_t *result);
  367. int opt_isdir(const char *name);
  368. int opt_format(const char *s, unsigned long flags, int *result);
  369. void print_format_error(int format, unsigned long flags);
  370. int opt_printf_stderr(const char *fmt, ...);
  371. int opt_string(const char *name, const char **options);
  372. int opt_pair(const char *arg, const OPT_PAIR * pairs, int *result);
  373. int opt_verify(int i, X509_VERIFY_PARAM *vpm);
  374. int opt_rand(int i);
  375. int opt_provider(int i);
  376. int opt_provider_option_given(void);
  377. char **opt_rest(void);
  378. int opt_num_rest(void);
  379. int opt_check_rest_arg(const char *expected);
  380. /* Returns non-zero if legacy paths are still available */
  381. int opt_legacy_okay(void);
  382. #endif /* OSSL_APPS_OPT_H */