From: Timo Sirainen Date: Thu, 21 Apr 2016 18:41:23 +0000 (+0300) Subject: lib-ssl-iostream: Fixed reporting errors returned by OpenSSL. X-Git-Tag: 2.3.0.rc1~3982 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e69026539591542dcdca3f27dd1652b80b2ef87a;p=thirdparty%2Fdovecot%2Fcore.git lib-ssl-iostream: Fixed reporting errors returned by OpenSSL. We were always logging all errors as "Stacked error" and then returning "Unknown error". --- diff --git a/src/lib-ssl-iostream/iostream-openssl-common.c b/src/lib-ssl-iostream/iostream-openssl-common.c index cbdbc4407b..572689763d 100644 --- a/src/lib-ssl-iostream/iostream-openssl-common.c +++ b/src/lib-ssl-iostream/iostream-openssl-common.c @@ -192,7 +192,7 @@ const char *openssl_iostream_error(void) while ((err = ERR_get_error_line_data(NULL, NULL, &data, &flags)) != 0) { if (ERR_GET_REASON(err) == ERR_R_MALLOC_FAILURE) i_fatal_status(FATAL_OUTOFMEM, "OpenSSL malloc() failed"); - if (ERR_peek_error() != 0) + if (ERR_peek_error() == 0) break; i_error("SSL: Stacked error: %s", ssl_err2str(err, data, flags));