[exim-cvs] OpenSSL: emit actual version on "wrong version nu…

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Exim Git Commits Mailing List
Datum:  
To: exim-cvs
Betreff: [exim-cvs] OpenSSL: emit actual version on "wrong version number" error for SSL_accept
Gitweb: https://git.exim.org/exim.git/commitdiff/fa9e4a1d04268f4a7e46166f70b6d5def10297f9
Commit:     fa9e4a1d04268f4a7e46166f70b6d5def10297f9
Parent:     1352e600b833220c32b8b02b9b38e22885e0db6d
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Fri Oct 4 10:21:24 2019 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sat Oct 19 23:49:46 2019 +0100


    OpenSSL: emit actual version on "wrong version number" error for SSL_accept
---
 src/src/tls-openssl.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)


diff --git a/src/src/tls-openssl.c b/src/src/tls-openssl.c
index 7a625a8..247da09 100644
--- a/src/src/tls-openssl.c
+++ b/src/src/tls-openssl.c
@@ -2706,8 +2706,14 @@ if (rc <= 0)

     /* Handle genuine errors */
     case SSL_ERROR_SSL:
-      (void) tls_error(US"SSL_accept", NULL, sigalrm_seen ? US"timed out" : NULL, errstr);
+      {
+      uschar * s = US"SSL_accept";
+      ulong e = ERR_peek_error();
+      if (ERR_GET_REASON(e) == SSL_R_WRONG_VERSION_NUMBER)
+    s = string_sprintf("%s (%s)", s, SSL_get_version(server_ssl));
+      (void) tls_error(s, NULL, sigalrm_seen ? US"timed out" : NULL, errstr);
       return FAIL;
+      }


     default:
       DEBUG(D_tls) debug_printf("Got SSL error %d\n", error);