TLS: remove legacy code path supporting special CBC mode
authorPauli <paul.dale@oracle.com>
Sun, 6 Sep 2020 03:44:08 +0000 (13:44 +1000)
committerPauli <paul.dale@oracle.com>
Wed, 9 Sep 2020 07:59:08 +0000 (17:59 +1000)
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/11961)

ssl/record/ssl3_record.c
ssl/s3_cbc.c

index baa4f239bf5b4c871bf1daefd83d46d43bac7052..a45e5ee9cb5cc71529d580eb159d78f4867b561f 100644 (file)
@@ -1335,6 +1335,9 @@ int n_ssl3_mac(SSL *ssl, SSL3_RECORD *rec, unsigned char *md, int sending)
     if (!sending &&
         EVP_CIPHER_CTX_mode(ssl->enc_read_ctx) == EVP_CIPH_CBC_MODE &&
         ssl3_cbc_record_digest_supported(hash)) {
+#ifdef OPENSSL_NO_DEPRECATED_3_0
+        return 0;
+#else
         /*
          * This is a CBC-encrypted record. We must avoid leaking any
          * timing-side channel information about how many blocks of data we
@@ -1368,6 +1371,7 @@ int n_ssl3_mac(SSL *ssl, SSL3_RECORD *rec, unsigned char *md, int sending)
                                    rec->length, rec->orig_len,
                                    mac_sec, md_size, 1) <= 0)
             return 0;
+#endif
     } else {
         unsigned int md_size_u;
         /* Chop the digest off the end :-) */
index 4895f43568cc4a6721df944b427e41da1653a927..59e4178636241f05cc4df1ab6451519e518db315 100644 (file)
@@ -31,6 +31,7 @@
 #include <openssl/sha.h>
 
 char ssl3_cbc_record_digest_supported(const EVP_MD_CTX *ctx);
+#ifndef OPENSSL_NO_DEPRECATED_3_0
 int ssl3_cbc_digest_record(const EVP_MD *md,
                            unsigned char *md_out,
                            size_t *md_out_size,
@@ -128,6 +129,7 @@ static void tls1_sha512_final_raw(void *ctx, unsigned char *md_out)
         l2n8(sha512->h[i], md_out);
     }
 }
+#endif
 
 #undef  LARGEST_DIGEST_CTX
 #define LARGEST_DIGEST_CTX SHA512_CTX
@@ -151,6 +153,7 @@ char ssl3_cbc_record_digest_supported(const EVP_MD_CTX *ctx)
     }
 }
 
+#ifndef OPENSSL_NO_DEPRECATED_3_0
 /*-
  * ssl3_cbc_digest_record computes the MAC of a decrypted, padded SSLv3/TLS
  * record.
@@ -523,3 +526,4 @@ int ssl3_cbc_digest_record(const EVP_MD *md,
     EVP_MD_CTX_free(md_ctx);
     return ret;
 }
+#endif