From f9666f9db9296ab0643d410ce0eb3486772e422d Mon Sep 17 00:00:00 2001 From: tb <> Date: Tue, 21 Jan 2020 04:45:18 +0000 Subject: Clear and free the tls13_ctx that hangs off an SSL *s from SSL_{clear,free}(3). Make sure the handshake context is cleaned up completely: the hs_tls13 reacharound is taken care of by ssl3_{clear,free}(3). Add a missing tls13_handshake_msg_free() call to tls13_ctx_free(). ok beck jsing --- src/lib/libssl/ssl_lib.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/lib/libssl/ssl_lib.c') diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c index 374342c311..a667b5d294 100644 --- a/src/lib/libssl/ssl_lib.c +++ b/src/lib/libssl/ssl_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_lib.c,v 1.207 2019/11/17 19:07:07 jsing Exp $ */ +/* $OpenBSD: ssl_lib.c,v 1.208 2020/01/21 04:45:18 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -193,6 +193,9 @@ SSL_clear(SSL *s) s->internal->rwstate = SSL_NOTHING; s->internal->rstate = SSL_ST_READ_HEADER; + tls13_ctx_free(s->internal->tls13); + s->internal->tls13 = NULL; + BUF_MEM_free(s->internal->init_buf); s->internal->init_buf = NULL; @@ -524,6 +527,8 @@ SSL_free(SSL *s) BIO_free_all(s->rbio); BIO_free_all(s->wbio); + tls13_ctx_free(s->internal->tls13); + BUF_MEM_free(s->internal->init_buf); /* add extra stuff */ -- cgit v1.2.3-55-g6feb