1
0
mirror of https://github.com/irssi/irssi.git synced 2024-09-22 04:35:58 -04:00

Move NULL check for cert above pubkey

This patch was originally proposed by Chi Li.

Fixes #944
This commit is contained in:
Berker Peksag 2019-04-06 23:20:44 +03:00
parent 690e441771
commit 2b48ddd3c9

View File

@ -854,14 +854,13 @@ int irssi_ssl_handshake(GIOChannel *handle)
}
cert = SSL_get_peer_certificate(chan->ssl);
pubkey = X509_get_X509_PUBKEY(cert);
if (cert == NULL) {
g_warning("TLS server supplied no certificate");
ret = 0;
goto done;
}
pubkey = X509_get_X509_PUBKEY(cert);
if (pubkey == NULL) {
g_warning("TLS server supplied no certificate public key");
ret = 0;