diff options
author | Richard Levitte <levitte@openssl.org> | 2016-04-13 02:40:39 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-04-13 11:36:46 +0200 |
commit | 802d2243083a46fbb4afb15a78c3db07f0092af3 (patch) | |
tree | 434c9dbad28cd07d47274f61b6f59e7e342b3fe9 | |
parent | Fix the handling of --with-zlib-include (diff) | |
download | openssl-802d2243083a46fbb4afb15a78c3db07f0092af3.tar.xz openssl-802d2243083a46fbb4afb15a78c3db07f0092af3.zip |
Don't use FORMAT_BASE64 format when compressing / decompressing
When compressing, the output / input is a binary format, not a text
format like BASE64. This is important on Windows, where a ^Z in a
text file is seen as EOF, and there could be a ^Z somewhere in a
compressed file, cutting it short as input.
Reviewed-by: Matt Caswell <matt@openssl.org>
-rw-r--r-- | apps/enc.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/apps/enc.c b/apps/enc.c index 7869987bf1..7f25009ba9 100644 --- a/apps/enc.c +++ b/apps/enc.c @@ -313,12 +313,15 @@ int enc_main(int argc, char **argv) if (verbose) BIO_printf(bio_err, "bufsize=%d\n", bsize); - if (base64) { - if (enc) - outformat = FORMAT_BASE64; - else - informat = FORMAT_BASE64; - } +#ifdef ZLIB + if (!do_zlib) +#endif + if (base64) { + if (enc) + outformat = FORMAT_BASE64; + else + informat = FORMAT_BASE64; + } strbuf = app_malloc(SIZE, "strbuf"); buff = app_malloc(EVP_ENCODE_LENGTH(bsize), "evp buffer"); |