[exim-cvs] GnuTLS: more info on accept zero-error

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Exim Git Commits Mailing List
Datum:  
To: exim-cvs
Betreff: [exim-cvs] GnuTLS: more info on accept zero-error
Gitweb: https://git.exim.org/exim.git/commitdiff/f6fa370ab8cc56cf06e906a1a2c714d196aac81b
Commit:     f6fa370ab8cc56cf06e906a1a2c714d196aac81b
Parent:     0851a3bbf4667081d47f5d85b6b3a5cb33cbdba6
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Mon Jun 8 11:09:44 2020 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Thu Jun 11 20:30:18 2020 +0100


    GnuTLS: more info on accept zero-error
---
 src/src/tls-gnu.c | 13 ++++++++-----
 test/log/2029     |  2 +-
 test/log/3454     |  2 +-
 test/log/5670     |  2 +-
 4 files changed, 11 insertions(+), 8 deletions(-)


diff --git a/src/src/tls-gnu.c b/src/src/tls-gnu.c
index fa48990..eff9e88 100644
--- a/src/src/tls-gnu.c
+++ b/src/src/tls-gnu.c
@@ -424,11 +424,14 @@ record_io_error(exim_gnutls_state_st *state, int rc, uschar *when, uschar *text)
const uschar * msg;
uschar * errstr;

-if (rc == GNUTLS_E_FATAL_ALERT_RECEIVED)
-  msg = string_sprintf("A TLS fatal alert has been received: %s",
-    US gnutls_alert_get_name(gnutls_alert_get(state->session)));
-else
-  msg = US gnutls_strerror(rc);
+msg = rc == GNUTLS_E_FATAL_ALERT_RECEIVED
+  ? string_sprintf("A TLS fatal alert has been received: %s",
+      US gnutls_alert_get_name(gnutls_alert_get(state->session)))
+  : rc == GNUTLS_E_PREMATURE_TERMINATION && errno
+  ? errno == ECONNRESET        /* Outlook does this to us right after sending us QUIT */
+  ? string_sprintf("syscall: %s", strerror(errno))
+  : string_sprintf("%s: syscall: %s", US gnutls_strerror(rc), strerror(errno))
+  : US gnutls_strerror(rc);


(void) tls_error(when, msg, state->host, &errstr);

diff --git a/test/log/2029 b/test/log/2029
index 6d1107c..b22a98a 100644
--- a/test/log/2029
+++ b/test/log/2029
@@ -1,5 +1,5 @@

******** SERVER ********
1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port PORT_D
-1999-03-02 09:44:33 10HmaX-0005vi-00 TLS error on connection from [127.0.0.1] (recv): The TLS connection was non-properly terminated.
+1999-03-02 09:44:33 10HmaX-0005vi-00 TLS error on connection from [127.0.0.1] (recv): The TLS connection was non-properly terminated.: syscall: No such file or directory
1999-03-02 09:44:33 10HmaX-0005vi-00 SMTP connection lost after final dot H=[127.0.0.1] P=smtps
diff --git a/test/log/3454 b/test/log/3454
index f14671d..634fc42 100644
--- a/test/log/3454
+++ b/test/log/3454
@@ -1,6 +1,6 @@

******** SERVER ********
1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port PORT_D
-1999-03-02 09:44:33 TLS error on connection from [127.0.0.1] (recv): The TLS connection was non-properly terminated.
+1999-03-02 09:44:33 TLS error on connection from [127.0.0.1] (recv): The TLS connection was non-properly terminated.: syscall: Permission denied
1999-03-02 09:44:33 no MAIL in SMTP connection from [127.0.0.1] D=qqs X=TLS1.x:ke-RSA-AES256-SHAnnn:xxx CV=no C=EHLO,STARTTLS,AUTH
1999-03-02 09:44:33 no MAIL in SMTP connection from (foobar) [127.0.0.1] D=qqs A=plain:userx X=TLS1.x:ke-RSA-AES256-SHAnnn:xxx CV=no C=EHLO,STARTTLS,EHLO,AUTH,QUIT
diff --git a/test/log/5670 b/test/log/5670
index 9936c85..23213f3 100644
--- a/test/log/5670
+++ b/test/log/5670
@@ -21,4 +21,4 @@
1999-03-02 09:44:33 acl_mail: ocsp in status: 1 (notresp)
1999-03-02 09:44:33 10HmbA-0005vi-00 <= <> H=localhost (server1.example.com) [127.0.0.1] P=esmtps X=TLS1.x:ke-RSA-AES256-SHAnnn:xxx CV=no S=sss id=E10HmaZ-0005vi-00@???
1999-03-02 09:44:33 exim x.yz daemon started: pid=pppp, no queue runs, listening for SMTP on port PORT_D
-1999-03-02 09:44:33 TLS error on connection from localhost [127.0.0.1] (recv): The TLS connection was non-properly terminated.
+1999-03-02 09:44:33 TLS error on connection from localhost [127.0.0.1] (recv): The TLS connection was non-properly terminated.: syscall: Permission denied