diff --git a/netqmail-1.05-tls-smtpauth-20070417.patch b/netqmail-1.05-tls-smtpauth-20070417.patch index 1f12902..65e0c3d 100644 --- a/netqmail-1.05-tls-smtpauth-20070417.patch +++ b/netqmail-1.05-tls-smtpauth-20070417.patch @@ -1,8 +1,9 @@ -VERSION: 20070417 +VERSION: 20190114 This patch for netqmail 1.05 is a composite of the latest versions of Frederik Vermulen's TLS patch (20070408) and Erwin Hoffmann's SMTP-AUTH (0.5.8) update to Eric M. Johnston's and Krzysztof Dabrowski's qmail-smtpd-auth-0.31 patch. +It was later ported to openssl 1.1.x by Alex H. (git@alexh.name). To install, get netqmail 1.05, put it in the same directory as this patch, and then set it up: @@ -804,8 +805,8 @@ diff -urN ../../netqmail-1.05-orig/netqmail-1.05/qmail-remote.c ./qmail-remote.c { +#ifdef TLS + /* shouldn't talk to the client unless in an appropriate state */ -+ int state = ssl ? ssl->state : SSL_ST_BEFORE; -+ if (state & SSL_ST_OK || (!smtps && state & SSL_ST_BEFORE)) ++ int state = ssl ? SSL_get_state(ssl) : TLS_ST_BEFORE; ++ if (state & TLS_ST_OK || (!smtps && state & TLS_ST_BEFORE)) +#endif substdio_putsflush(&smtpto,"QUIT\r\n"); /* waiting for remote side is just too ridiculous */ @@ -1010,7 +1011,7 @@ diff -urN ../../netqmail-1.05-orig/netqmail-1.05/qmail-remote.c ./qmail-remote.c + X509_NAME *subj = X509_get_subject_name(peercert); + i = X509_NAME_get_index_by_NID(subj, NID_commonName, -1); + if (i >= 0) { -+ const ASN1_STRING *s = X509_NAME_get_entry(subj, i)->value; ++ const ASN1_STRING *s = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(subj, i)); + if (s) { peer.len = s->length; peer.s = s->data; } + } + if (peer.len <= 0) { @@ -1839,7 +1840,7 @@ diff -urN ../../netqmail-1.05-orig/netqmail-1.05/qmail-smtpd.c ./qmail-smtpd.c + subj = X509_get_subject_name(peercert); + n = X509_NAME_get_index_by_NID(subj, NID_pkcs9_emailAddress, -1); + if (n >= 0) { -+ const ASN1_STRING *s = X509_NAME_get_entry(subj, n)->value; ++ const ASN1_STRING *s = X509_NAME_ENTRY_get_data(X509_NAME_get_entry(subj, n)); + if (s) { email.len = s->length; email.s = s->data; } + } + @@ -2132,10 +2133,10 @@ diff -urN ../../netqmail-1.05-orig/netqmail-1.05/ssl_timeoutio.c ./ssl_timeoutio + + SSL_renegotiate(ssl); + r = ssl_timeoutio(SSL_do_handshake, t, rfd, wfd, ssl, NULL, 0); -+ if (r <= 0 || ssl->type == SSL_ST_CONNECT) return r; ++ if (r <= 0 || SSL_get_state(ssl) == SSL_ST_CONNECT) return r; + + /* this is for the server only */ -+ ssl->state = SSL_ST_ACCEPT; ++ SSL_set_accept_state(ssl); + return ssl_timeoutio(SSL_do_handshake, t, rfd, wfd, ssl, NULL, 0); +} +