]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-ssl-iostream: Fixed reporting errors returned by OpenSSL.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 21 Apr 2016 18:41:23 +0000 (21:41 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 21 Apr 2016 18:42:24 +0000 (21:42 +0300)
We were always logging all errors as "Stacked error" and then returning
"Unknown error".

src/lib-ssl-iostream/iostream-openssl-common.c

index cbdbc4407b368672ae3a121547f7dc60c4c87781..572689763d770f450d3a5318fc848a7c978a0d59 100644 (file)
@@ -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));