mirror of
https://github.com/osmarks/ngircd.git
synced 2025-04-08 08:46:39 +00:00
S2S-TLS/GnuTLS: Fix handling of connections without peer certificates
This commit is contained in:
parent
180e2ec135
commit
8cef3ce42c
@ -1000,16 +1000,15 @@ ConnSSL_LogCertInfo( CONNECTION * c, bool connect)
|
||||
gnutls_mac_get_name(gnutls_mac_get(sess)));
|
||||
cred = gnutls_auth_get_type(c->ssl_state.gnutls_session);
|
||||
if (cred == GNUTLS_CRD_CERTIFICATE) {
|
||||
cert_seen = true;
|
||||
|
||||
gnutls_x509_crt_t cert;
|
||||
unsigned cert_list_size;
|
||||
const gnutls_datum_t *cert_list =
|
||||
gnutls_certificate_get_peers(sess, &cert_list_size);
|
||||
if (!cert_list || cert_list_size == 0) {
|
||||
Log(LOG_ERR, "No certificates found");
|
||||
|
||||
if (!cert_list || cert_list_size == 0)
|
||||
goto done_cn_validation;
|
||||
}
|
||||
|
||||
cert_seen = true;
|
||||
int err = gnutls_x509_crt_init(&cert);
|
||||
if (err < 0) {
|
||||
Log(LOG_ERR,
|
||||
|
Loading…
x
Reference in New Issue
Block a user