diff options
-rw-r--r-- | src/lib/libssl/ssl_locl.h | 7 | ||||
-rw-r--r-- | src/lib/libssl/t1_enc.c | 8 | ||||
-rw-r--r-- | src/lib/libssl/tls12_record_layer.c | 14 |
3 files changed, 19 insertions, 10 deletions
diff --git a/src/lib/libssl/ssl_locl.h b/src/lib/libssl/ssl_locl.h index f5287b2580..86d1b6e10b 100644 --- a/src/lib/libssl/ssl_locl.h +++ b/src/lib/libssl/ssl_locl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssl_locl.h,v 1.335 2021/04/19 17:03:39 jsing Exp $ */ | 1 | /* $OpenBSD: ssl_locl.h,v 1.336 2021/04/19 17:26:39 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -528,6 +528,8 @@ int tls12_record_layer_write_overhead(struct tls12_record_layer *rl, | |||
528 | size_t *overhead); | 528 | size_t *overhead); |
529 | int tls12_record_layer_read_protected(struct tls12_record_layer *rl); | 529 | int tls12_record_layer_read_protected(struct tls12_record_layer *rl); |
530 | int tls12_record_layer_write_protected(struct tls12_record_layer *rl); | 530 | int tls12_record_layer_write_protected(struct tls12_record_layer *rl); |
531 | const EVP_AEAD *tls12_record_layer_aead(struct tls12_record_layer *rl); | ||
532 | const EVP_CIPHER *tls12_record_layer_cipher(struct tls12_record_layer *rl); | ||
531 | void tls12_record_layer_set_aead(struct tls12_record_layer *rl, | 533 | void tls12_record_layer_set_aead(struct tls12_record_layer *rl, |
532 | const EVP_AEAD *aead); | 534 | const EVP_AEAD *aead); |
533 | void tls12_record_layer_set_cipher_hash(struct tls12_record_layer *rl, | 535 | void tls12_record_layer_set_cipher_hash(struct tls12_record_layer *rl, |
@@ -951,9 +953,6 @@ typedef struct ssl3_state_internal_st { | |||
951 | char ctype[SSL3_CT_NUMBER]; | 953 | char ctype[SSL3_CT_NUMBER]; |
952 | STACK_OF(X509_NAME) *ca_names; | 954 | STACK_OF(X509_NAME) *ca_names; |
953 | 955 | ||
954 | const EVP_CIPHER *new_sym_enc; | ||
955 | const EVP_AEAD *new_aead; | ||
956 | |||
957 | int cert_request; | 956 | int cert_request; |
958 | } tmp; | 957 | } tmp; |
959 | 958 | ||
diff --git a/src/lib/libssl/t1_enc.c b/src/lib/libssl/t1_enc.c index 613eb4cf18..6b3d40d8ec 100644 --- a/src/lib/libssl/t1_enc.c +++ b/src/lib/libssl/t1_enc.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: t1_enc.c,v 1.137 2021/04/19 17:03:39 jsing Exp $ */ | 1 | /* $OpenBSD: t1_enc.c,v 1.138 2021/04/19 17:26:39 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -312,8 +312,8 @@ tls1_change_cipher_state(SSL *s, int which) | |||
312 | const EVP_AEAD *aead; | 312 | const EVP_AEAD *aead; |
313 | char is_read, use_client_keys; | 313 | char is_read, use_client_keys; |
314 | 314 | ||
315 | cipher = S3I(s)->tmp.new_sym_enc; | 315 | aead = tls12_record_layer_aead(s->internal->rl); |
316 | aead = S3I(s)->tmp.new_aead; | 316 | cipher = tls12_record_layer_cipher(s->internal->rl); |
317 | 317 | ||
318 | /* | 318 | /* |
319 | * is_read is true if we have just read a ChangeCipherSpec message, | 319 | * is_read is true if we have just read a ChangeCipherSpec message, |
@@ -424,8 +424,6 @@ tls1_setup_key_block(SSL *s) | |||
424 | if (!ssl_get_handshake_evp_md(s, &handshake_hash)) | 424 | if (!ssl_get_handshake_evp_md(s, &handshake_hash)) |
425 | return (0); | 425 | return (0); |
426 | 426 | ||
427 | S3I(s)->tmp.new_aead = aead; | ||
428 | S3I(s)->tmp.new_sym_enc = cipher; | ||
429 | S3I(s)->hs.tls12.mac_secret_size = mac_secret_size; | 427 | S3I(s)->hs.tls12.mac_secret_size = mac_secret_size; |
430 | 428 | ||
431 | tls12_record_layer_set_aead(s->internal->rl, aead); | 429 | tls12_record_layer_set_aead(s->internal->rl, aead); |
diff --git a/src/lib/libssl/tls12_record_layer.c b/src/lib/libssl/tls12_record_layer.c index 6cf8b31c63..7e29f4ed65 100644 --- a/src/lib/libssl/tls12_record_layer.c +++ b/src/lib/libssl/tls12_record_layer.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls12_record_layer.c,v 1.25 2021/03/29 16:19:15 jsing Exp $ */ | 1 | /* $OpenBSD: tls12_record_layer.c,v 1.26 2021/04/19 17:26:39 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2020 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2020 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -254,6 +254,18 @@ tls12_record_layer_write_protected(struct tls12_record_layer *rl) | |||
254 | return tls12_record_protection_engaged(rl->write); | 254 | return tls12_record_protection_engaged(rl->write); |
255 | } | 255 | } |
256 | 256 | ||
257 | const EVP_AEAD * | ||
258 | tls12_record_layer_aead(struct tls12_record_layer *rl) | ||
259 | { | ||
260 | return rl->aead; | ||
261 | } | ||
262 | |||
263 | const EVP_CIPHER * | ||
264 | tls12_record_layer_cipher(struct tls12_record_layer *rl) | ||
265 | { | ||
266 | return rl->cipher; | ||
267 | } | ||
268 | |||
257 | void | 269 | void |
258 | tls12_record_layer_set_aead(struct tls12_record_layer *rl, const EVP_AEAD *aead) | 270 | tls12_record_layer_set_aead(struct tls12_record_layer *rl, const EVP_AEAD *aead) |
259 | { | 271 | { |