aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-04-13 02:40:39 +0200
committerRichard Levitte <levitte@openssl.org>2016-04-13 11:36:46 +0200
commit802d2243083a46fbb4afb15a78c3db07f0092af3 (patch)
tree434c9dbad28cd07d47274f61b6f59e7e342b3fe9
parentda430a5555b97cc0fe5e9bf6cfd64be98e8b5bcb (diff)
downloadopenssl-802d2243083a46fbb4afb15a78c3db07f0092af3.tar.gz
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.c15
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");