You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Function SSL_get_peer_certificate() returns a pointer to an X509 certificate on success or NULL on error. However, the function SSL_get_peer_certificate() in irssi/src/core/network-openssl.c didn't check the return value is NULL or not, before passing the return value as an argument to the function X509_get_X509_PUBKEY(). See the following details:
Anyhow, the safest behavior is checking the return value of function SSL_get_peer_certificate() first , then passing the return value as an argument to function X509_get_X509_PUBKEY(). See the following details:
cert = SSL_get_peer_certificate(chan->ssl);
if (cert == NULL) {
g_warning("TLS server supplied no certificate");
ret = 0;
goto done;
}
pubkey = X509_get_X509_PUBKEY(cert);
Hi,
Function SSL_get_peer_certificate() returns a pointer to an X509 certificate on success or NULL on error. However, the function SSL_get_peer_certificate() in irssi/src/core/network-openssl.c didn't check the return value is NULL or not, before passing the return value as an argument to the function X509_get_X509_PUBKEY(). See the following details:
=================================================================================
X509_get_X509_PUBKEY() doesn't check the argument which is the return value of function SSL_get_peer_certificate() is NULL or not before using it.
Ref: https://github.com/openssl/openssl/blob/master/crypto/x509/x509_set.c
=================================================================================
Anyhow, the safest behavior is checking the return value of function SSL_get_peer_certificate() first , then passing the return value as an argument to function X509_get_X509_PUBKEY(). See the following details:
cert = SSL_get_peer_certificate(chan->ssl);
if (cert == NULL) {
g_warning("TLS server supplied no certificate");
ret = 0;
goto done;
}
pubkey = X509_get_X509_PUBKEY(cert);
=================================================================================
Chi Li, Zuxing Gu, Jiecheng Wu
The text was updated successfully, but these errors were encountered: