]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.8-20230121
authorWietse Venema <wietse@porcupine.org>
Sat, 21 Jan 2023 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sun, 22 Jan 2023 18:47:34 +0000 (13:47 -0500)
postfix/HISTORY
postfix/proto/stop.double-history
postfix/src/global/mail_version.h
postfix/src/tls/tls.h
postfix/src/tls/tls_client.c
postfix/src/tls/tls_server.c

index e412ef54c7e468ec2fa12771076502b8eddd6994..b93da842b96b8128f3d2afa95c8c4b91ef7747c6 100644 (file)
@@ -26777,3 +26777,12 @@ Apologies for any names omitted.
 
        Minor wordsmithing. Files: text in proto/postconf.proto,
        warning message tls.tls_dh.c.
+
+20230115
+       Workaround for a breaking change in OpenSSL 3: always turn
+       on SSL_OP_IGNORE_UNEXPECTED_EOF, to avoid warning messages
+       and missed opportunities for TLS session reuse. This is
+       safe because the SMTP protocol implements application-level
+       framing, and is therefore not affected by TLS truncation
+       attacks. Fix by Viktor Dukhovni. Files: tls/tls.h, tls_client.c,
+       tls/tls_server.c.
index 8bab914028ccc1b6ee97b9b0eccf8887b2f95c55..072374f681d06b384b424c4f450884e4f61fe260 100644 (file)
@@ -15,3 +15,4 @@
  proto postconf proto src tlsproxy tlsproxy c src smtpd smtpd c 
  src tls tls h src tls tls_proxy_client_misc c src tls tls_misc c 
  src global mail_params h src smtp smtp c 
+ attacks Fix by Viktor Dukhovni Files tls tls h tls_client c 
index 687370c475725e13bc2656c29192dfee25256563..07663c44aace64a8b72f95c9807a4e11b0c9e752 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      "20230108"
+#define MAIL_RELEASE_DATE      "20230121"
 #define MAIL_VERSION_NUMBER    "3.8"
 
 #ifdef SNAPSHOT
index c98d828e52450371f1433f07e8d7922ce41e6cfb..00515ee93bbfb39715270820a56c3d5f28a62fe8 100644 (file)
@@ -387,6 +387,13 @@ extern void tls_param_init(void);
 #define SSL_OP_NO_TLSv1_3      0L      /* Noop */
 #endif
 
+/*
+ * Always used when defined, SMTP has no truncation attacks.
+ */
+#ifndef SSL_OP_IGNORE_UNEXPECTED_EOF
+#define SSL_OP_IGNORE_UNEXPECTED_EOF    0L
+#endif
+
 #define TLS_KNOWN_PROTOCOLS \
        ( TLS_PROTOCOL_SSLv2 | TLS_PROTOCOL_SSLv3 | TLS_PROTOCOL_TLSv1 \
           | TLS_PROTOCOL_TLSv1_1 | TLS_PROTOCOL_TLSv1_2 | TLS_PROTOCOL_TLSv1_3 )
@@ -403,7 +410,8 @@ extern void tls_param_init(void);
  * just exposed via hex codes or named elements of tls_ssl_options.
  */
 #define TLS_SSL_OP_MANAGED_BITS \
-       (SSL_OP_CIPHER_SERVER_PREFERENCE | TLS_SSL_OP_PROTOMASK(~0))
+       (SSL_OP_CIPHER_SERVER_PREFERENCE | SSL_OP_IGNORE_UNEXPECTED_EOF | \
+        TLS_SSL_OP_PROTOMASK(~0))
 
 extern int tls_proto_mask_lims(const char *, int *, int *);
 
index 4ffb0901c2e3748243b7657841681a6429016f68..d63d65023d402e61e0b70c02e810860170526f4b 100644 (file)
@@ -713,6 +713,15 @@ TLS_APPL_STATE *tls_client_init(const TLS_CLIENT_INIT_PROPS *props)
     }
     tls_dane_digest_init(client_ctx, fpt_alg);
 
+    /*
+     * Presently we use TLS only with SMTP where truncation attacks are not
+     * possible as a result of application framing.  If we ever use TLS in
+     * some other application protocol where truncation could be relevant,
+     * we'd need to disable truncation detection conditionally, or explicitly
+     * clear the option in that code path.
+     */
+    off |= SSL_OP_IGNORE_UNEXPECTED_EOF;
+
     /*
      * Protocol selection is destination dependent, so we delay the protocol
      * selection options to the per-session SSL object.
index 6caf3ab54130bb8f0bbf074134dcff75594b3c27..b76cfbc700ff76d0b46c99928f0c79ddbb225d9d 100644 (file)
@@ -512,6 +512,15 @@ TLS_APPL_STATE *tls_server_init(const TLS_SERVER_INIT_PROPS *props)
     if (scache_timeout <= 0)
        cachable = 0;
 
+    /*
+     * Presently we use TLS only with SMTP where truncation attacks are not
+     * possible as a result of application framing.  If we ever use TLS in
+     * some other application protocol where truncation could be relevant,
+     * we'd need to disable truncation detection conditionally, or explicitly
+     * clear the option in that code path.
+     */
+    off |= SSL_OP_IGNORE_UNEXPECTED_EOF;
+
     /*
      * Protocol work-arounds, OpenSSL version dependent.
      */