summaryrefslogtreecommitdiffstats
path: root/apps/apps.h
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2015-09-04 02:46:47 +0200
committerRichard Levitte <levitte@openssl.org>2015-09-06 01:29:36 +0200
commitd303b9d85e1888494785f87ebd9bd233e63564a9 (patch)
treeefb8e31a76f8c4541d79246b10a4fb70f79347c7 /apps/apps.h
parente9daa8150abc8d96dd1e4dcd764355851f06ef2b (diff)
Make the handling of output and input formats consistent
Most of all, we needed to sort out which ones are binary and which ones are text, and make sure they are treated accordingly and consistently so Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'apps/apps.h')
-rw-r--r--apps/apps.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/apps/apps.h b/apps/apps.h
index a134b8da98..cd70948313 100644
--- a/apps/apps.h
+++ b/apps/apps.h
@@ -163,8 +163,9 @@ int app_load_modules(const CONF *config);
void unbuffer(FILE *fp);
/* Often used in calls to bio_open_default. */
-# define RB(xformat) ((xformat) == FORMAT_ASN1 ? "rb" : "r")
-# define WB(xformat) ((xformat) == FORMAT_ASN1 ? "wb" : "w")
+# define RB(xformat) (((xformat) & B_FORMAT_TEXT) ? "rb" : "r")
+# define WB(xformat) (((xformat) & B_FORMAT_TEXT) ? "wb" : "w")
+# define AB(xformat) (((xformat) & B_FORMAT_TEXT) ? "ab" : "a")
/*
* Common verification options.
@@ -535,19 +536,20 @@ void print_cert_checks(BIO *bio, X509 *x,
void store_setup_crl_download(X509_STORE *st);
/* See OPT_FMT_xxx, above. */
+# define B_FORMAT_TEXT 0x8000
# define FORMAT_UNDEF 0
# define FORMAT_ASN1 1
-# define FORMAT_TEXT 2
-# define FORMAT_PEM 3
+# define FORMAT_TEXT (2 | B_FORMAT_TEXT)
+# define FORMAT_PEM (3 | B_FORMAT_TEXT)
# define FORMAT_PKCS12 5
-# define FORMAT_SMIME 6
+# define FORMAT_SMIME (6 | B_FORMAT_TEXT)
# define FORMAT_ENGINE 7
-# define FORMAT_PEMRSA 9 /* PEM RSAPubicKey format */
-# define FORMAT_ASN1RSA 10 /* DER RSAPubicKey format */
-# define FORMAT_MSBLOB 11 /* MS Key blob format */
-# define FORMAT_PVK 12 /* MS PVK file format */
-# define FORMAT_HTTP 13 /* Download using HTTP */
-# define FORMAT_NSS 14 /* NSS keylog format */
+# define FORMAT_PEMRSA (9 | B_FORMAT_TEXT) /* PEM RSAPubicKey format */
+# define FORMAT_ASN1RSA 10 /* DER RSAPubicKey format */
+# define FORMAT_MSBLOB 11 /* MS Key blob format */
+# define FORMAT_PVK 12 /* MS PVK file format */
+# define FORMAT_HTTP 13 /* Download using HTTP */
+# define FORMAT_NSS 14 /* NSS keylog format */
# define EXT_COPY_NONE 0
# define EXT_COPY_ADD 1