From: Matt Caswell Date: Wed, 18 May 2022 13:30:24 +0000 (+0100) Subject: Fix some no-comp compilation failures X-Git-Tag: openssl-3.2.0-alpha1~2240 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=976b263d0a8581059c21fb34653df3375667f050;p=thirdparty%2Fopenssl.git Fix some no-comp compilation failures Reviewed-by: Hugo Landau Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/18132) --- diff --git a/ssl/record/methods/tls_common.c b/ssl/record/methods/tls_common.c index 2b26829e4bc..c80dd63631b 100644 --- a/ssl/record/methods/tls_common.c +++ b/ssl/record/methods/tls_common.c @@ -91,17 +91,19 @@ char ssl3_cbc_record_digest_supported(const EVP_MD_CTX *ctx) } } +#ifndef OPENSSL_NO_COMP static int rlayer_allow_compression(OSSL_RECORD_LAYER *rl) { if (rl->options & SSL_OP_NO_COMPRESSION) return 0; -#if 0 +# if 0 /* TODO(RECLAYER): Implement ssl_security inside the record layer */ return ssl_security(s, SSL_SECOP_COMPRESSION, 0, 0, NULL); -#else +# else return 1; -#endif +# endif } +#endif static int rlayer_setup_read_buffer(OSSL_RECORD_LAYER *rl) { @@ -1198,7 +1200,9 @@ static void tls_int_free(OSSL_RECORD_LAYER *rl) EVP_CIPHER_CTX_free(rl->enc_read_ctx); EVP_MD_CTX_free(rl->read_hash); +#ifndef OPENSSL_NO_COMP COMP_CTX_free(rl->expand); +#endif OPENSSL_free(rl); } diff --git a/ssl/s3_enc.c b/ssl/s3_enc.c index 1135392a846..bfff734a4f6 100644 --- a/ssl/s3_enc.c +++ b/ssl/s3_enc.c @@ -94,9 +94,7 @@ int ssl3_change_cipher_state(SSL_CONNECTION *s, int which) unsigned char *key, *iv; EVP_CIPHER_CTX *dd; const EVP_CIPHER *ciph; -#ifndef OPENSSL_NO_COMP - const SSL_COMP *comp; -#endif + const SSL_COMP *comp = NULL; const EVP_MD *md; int mdi; size_t n, iv_len, key_len; diff --git a/ssl/t1_enc.c b/ssl/t1_enc.c index 9d3827adbcf..b7adc9dafff 100644 --- a/ssl/t1_enc.c +++ b/ssl/t1_enc.c @@ -156,9 +156,7 @@ int tls1_change_cipher_state(SSL_CONNECTION *s, int which) unsigned char *key, *iv; EVP_CIPHER_CTX *dd; const EVP_CIPHER *c; -#ifndef OPENSSL_NO_COMP - const SSL_COMP *comp; -#endif + const SSL_COMP *comp = NULL; const EVP_MD *m; int mac_type; size_t mac_secret_size;