[openssl] OpenSSL_1_1_1-stable update
tmraz at fedoraproject.org
tmraz at fedoraproject.org
Thu Sep 12 14:38:58 UTC 2019
The branch OpenSSL_1_1_1-stable has been updated
via 86ed78676c660b553696cc10c682962522dfeb6c (commit)
from a44e1b2f20e4ac5e2ac11b63e1ae935981ea9428 (commit)
- Log -----------------------------------------------------------------
commit 86ed78676c660b553696cc10c682962522dfeb6c
Author: Tomas Mraz <tmraz at fedoraproject.org>
Date: Thu Sep 12 12:27:36 2019 +0200
BIO_f_zlib: Properly handle BIO_CTRL_PENDING and BIO_CTRL_WPENDING calls.
There can be data to write in output buffer and data to read that were
not yet read in the input stream.
Fixes #9866
Reviewed-by: Richard Levitte <levitte at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9877)
(cherry picked from commit 6beb8b39ba8e4cb005c1fcd2586ba19e17f04b95)
-----------------------------------------------------------------------
Summary of changes:
crypto/comp/c_zlib.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/crypto/comp/c_zlib.c b/crypto/comp/c_zlib.c
index d688deee5f..7c1be358fd 100644
--- a/crypto/comp/c_zlib.c
+++ b/crypto/comp/c_zlib.c
@@ -598,6 +598,28 @@ static long bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr)
BIO_copy_next_retry(b);
break;
+ case BIO_CTRL_WPENDING:
+ if (ctx->obuf == NULL)
+ return 0;
+
+ if (ctx->odone) {
+ ret = ctx->ocount;
+ } else {
+ ret = ctx->ocount;
+ if (ret == 0)
+ /* Unknown amount pending but we are not finished */
+ ret = 1;
+ }
+ if (ret == 0)
+ ret = BIO_ctrl(next, cmd, num, ptr);
+ break;
+
+ case BIO_CTRL_PENDING:
+ ret = ctx->zin.avail_in;
+ if (ret == 0)
+ ret = BIO_ctrl(next, cmd, num, ptr);
+ break;
+
default:
ret = BIO_ctrl(next, cmd, num, ptr);
break;
More information about the openssl-commits
mailing list