diff options
author | Todd Short <tshort@akamai.com> | 2022-08-17 17:36:27 -0400 |
---|---|---|
committer | Todd Short <todd.short@me.com> | 2022-10-18 09:30:21 -0400 |
commit | 59d21298df9176b64b41cc8583c7024f7f5895d4 (patch) | |
tree | 6819e56eb1a1916dd85950bb210c27b9904e9859 /crypto/comp | |
parent | caf9317d7d75213990014e07048384be15688889 (diff) |
Convert ZLIB defines to OPENSSL_NO_ZLIB
Use the normal OPENSSL_NO_ prefix to enable/disable ZLIB
Make `BIO_f_zlib()` always available.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18186)
Diffstat (limited to 'crypto/comp')
-rw-r--r-- | crypto/comp/c_zlib.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/crypto/comp/c_zlib.c b/crypto/comp/c_zlib.c index 4ab876b59f..426b8b0b74 100644 --- a/crypto/comp/c_zlib.c +++ b/crypto/comp/c_zlib.c @@ -29,7 +29,7 @@ static COMP_METHOD zlib_method_nozlib = { NULL, }; -#ifndef ZLIB +#ifdef OPENSSL_NO_ZLIB # undef ZLIB_SHARED #else @@ -247,7 +247,7 @@ COMP_METHOD *COMP_zlib(void) { COMP_METHOD *meth = &zlib_method_nozlib; -#ifdef ZLIB +#ifndef OPENSSL_NO_ZLIB if (RUN_ONCE(&zlib_once, ossl_comp_zlib_init)) meth = &zlib_stateful_method; #endif @@ -264,7 +264,7 @@ void ossl_comp_zlib_cleanup(void) #endif } -#ifdef ZLIB +#ifndef OPENSSL_NO_ZLIB /* Zlib based compression/decompression filter BIO */ @@ -304,12 +304,18 @@ static const BIO_METHOD bio_meth_zlib = { bio_zlib_free, bio_zlib_callback_ctrl }; +#endif const BIO_METHOD *BIO_f_zlib(void) { - return &bio_meth_zlib; +#ifndef OPENSSL_NO_ZLIB + if (RUN_ONCE(&zlib_once, ossl_comp_zlib_init)) + return &bio_meth_zlib; +#endif + return NULL; } +#ifndef OPENSSL_NO_ZLIB static int bio_zlib_new(BIO *bi) { BIO_ZLIB_CTX *ctx; |