From: Jeremy Harris Date: Fri, 15 Nov 2019 11:18:07 +0000 (+0000) Subject: GnuTLS: fix $tls_X_ver generation X-Git-Tag: exim-4_94_RC0~240^2~21 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e4307860d847c4679adb4735698a31065a392752;p=exim.git GnuTLS: fix $tls_X_ver generation --- diff --git a/src/src/tls-gnu.c b/src/src/tls-gnu.c index eaec862aa..7d7f61dd8 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 */