From 03da0846df6b4e459ed93e15070fbda54d01da85 Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Tue, 17 Mar 2020 11:11:36 -0400 Subject: [PATCH] ssl - improve documentation on mbedtls_ssl_read and PEER_CLOSE_NOTIFY Add a description of MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY to the documentation, as suggested by hanno-arm. Signed-off-by: Andrzej Kurek --- include/mbedtls/ssl.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/mbedtls/ssl.h b/include/mbedtls/ssl.h index b3c5288c0..136d7e6c6 100644 --- a/include/mbedtls/ssl.h +++ b/include/mbedtls/ssl.h @@ -3739,7 +3739,14 @@ int mbedtls_ssl_renegotiate( mbedtls_ssl_context *ssl ); * * \return The (positive) number of bytes read if successful. * \return \c 0 if the read end of the underlying transport was closed - * - in this case you must stop using the context (see below). + * without sending a CloseNotify beforehand, which might happen + * because of various reasons (internal error of an underlying + * stack, non-conformant peer not sending a CloseNotify and + * such) - in this case you must stop using the context + * (see below). + * \return #MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY if the underlying + * transport is still functional, but the peer has + * acknowledged to not send anything anymore. * \return #MBEDTLS_ERR_SSL_WANT_READ or #MBEDTLS_ERR_SSL_WANT_WRITE * if the handshake is incomplete and waiting for data to * be available for reading from or writing to the underlying