summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
authortb <>2020-01-21 04:45:18 +0000
committertb <>2020-01-21 04:45:18 +0000
commitf9666f9db9296ab0643d410ce0eb3486772e422d (patch)
treef3397501dbd7fd167a66813a717ee53918ce41dd /src/lib/libssl/ssl_lib.c
parent46c0c6a7b768b3aa9319915bd3af13633e7745e2 (diff)
downloadopenbsd-f9666f9db9296ab0643d410ce0eb3486772e422d.tar.gz
openbsd-f9666f9db9296ab0643d410ce0eb3486772e422d.tar.bz2
openbsd-f9666f9db9296ab0643d410ce0eb3486772e422d.zip
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
Diffstat (limited to 'src/lib/libssl/ssl_lib.c')
-rw-r--r--src/lib/libssl/ssl_lib.c7
1 files changed, 6 insertions, 1 deletions
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 @@
1/* $OpenBSD: ssl_lib.c,v 1.207 2019/11/17 19:07:07 jsing Exp $ */ 1/* $OpenBSD: ssl_lib.c,v 1.208 2020/01/21 04:45:18 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -193,6 +193,9 @@ SSL_clear(SSL *s)
193 s->internal->rwstate = SSL_NOTHING; 193 s->internal->rwstate = SSL_NOTHING;
194 s->internal->rstate = SSL_ST_READ_HEADER; 194 s->internal->rstate = SSL_ST_READ_HEADER;
195 195
196 tls13_ctx_free(s->internal->tls13);
197 s->internal->tls13 = NULL;
198
196 BUF_MEM_free(s->internal->init_buf); 199 BUF_MEM_free(s->internal->init_buf);
197 s->internal->init_buf = NULL; 200 s->internal->init_buf = NULL;
198 201
@@ -524,6 +527,8 @@ SSL_free(SSL *s)
524 BIO_free_all(s->rbio); 527 BIO_free_all(s->rbio);
525 BIO_free_all(s->wbio); 528 BIO_free_all(s->wbio);
526 529
530 tls13_ctx_free(s->internal->tls13);
531
527 BUF_MEM_free(s->internal->init_buf); 532 BUF_MEM_free(s->internal->init_buf);
528 533
529 /* add extra stuff */ 534 /* add extra stuff */