]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.6-20200515
authorWietse Venema <wietse@porcupine.org>
Fri, 15 May 2020 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sat, 16 May 2020 01:25:49 +0000 (21:25 -0400)
postfix/HISTORY
postfix/src/cleanup/cleanup_out.c
postfix/src/global/mail_version.h
postfix/src/tls/tls_bio_ops.c
postfix/src/tls/tls_session.c
postfix/src/tlsproxy/tlsproxy.c

index 856b2db512c8e2cdf19122e6bc75dd756282e303..0e0d69c702ce474711510372438a6c8f480fdd80 100644 (file)
@@ -24760,3 +24760,25 @@ Apologies for any names omitted.
        Bitrot: avoid U_FILE_ACCESS_ERROR after chroot(), by
        initializing the ICU library before making the chroot()
        call. Files: util/midna_domain.[hc], global/mail_params.c.
+
+20200511
+
+       Noise suppression: spurious "SSL_Shutdown:shutdown while
+       in init" warnings. File: tls/tls_session.c.
+
+       Debugging: with a single -v, the cleanup server now also
+       logs output envelope records, so that one -v option shows
+       the input and output. File: cleanup_out.c.
+
+20200515
+
+       Bugfix (introduced: Postfix 2.2): TLS error status info
+       from a PostgreSQL client caused a false 'lost connection'
+       error for an SMTP-over-TLS session in the same Postfix
+       process. Reported by Alexander Vasarab, diagnosed by Viktor
+       Dukhovni. File: tls/tls_bio_ops.c.
+
+       Bugfix (introduced: Postfix 2.8): TLS error status info
+       from one TLS session may cause a false 'lost connection'
+       error for concurrent TLS sessions in the same tlsproxy
+       process. File: tlsproxy/tlsproxy.c.
index 8905fad370680846e58d60eb4b353d4d690fe4ff..3ccebec90c2a61944708a65642450646fc99f4d4 100644 (file)
@@ -118,6 +118,9 @@ void    cleanup_out(CLEANUP_STATE *state, int type, const char *string, ssize_t
 
 #define TEXT_RECORD(t) ((t) == REC_TYPE_NORM || (t) == REC_TYPE_CONT)
 
+    if (msg_verbose && !TEXT_RECORD(type))
+       msg_info("cleanup_out: %c %.*s", type, (int) len, string);
+
     if (var_line_limit <= 0)
        msg_panic("cleanup_out: bad line length limit: %d", var_line_limit);
     do {
index 2edd10252321bf0b81bdc340f11adb4f2c842f9c..e08b3a7a03e70b36feea23f4d7fcdab2292cf0d3 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20200511"
+#define MAIL_RELEASE_DATE      "20200515"
 #define MAIL_VERSION_NUMBER    "3.6"
 
 #ifdef SNAPSHOT
index 1f4ec41f17ea1e704428f5d6a777b991fc04a3b4..9b661954721563bfa2e252359f6cbfe06ad828fa 100644 (file)
@@ -194,6 +194,13 @@ int     tls_bio(int fd, int timeout, TLS_SESS_STATE *TLScontext,
      * handling any pending network I/O.
      */
     for (;;) {
+
+       /*
+        * Flush the per-thread SSL error queue. Otherwise, errors from other
+        * code that also uses TLS may confuse SSL_get_error(3).
+        */
+       ERR_clear_error();
+
        if (hsfunc)
            status = hsfunc(TLScontext->con);
        else if (rfunc)
index 3f6027fc4ef85a81ae66a02da00b007fb9f7f373..a4b7a8f25fe10b029ae93382a7dfd773fd999617 100644 (file)
@@ -118,7 +118,7 @@ void    tls_session_stop(TLS_APPL_STATE *unused_ctx, VSTREAM *stream, int timeou
      * so we will not perform SSL_shutdown() and the session will be removed
      * as being bad.
      */
-    if (!failure) {
+    if (!failure && !SSL_in_init(TLScontext->con)) {
        retval = tls_bio_shutdown(vstream_fileno(stream), timeout, TLScontext);
        if (!var_tls_fast_shutdown && retval == 0)
            tls_bio_shutdown(vstream_fileno(stream), timeout, TLScontext);
index 587b2f61aed487320ca7554d80cca4cc61652fc7..70ea8042ecb41b955c4603d14f1a0bad085bc56f 100644 (file)
@@ -781,6 +781,7 @@ static void tlsp_strategy(TLSP_STATE *state)
         */
        if (state->flags & TLSP_FLAG_DO_HANDSHAKE) {
            state->timeout = state->handshake_timeout;
+           ERR_clear_error();
            if (state->is_server_role)
                ssl_stat = SSL_accept(tls_context->con);
            else
@@ -809,6 +810,7 @@ static void tlsp_strategy(TLSP_STATE *state)
        if (NBBIO_ERROR_FLAGS(plaintext_buf)) {
            if (NBBIO_ACTIVE_FLAGS(plaintext_buf))
                nbbio_disable_readwrite(state->plaintext_buf);
+           ERR_clear_error();
            if (!SSL_in_init(tls_context->con)
                && (ssl_stat = SSL_shutdown(tls_context->con)) < 0) {
                handshake_err = SSL_get_error(tls_context->con, ssl_stat);
@@ -838,6 +840,7 @@ static void tlsp_strategy(TLSP_STATE *state)
         */
        ssl_write_err = SSL_ERROR_NONE;
        while (NBBIO_READ_PEND(plaintext_buf) > 0) {
+           ERR_clear_error();
            ssl_stat = SSL_write(tls_context->con, NBBIO_READ_BUF(plaintext_buf),
                                 NBBIO_READ_PEND(plaintext_buf));
            ssl_write_err = SSL_get_error(tls_context->con, ssl_stat);
@@ -870,6 +873,7 @@ static void tlsp_strategy(TLSP_STATE *state)
         */
        ssl_read_err = SSL_ERROR_NONE;
        while (NBBIO_WRITE_PEND(state->plaintext_buf) < NBBIO_BUFSIZE(plaintext_buf)) {
+           ERR_clear_error();
            ssl_stat = SSL_read(tls_context->con,
                                NBBIO_WRITE_BUF(plaintext_buf)
                                + NBBIO_WRITE_PEND(state->plaintext_buf),