summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls12_record_layer.c
diff options
context:
space:
mode:
authortb <>2022-01-14 09:12:15 +0000
committertb <>2022-01-14 09:12:15 +0000
commit1bcac5c126c6b65375ad4d9e9a98d8b7b3398b79 (patch)
tree1f0b0741a18bee89f4d9dcd32502bbdbb2079dd8 /src/lib/libssl/tls12_record_layer.c
parent971bbef45c2d6baed8d7955cf82726f084fa8398 (diff)
downloadopenbsd-1bcac5c126c6b65375ad4d9e9a98d8b7b3398b79.tar.gz
openbsd-1bcac5c126c6b65375ad4d9e9a98d8b7b3398b79.tar.bz2
openbsd-1bcac5c126c6b65375ad4d9e9a98d8b7b3398b79.zip
Convert the new record layers to opaque EVP_AEAD_CTX
ok jsing
Diffstat (limited to 'src/lib/libssl/tls12_record_layer.c')
-rw-r--r--src/lib/libssl/tls12_record_layer.c9
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)
61static void 61static void
62tls12_record_protection_clear(struct tls12_record_protection *rp) 62tls12_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. */