From 59fb81c9500041ebdcaa4cb871f7c2bc664959db Mon Sep 17 00:00:00 2001 From: Eric Blankenhorn Date: Mon, 27 Jan 2020 21:10:47 -0600 Subject: [PATCH] Add fix --- src/ssl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index 7bb58e1fd..e94bfc3ce 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -2947,7 +2947,7 @@ int wolfSSL_shutdown(WOLFSSL* ssl) /* call wolfSSL_shutdown again for bidirectional shutdown */ if (ssl->options.sentNotify && !ssl->options.closeNotify) { - ret = wolfSSL_read(ssl, &tmp, 0); + ret = wolfSSL_read(ssl, &tmp, 1); if (ret < 0) { WOLFSSL_ERROR(ssl->error); ret = WOLFSSL_FATAL_ERROR; @@ -2955,7 +2955,7 @@ int wolfSSL_shutdown(WOLFSSL* ssl) ssl->error = WOLFSSL_ERROR_SYSCALL; /* simulate OpenSSL behavior */ ret = WOLFSSL_SUCCESS; } else if ((ssl->error == WOLFSSL_ERROR_NONE) && - (ret < WOLFSSL_SUCCESS)) { + (ret > 0)) { ret = WOLFSSL_SHUTDOWN_NOT_DONE; } }