tlsproxy/tlsproxy.c.
Security: in the Postfix SMTP daemon, improved pipelining
- detection and reporting; and detect illegal command pipelining
- before the server greeting. File: smtpd/smtpd.c.
+ detection and reporting; added code to detect illegal command
+ pipelining before the server greeting. File: smtpd/smtpd.c.
20230529
Cleanup: error handling for OpenSSL INI file support. Viktor
Dukhovni. Files: proto/postconf.proto, tls/tls_misc.c.
+
+20230602
+
+ Backwards compatibility for stable releases that originally
+ had no OpenSSL INI support. Skip the new OpenSSL INI support
+ code, unless the Postfix configuration actually specifies
+ non-default tls_config_xxx settings. File: tls/tls_misc.c.
+
+ Cleanup: added a multiple initialization guard in the
+ tls_library_init() function, and made an initialization error
+ sticky. File: tls/tls_misc.c.
char *conf_file = 0;
unsigned long init_opts = 0;
+#define TLS_LIB_INIT_TODO (-1)
+#define TLS_LIB_INIT_ERR (0)
+#define TLS_LIB_INIT_OK (1)
+
+ static int init_res = TLS_LIB_INIT_TODO;
+
+ if (init_res != TLS_LIB_INIT_TODO)
+ return (init_res);
+
+ /*
+ * Backwards compatibility: skip this function unless the Postfix
+ * configuration actually has non-default tls_config_xxx settings.
+ */
+ if (strcmp(var_tls_cnf_file, DEF_TLS_CNF_FILE) == 0
+ && strcmp(var_tls_cnf_name, DEF_TLS_CNF_NAME) == 0) {
+ if (msg_verbose)
+ msg_info("tls_library_init: using backwards-compatible defaults");
+ return (init_res = TLS_LIB_INIT_OK);
+ }
if ((init_settings = OPENSSL_INIT_new()) == 0) {
msg_warn("error allocating OpenSSL init settings, "
"disabling TLS support");
- return (0);
+ return (init_res = TLS_LIB_INIT_ERR);
}
-
#define TLS_LIB_INIT_RETURN(x) \
- do { OPENSSL_INIT_free(init_settings); return (x); } while(0)
+ do { OPENSSL_INIT_free(init_settings); return (init_res = (x)); } while(0)
#if OPENSSL_VERSION_NUMBER < 0x1010102fL
if (strcmp(var_tls_cnf_file, "default") != 0) {
msg_warn("non-default %s = %s requires OpenSSL 1.1.1b or later, "
"disabling TLS support", VAR_TLS_CNF_FILE, var_tls_cnf_file);
- TLS_LIB_INIT_RETURN(0);
+ TLS_LIB_INIT_RETURN(TLS_LIB_INIT_ERR);
}
#else
{
} else {
msg_warn("non-default %s = %s is not an absolute pathname, "
"disabling TLS support", VAR_TLS_CNF_FILE, var_tls_cnf_file);
- TLS_LIB_INIT_RETURN(0);
+ TLS_LIB_INIT_RETURN(TLS_LIB_INIT_ERR);
}
OPENSSL_INIT_set_config_file_flags(init_settings, file_flags);
msg_warn("error initializing the OpenSSL library, "
"disabling TLS support");
tls_print_errors();
- TLS_LIB_INIT_RETURN(0);
+ TLS_LIB_INIT_RETURN(TLS_LIB_INIT_ERR);
}
- TLS_LIB_INIT_RETURN(1);
+ TLS_LIB_INIT_RETURN(TLS_LIB_INIT_OK);
}
/* tls_pre_jail_init - Load TLS related pre-jail tables */