From: jsing Date: Mon, 19 Apr 2021 17:03:39 +0000 (+0000) Subject: Move new_mac_secret_size into the TLSv1.2 handshake struct. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=759d1726deb7b67af02c9155a28a83253ddfb187;p=openbsd Move new_mac_secret_size into the TLSv1.2 handshake struct. Drop the 'new_' prefix in the process. ok inoguchi@ tb@ --- diff --git a/lib/libssl/ssl_locl.h b/lib/libssl/ssl_locl.h index 3b86f5874b0..f5287b25800 100644 --- a/lib/libssl/ssl_locl.h +++ b/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/lib/libssl/t1_enc.c b/lib/libssl/t1_enc.c index 0ddd52b5301..613eb4cf188 100644 --- a/lib/libssl/t1_enc.c +++ b/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,