diff options
Diffstat (limited to 'src/lib/libssl/tls12_record_layer.c')
-rw-r--r-- | src/lib/libssl/tls12_record_layer.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/libssl/tls12_record_layer.c b/src/lib/libssl/tls12_record_layer.c index f7264a17c5..3568e1876a 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.35 2021/10/23 15:02:27 jsing Exp $ */ | 1 | /* $OpenBSD: tls12_record_layer.c,v 1.36 2022/01/14 09:12:15 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2020 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2020 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -61,10 +61,7 @@ tls12_record_protection_new(void) | |||
61 | static void | 61 | static void |
62 | tls12_record_protection_clear(struct tls12_record_protection *rp) | 62 | tls12_record_protection_clear(struct tls12_record_protection *rp) |
63 | { | 63 | { |
64 | if (rp->aead_ctx != NULL) { | 64 | EVP_AEAD_CTX_free(rp->aead_ctx); |
65 | EVP_AEAD_CTX_cleanup(rp->aead_ctx); | ||
66 | freezero(rp->aead_ctx, sizeof(*rp->aead_ctx)); | ||
67 | } | ||
68 | 65 | ||
69 | freezero(rp->aead_nonce, rp->aead_nonce_len); | 66 | freezero(rp->aead_nonce, rp->aead_nonce_len); |
70 | freezero(rp->aead_fixed_nonce, rp->aead_fixed_nonce_len); | 67 | freezero(rp->aead_fixed_nonce, rp->aead_fixed_nonce_len); |
@@ -422,7 +419,7 @@ tls12_record_layer_ccs_aead(struct tls12_record_layer *rl, | |||
422 | if (!tls12_record_protection_unused(rp)) | 419 | if (!tls12_record_protection_unused(rp)) |
423 | return 0; | 420 | return 0; |
424 | 421 | ||
425 | if ((rp->aead_ctx = calloc(1, sizeof(*rp->aead_ctx))) == NULL) | 422 | if ((rp->aead_ctx = EVP_AEAD_CTX_new()) == NULL) |
426 | return 0; | 423 | return 0; |
427 | 424 | ||
428 | /* AES GCM cipher suites use variable nonce in record. */ | 425 | /* AES GCM cipher suites use variable nonce in record. */ |