From 08a9e6314693f8137b1163e2c56b41904d4b3da7 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Mon, 18 Jan 2021 01:59:40 +0100 Subject: [PATCH] mbedTLS ssl_crt_verify_info(): Ditch trailing new line It's not needed for the certificate-error page and it messed up the "Crunch:" message by splitting it in two. While at it, remove the leading space which serves no obvious purpose. --- ssl.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ssl.c b/ssl.c index ebcac3f2..abc7df68 100644 --- a/ssl.c +++ b/ssl.c @@ -1881,7 +1881,16 @@ extern int ssl_base64_encode(unsigned char *dst, size_t dlen, size_t *olen, *********************************************************************/ extern void ssl_crt_verify_info(char *buf, size_t size, struct client_state *csp) { - mbedtls_x509_crt_verify_info(buf, size, " ", csp->server_cert_verification_result); + char *last_byte; + + mbedtls_x509_crt_verify_info(buf, size, "", + csp->server_cert_verification_result); + last_byte = buf + strlen(buf)-1; + if (*last_byte == '\n') + { + /* Overwrite trailing new line character */ + *last_byte = '\0'; + } } -- 2.39.2