]> jfr.im git - irc/hexchat/hexchat.git/commitdiff
Properly handle missing SSL certificate
authorInsu Yun <redacted>
Fri, 20 Nov 2015 21:51:08 +0000 (16:51 -0500)
committerPatrick Griffis <redacted>
Fri, 19 Feb 2016 12:26:50 +0000 (07:26 -0500)
According to OpenSSL document
(https://www.openssl.org/docs/manmaster/ssl/SSL_get_verify_result.html),
when using SSL_get_verify_result(), the existence of certificate
needs to be checked. However, in current code, it does not.
Therefore, certificate existence check is required for correctly
handling the exception.

Closes #1549

src/common/server.c

index e4c2e377187b1ae683413e7be3266d3250f1178c..19e909691a187c502f775c326b1f402b3db721e0 100644 (file)
@@ -569,9 +569,8 @@ ssl_do_connect (server * serv)
                                                         NULL, 0);
                } else
                {
-                       g_snprintf (buf, sizeof (buf), " * No Certificate");
-                       EMIT_SIGNAL (XP_TE_SSLMESSAGE, serv->server_session, buf, NULL, NULL,
-                                                        NULL, 0);
+                       g_snprintf (buf, sizeof (buf), "No Certificate");
+                       goto conn_fail;
                }
 
                chiper_info = _SSL_get_cipher_info (serv->ssl); /* static buffer */