Move new_mac_secret_size into the TLSv1.2 handshake struct.
authorjsing <jsing@openbsd.org>
Mon, 19 Apr 2021 17:03:39 +0000 (17:03 +0000)
committerjsing <jsing@openbsd.org>
Mon, 19 Apr 2021 17:03:39 +0000 (17:03 +0000)
Drop the 'new_' prefix in the process.

ok inoguchi@ tb@

lib/libssl/ssl_locl.h
lib/libssl/t1_enc.c

index 3b86f58..f5287b2 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl_locl.h,v 1.334 2021/04/19 16:51:56 jsing Exp $ */
+/* $OpenBSD: ssl_locl.h,v 1.335 2021/04/19 17:03:39 jsing Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -427,6 +427,9 @@ typedef struct ssl_handshake_tls12_st {
        /* Reuse current handshake message. */
        int reuse_message;
 
+       /* Size of the MAC secret. */
+       int mac_secret_size;
+
        /* Record-layer key block for TLS 1.2 and earlier. */
        unsigned char *key_block;
        size_t key_block_len;
@@ -950,7 +953,6 @@ typedef struct ssl3_state_internal_st {
 
                const EVP_CIPHER *new_sym_enc;
                const EVP_AEAD *new_aead;
-               int new_mac_secret_size;
 
                int cert_request;
        } tmp;
index 0ddd52b..613eb4c 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: t1_enc.c,v 1.136 2021/03/29 16:19:15 jsing Exp $ */
+/* $OpenBSD: t1_enc.c,v 1.137 2021/04/19 17:03:39 jsing Exp $ */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -338,7 +338,7 @@ tls1_change_cipher_state(SSL *s, int which)
                iv_len = EVP_CIPHER_iv_length(cipher);
        }
 
-       mac_secret_size = S3I(s)->tmp.new_mac_secret_size;
+       mac_secret_size = S3I(s)->hs.tls12.mac_secret_size;
 
        key_block = S3I(s)->hs.tls12.key_block;
        client_write_mac_secret = key_block;
@@ -426,7 +426,7 @@ tls1_setup_key_block(SSL *s)
 
        S3I(s)->tmp.new_aead = aead;
        S3I(s)->tmp.new_sym_enc = cipher;
-       S3I(s)->tmp.new_mac_secret_size = mac_secret_size;
+       S3I(s)->hs.tls12.mac_secret_size = mac_secret_size;
 
        tls12_record_layer_set_aead(s->internal->rl, aead);
        tls12_record_layer_set_cipher_hash(s->internal->rl, cipher,