From 01a0531bc34b36483687b405c96158565b845e40 Mon Sep 17 00:00:00 2001 From: cameronrich Date: Tue, 19 Jul 2016 20:44:20 +0000 Subject: [PATCH] * Backed out code where close notify from other side closed the socket and ssl session. This needs to be done by the application. git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@261 9a5d90b5-6617-0410-8a86-bb477d3ed2e3 --- ssl/tls1.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ssl/tls1.c b/ssl/tls1.c index 93afe8ce5..59801a995 100644 --- a/ssl/tls1.c +++ b/ssl/tls1.c @@ -226,7 +226,9 @@ EXP_FUNC void STDCALL ssl_free(SSL *ssl) /* may already be free - but be sure */ free(ssl->encrypt_ctx); + ssl->encrypt_ctx = NULL; free(ssl->decrypt_ctx); + ssl->decrypt_ctx = NULL; disposable_free(ssl); certificate_free(ssl); free(ssl->bm_all_data); @@ -1345,8 +1347,8 @@ int basic_read(SSL *ssl, uint8_t **in_data) buf[1] == SSL_ALERT_CLOSE_NOTIFY) { ret = SSL_CLOSE_NOTIFY; - ssl_free(ssl); - SOCKET_CLOSE(ssl->client_fd); + send_alert(ssl, SSL_ALERT_CLOSE_NOTIFY); + SET_SSL_FLAG(SSL_SENT_CLOSE_NOTIFY); } else {