diff options
author | Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> | 2018-09-26 08:30:54 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-06-09 09:47:34 +0200 |
commit | ca857d7332d042142ced23b37fdd1d52dbf152b9 (patch) | |
tree | 014dfa710ee4036b0566cc453cd7caf5c4820ec5 /apps/include/opt.h | |
parent | dc19f2f6223db0578be826d03ba8012cca076d28 (diff) |
apps/opt: refactor input format parsing
- split OPT_FMT_PEMDER flag into OPT_FMT_PEM and OPT_FMT_DER
- add OPT_FMT_B64 option (`-inform b64`)
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7320)
Diffstat (limited to 'apps/include/opt.h')
-rw-r--r-- | apps/include/opt.h | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/apps/include/opt.h b/apps/include/opt.h index 787dac5468..396215735b 100644 --- a/apps/include/opt.h +++ b/apps/include/opt.h @@ -343,22 +343,27 @@ typedef struct string_int_pair_st { } OPT_PAIR, STRINT_PAIR; /* Flags to pass into opt_format; see FORMAT_xxx, below. */ -# define OPT_FMT_PEMDER (1L << 1) -# define OPT_FMT_PKCS12 (1L << 2) -# define OPT_FMT_SMIME (1L << 3) -# define OPT_FMT_ENGINE (1L << 4) -# define OPT_FMT_MSBLOB (1L << 5) -/* (1L << 6) was OPT_FMT_NETSCAPE, but wasn't used */ -# define OPT_FMT_NSS (1L << 7) -# define OPT_FMT_TEXT (1L << 8) -# define OPT_FMT_HTTP (1L << 9) -# define OPT_FMT_PVK (1L << 10) +# define OPT_FMT_PEM (1L << 1) +# define OPT_FMT_DER (1L << 2) +# define OPT_FMT_B64 (1L << 3) +# define OPT_FMT_PKCS12 (1L << 4) +# define OPT_FMT_SMIME (1L << 5) +# define OPT_FMT_ENGINE (1L << 6) +# define OPT_FMT_MSBLOB (1L << 7) +# define OPT_FMT_NSS (1L << 8) +# define OPT_FMT_TEXT (1L << 9) +# define OPT_FMT_HTTP (1L << 10) +# define OPT_FMT_PVK (1L << 11) + +# define OPT_FMT_PEMDER (OPT_FMT_PEM | OPT_FMT_DER) +# define OPT_FMT_ASN1 (OPT_FMT_PEM | OPT_FMT_DER | OPT_FMT_B64) # define OPT_FMT_PDE (OPT_FMT_PEMDER | OPT_FMT_ENGINE) # define OPT_FMT_PDS (OPT_FMT_PEMDER | OPT_FMT_SMIME) # define OPT_FMT_ANY ( \ - OPT_FMT_PEMDER | OPT_FMT_PKCS12 | OPT_FMT_SMIME | \ - OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NSS | \ - OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK) + OPT_FMT_PEM | OPT_FMT_DER | OPT_FMT_B64 | \ + OPT_FMT_PKCS12 | OPT_FMT_SMIME | \ + OPT_FMT_ENGINE | OPT_FMT_MSBLOB | OPT_FMT_NSS | \ + OPT_FMT_TEXT | OPT_FMT_HTTP | OPT_FMT_PVK) /* Divide options into sections when displaying usage */ #define OPT_SECTION(sec) { OPT_SECTION_STR, 1, '-', sec " options:\n" } |