summaryrefslogtreecommitdiff
path: root/src/lib/libssl/t1_enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/t1_enc.c')
-rw-r--r--src/lib/libssl/t1_enc.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/lib/libssl/t1_enc.c b/src/lib/libssl/t1_enc.c
index c6140e9b34..64e1dd5b63 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.157 2022/11/26 16:08:56 tb Exp $ */ 1/* $OpenBSD: t1_enc.c,v 1.158 2024/07/20 04:04:23 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 *
@@ -357,15 +357,17 @@ tls1_setup_key_block(SSL *s)
357 if (s->s3->hs.tls12.key_block != NULL) 357 if (s->s3->hs.tls12.key_block != NULL)
358 return (1); 358 return (1);
359 359
360 if (s->session->cipher && 360 if (s->s3->hs.cipher == NULL)
361 (s->session->cipher->algorithm_mac & SSL_AEAD)) { 361 return (0);
362 if (!ssl_cipher_get_evp_aead(s->session, &aead)) { 362
363 if ((s->s3->hs.cipher->algorithm_mac & SSL_AEAD) != 0) {
364 if (!ssl_cipher_get_evp_aead(s, &aead)) {
363 SSLerror(s, SSL_R_CIPHER_OR_HASH_UNAVAILABLE); 365 SSLerror(s, SSL_R_CIPHER_OR_HASH_UNAVAILABLE);
364 return (0); 366 return (0);
365 } 367 }
366 } else { 368 } else {
367 /* XXX - mac_type and mac_secret_size are now unused. */ 369 /* XXX - mac_type and mac_secret_size are now unused. */
368 if (!ssl_cipher_get_evp(s->session, &cipher, &mac_hash, 370 if (!ssl_cipher_get_evp(s, &cipher, &mac_hash,
369 &mac_type, &mac_secret_size)) { 371 &mac_type, &mac_secret_size)) {
370 SSLerror(s, SSL_R_CIPHER_OR_HASH_UNAVAILABLE); 372 SSLerror(s, SSL_R_CIPHER_OR_HASH_UNAVAILABLE);
371 return (0); 373 return (0);
@@ -395,12 +397,12 @@ tls1_setup_key_block(SSL *s)
395 */ 397 */
396 s->s3->need_empty_fragments = 1; 398 s->s3->need_empty_fragments = 1;
397 399
398 if (s->session->cipher != NULL) { 400 if (s->s3->hs.cipher != NULL) {
399 if (s->session->cipher->algorithm_enc == SSL_eNULL) 401 if (s->s3->hs.cipher->algorithm_enc == SSL_eNULL)
400 s->s3->need_empty_fragments = 0; 402 s->s3->need_empty_fragments = 0;
401 403
402#ifndef OPENSSL_NO_RC4 404#ifndef OPENSSL_NO_RC4
403 if (s->session->cipher->algorithm_enc == SSL_RC4) 405 if (s->s3->hs.cipher->algorithm_enc == SSL_RC4)
404 s->s3->need_empty_fragments = 0; 406 s->s3->need_empty_fragments = 0;
405#endif 407#endif
406 } 408 }