From d3ea176e147145d3bbf57b91913d656b07ae80ef Mon Sep 17 00:00:00 2001
From: jsing <>
Date: Mon, 19 Apr 2021 17:03:39 +0000
Subject: Move new_mac_secret_size into the TLSv1.2 handshake struct.

Drop the 'new_' prefix in the process.

ok inoguchi@ tb@
---
 src/lib/libssl/ssl_locl.h | 6 ++++--
 src/lib/libssl/t1_enc.c   | 6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

(limited to 'src')

diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h
index 3b86f5874b..f5287b2580 100644
--- a/src/lib/libssl/ssl_locl.h
+++ b/src/lib/libssl/ssl_locl.h
@@ -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;
diff --git a/src/lib/libssl/t1_enc.c b/src/lib/libssl/t1_enc.c
index 0ddd52b530..613eb4cf18 100644
--- a/src/lib/libssl/t1_enc.c
+++ b/src/lib/libssl/t1_enc.c
@@ -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,
-- 
cgit v1.2.3-55-g6feb