From f7ba6d56f2549cb293706aae8a7276cf0b7acb38 Mon Sep 17 00:00:00 2001 From: Bob Beck Date: Thu, 24 Jan 2019 15:50:48 +0000 Subject: Set pointer variables in tls13 handshake to NULL on clear ok jsing@ bcook@ --- lib/libssl/s3_lib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libssl/s3_lib.c b/lib/libssl/s3_lib.c index 6e4e8eb1d30..b7d87268abc 100644 --- a/lib/libssl/s3_lib.c +++ b/lib/libssl/s3_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_lib.c,v 1.182 2019/01/24 02:56:41 beck Exp $ */ +/* $OpenBSD: s3_lib.c,v 1.183 2019/01/24 15:50:47 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1603,9 +1603,13 @@ ssl3_clear(SSL *s) S3I(s)->tmp.x25519 = NULL; tls13_secrets_destroy(S3I(s)->hs_tls13.secrets); + S3I(s)->hs_tls13.secrets = NULL; freezero(S3I(s)->hs_tls13.x25519_private, X25519_KEY_LENGTH); + S3I(s)->hs_tls13.x25519_private = NULL; freezero(S3I(s)->hs_tls13.x25519_public, X25519_KEY_LENGTH); + S3I(s)->hs_tls13.x25519_public = NULL; freezero(S3I(s)->hs_tls13.x25519_peer_public, X25519_KEY_LENGTH); + S3I(s)->hs_tls13.x25519_peer_public = NULL; freezero(S3I(s)->hs_tls13.cookie, S3I(s)->hs_tls13.cookie_len); S3I(s)->hs_tls13.cookie = NULL; S3I(s)->hs_tls13.cookie_len = 0; -- cgit v1.2.3