]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
Flush the OpenSSL error queue before each BIO op. tls-debug
authorViktor Dukhovni <postfix-users@dukhovni.org>
Fri, 15 May 2020 03:12:04 +0000 (23:12 -0400)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Fri, 15 May 2020 03:12:04 +0000 (23:12 -0400)
postfix/src/tls/tls_bio_ops.c

index 93d3535d75044ddcfd1391b2b3144a40703fa276..39818f8159a0c90f8329e790d6bd59e5e8bc0ecb 100644 (file)
@@ -196,6 +196,12 @@ int     tls_bio(int fd, int timeout, TLS_SESS_STATE *TLScontext,
      * handling any pending network I/O.
      */
     for (;;) {
+        /*
+         * Flush stale data from SSL error queue, stale errors can confuse
+         * SSL_get_error().
+         */
+        ERR_clear_error();
+
        if (hsfunc)
            status = hsfunc(TLScontext->con);
        else if (rfunc)