diff options
author | Richard Levitte <levitte@openssl.org> | 2015-09-04 12:49:06 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2015-09-06 01:35:54 +0200 |
commit | bdd58d98467e9f0f6635c1628e1eae304383afb1 (patch) | |
tree | 1927fc4a65f8fd8b5705c5c5e0278beabf2c2b28 /apps/ocsp.c | |
parent | d303b9d85e1888494785f87ebd9bd233e63564a9 (diff) |
Change the way apps open their input and output files
The different apps had the liberty to decide whether they would open their
input and output files in binary mode or not, which could be confusing if
two different apps were handling the same type of file in different ways.
The solution is to centralise the decision of low level file organisation,
and that the apps would use a selection of formats to state the intent of
the file.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Diffstat (limited to 'apps/ocsp.c')
-rw-r--r-- | apps/ocsp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/ocsp.c b/apps/ocsp.c index 7193dae20b..e97d06e7c1 100644 --- a/apps/ocsp.c +++ b/apps/ocsp.c @@ -486,7 +486,7 @@ int ocsp_main(int argc, char **argv) if (!app_load_modules(NULL)) goto end; - out = bio_open_default(outfile, "w"); + out = bio_open_default(outfile, 'w', FORMAT_TEXT); if (out == NULL) goto end; @@ -494,7 +494,7 @@ int ocsp_main(int argc, char **argv) add_nonce = 0; if (!req && reqin) { - derbio = bio_open_default(reqin, "rb"); + derbio = bio_open_default(reqin, 'r', FORMAT_ASN1); if (derbio == NULL) goto end; req = d2i_OCSP_REQUEST_bio(derbio, NULL); @@ -589,7 +589,7 @@ int ocsp_main(int argc, char **argv) OCSP_REQUEST_print(out, req, 0); if (reqout) { - derbio = bio_open_default(reqout, "wb"); + derbio = bio_open_default(reqout, 'w', FORMAT_ASN1); if (derbio == NULL) goto end; i2d_OCSP_REQUEST_bio(derbio, req); @@ -627,7 +627,7 @@ int ocsp_main(int argc, char **argv) goto end; # endif } else if (respin) { - derbio = bio_open_default(respin, "rb"); + derbio = bio_open_default(respin, 'r', FORMAT_ASN1); if (derbio == NULL) goto end; resp = d2i_OCSP_RESPONSE_bio(derbio, NULL); @@ -644,7 +644,7 @@ int ocsp_main(int argc, char **argv) done_resp: if (respout) { - derbio = bio_open_default(respout, "wb"); + derbio = bio_open_default(respout, 'w', FORMAT_ASN1); if (derbio == NULL) goto end; i2d_OCSP_RESPONSE_bio(derbio, resp); |