diff options
Diffstat (limited to 'src/lib/libssl/tls13_record_layer.c')
-rw-r--r-- | src/lib/libssl/tls13_record_layer.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/libssl/tls13_record_layer.c b/src/lib/libssl/tls13_record_layer.c index b49d237951..c68ee3b3a5 100644 --- a/src/lib/libssl/tls13_record_layer.c +++ b/src/lib/libssl/tls13_record_layer.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls13_record_layer.c,v 1.66 2022/01/06 18:18:13 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_record_layer.c,v 1.67 2022/01/14 09:12:15 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -40,10 +40,7 @@ tls13_record_protection_new(void) | |||
40 | void | 40 | void |
41 | tls13_record_protection_clear(struct tls13_record_protection *rp) | 41 | tls13_record_protection_clear(struct tls13_record_protection *rp) |
42 | { | 42 | { |
43 | if (rp->aead_ctx != NULL) { | 43 | EVP_AEAD_CTX_free(rp->aead_ctx); |
44 | EVP_AEAD_CTX_cleanup(rp->aead_ctx); | ||
45 | freezero(rp->aead_ctx, sizeof(*rp->aead_ctx)); | ||
46 | } | ||
47 | 44 | ||
48 | tls13_secret_cleanup(&rp->iv); | 45 | tls13_secret_cleanup(&rp->iv); |
49 | tls13_secret_cleanup(&rp->nonce); | 46 | tls13_secret_cleanup(&rp->nonce); |
@@ -461,7 +458,7 @@ tls13_record_layer_set_traffic_key(const EVP_AEAD *aead, const EVP_MD *hash, | |||
461 | 458 | ||
462 | tls13_record_protection_clear(rp); | 459 | tls13_record_protection_clear(rp); |
463 | 460 | ||
464 | if ((rp->aead_ctx = calloc(1, sizeof(*rp->aead_ctx))) == NULL) | 461 | if ((rp->aead_ctx = EVP_AEAD_CTX_new()) == NULL) |
465 | return 0; | 462 | return 0; |
466 | 463 | ||
467 | if (!tls13_secret_init(&rp->iv, EVP_AEAD_nonce_length(aead))) | 464 | if (!tls13_secret_init(&rp->iv, EVP_AEAD_nonce_length(aead))) |