Remove some miscellaneous references to SSL_CONNECTION
authorMatt Caswell <matt@openssl.org>
Wed, 31 Aug 2022 15:45:55 +0000 (16:45 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 23 Sep 2022 13:54:49 +0000 (14:54 +0100)
There were a small number of references to the SSL_CONNECTION that can
be removed easily and replaced with record layer equivalents.

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19198)

ssl/record/methods/tls_common.c

index 85b5bcd483b35dec82cd7cb1a214522ce51d60e0..809a9f8fb425b9cf882983fbdefbbab602a40262 100644 (file)
@@ -1710,7 +1710,7 @@ int tls_write_records(OSSL_RECORD_LAYER *rl, OSSL_RECORD_TEMPLATE *templates,
          * in the wb->buf
          */
 
-        if (!using_ktls && !SSL_WRITE_ETM(s) && mac_size != 0) {
+        if (!using_ktls && !rl->use_etm && mac_size != 0) {
             unsigned char *mac;
 
             if (!WPACKET_allocate_bytes(thispkt, mac_size, &mac)
@@ -1799,7 +1799,7 @@ int tls_write_records(OSSL_RECORD_LAYER *rl, OSSL_RECORD_TEMPLATE *templates,
             SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
             goto err;
         }
-        if (SSL_WRITE_ETM(s) && mac_size != 0) {
+        if (rl->use_etm && mac_size != 0) {
             unsigned char *mac;
 
             if (!WPACKET_allocate_bytes(thispkt, mac_size, &mac)
@@ -1921,7 +1921,7 @@ int tls_retry_write_records(OSSL_RECORD_LAYER *rl)
                 tls_release_write_buffer(rl);
             return 1;
         } else if (i <= 0) {
-            if (SSL_CONNECTION_IS_DTLS(s)) {
+            if (rl->isdtls) {
                 /*
                  * For DTLS, just drop it. That's kind of the whole point in
                  * using a datagram service