[exim-cvs] GnuTLS: fix $tls_X_ver generation

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Exim Git Commits Mailing List
Datum:  
To: exim-cvs
Betreff: [exim-cvs] GnuTLS: fix $tls_X_ver generation
Gitweb: https://git.exim.org/exim.git/commitdiff/e4307860d847c4679adb4735698a31065a392752
Commit:     e4307860d847c4679adb4735698a31065a392752
Parent:     9f125d9fab3f3f3dd2244caa28914c256d01c339
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Fri Nov 15 11:18:07 2019 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Fri Nov 15 11:18:07 2019 +0000


    GnuTLS: fix $tls_X_ver generation
---
 src/src/tls-gnu.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)


diff --git a/src/src/tls-gnu.c b/src/src/tls-gnu.c
index eaec862..7d7f61d 100644
--- a/src/src/tls-gnu.c
+++ b/src/src/tls-gnu.c
@@ -1755,12 +1755,17 @@ old_pool = store_pool;
     /* debug_printf("peer_status: gnutls_session_get_desc %s\n", s); */


     for (s++; (c = *s) && c != ')'; s++) g = string_catn(g, s, 1);
+
     tlsp->ver = string_copyn(g->s, g->ptr);
+    for (uschar * p = US tlsp->ver; *p; p++)
+      if (*p == '-') { *p = '\0'; break; }    /* TLS1.0-PKIX -> TLS1.0 */
+
     g = string_catn(g, US":", 1);
     if (*s) s++;        /* now on _ between groups */
     while ((c = *s))
       {
-      for (*++s && ++s; (c = *s) && c != ')'; s++) g = string_catn(g, c == '-' ? US"_" : s, 1);
+      for (*++s && ++s; (c = *s) && c != ')'; s++)
+    g = string_catn(g, c == '-' ? US"_" : s, 1);
       /* now on ) closing group */
       if ((c = *s) && *++s == '-') g = string_catn(g, US"__", 2);
       /* now on _ between groups */