From e4307860d847c4679adb4735698a31065a392752 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Fri, 15 Nov 2019 11:18:07 +0000 Subject: [PATCH] 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 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 */ -- 2.25.1