Fix some no-comp compilation failures
authorMatt Caswell <matt@openssl.org>
Wed, 18 May 2022 13:30:24 +0000 (14:30 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 18 Aug 2022 15:38:12 +0000 (16:38 +0100)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18132)

ssl/record/methods/tls_common.c
ssl/s3_enc.c
ssl/t1_enc.c

index 2b26829e4bca96b1f6d7bb33da0ecd70b357d995..c80dd63631b3f3fdcfdc282ebdcd9f61e3828bf3 100644 (file)
@@ -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);
 }
index 1135392a846f3927c890f0f5c50906813dd3fd95..bfff734a4f685ca5c00d0b9c3b460395dcee9caa 100644 (file)
@@ -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;
index 9d3827adbcf56feb9a25579be74dd70131ebdee7..b7adc9dafffedff317059e54370c2a85071a763b 100644 (file)
@@ -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;