diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2022-04-25 16:27:38 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2022-04-25 16:30:12 +0100 |
commit | 3d02b3144cdde92d99ee7fcd0eb6cc9ba7c272f3 (patch) | |
tree | a9cf4521cb1b9e42b7d107376743c618f1bbf3e3 | |
parent | 9f6b3bf5187562bac4c96e3ed6a17740d01489fa (diff) |
Fix DISABLE_EVENT build
Broken-by: ef2e5890df
-rw-r--r-- | src/src/tls-gnu.c | 4 | ||||
-rw-r--r-- | src/src/tls-openssl.c | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/src/tls-gnu.c b/src/src/tls-gnu.c index 52cf30d9a..875862cc1 100644 --- a/src/src/tls-gnu.c +++ b/src/src/tls-gnu.c @@ -3071,13 +3071,17 @@ if (rc != GNUTLS_E_SUCCESS) if (sigalrm_seen) { tls_error(US"gnutls_handshake", US"timed out", NULL, errstr); +#ifndef DISABLE_EVENT (void) event_raise(event_action, US"tls:fail:connect", *errstr, NULL); +#endif gnutls_db_remove_session(state->session); } else { tls_error_gnu(state, US"gnutls_handshake", rc, errstr); +#ifndef DISABLE_EVENT (void) event_raise(event_action, US"tls:fail:connect", *errstr, NULL); +#endif (void) gnutls_alert_send_appropriate(state->session, rc); gnutls_deinit(state->session); gnutls_certificate_free_credentials(state->lib_state.x509_cred); diff --git a/src/src/tls-openssl.c b/src/src/tls-openssl.c index f8b4db06a..7643c4c36 100644 --- a/src/src/tls-openssl.c +++ b/src/src/tls-openssl.c @@ -3341,8 +3341,9 @@ if (rc <= 0) case SSL_ERROR_ZERO_RETURN: DEBUG(D_tls) debug_printf("Got SSL_ERROR_ZERO_RETURN\n"); (void) tls_error(US"SSL_accept", NULL, sigalrm_seen ? US"timed out" : NULL, errstr); +#ifndef DISABLE_EVENT (void) event_raise(event_action, US"tls:fail:connect", *errstr, NULL); - +#endif if (SSL_get_shutdown(ssl) == SSL_RECEIVED_SHUTDOWN) SSL_shutdown(ssl); @@ -3361,7 +3362,9 @@ if (rc <= 0) || r == SSL_R_UNKNOWN_PROTOCOL || r == SSL_R_UNSUPPORTED_PROTOCOL) s = string_sprintf("(%s)", SSL_get_version(ssl)); (void) tls_error(US"SSL_accept", NULL, sigalrm_seen ? US"timed out" : s, errstr); +#ifndef DISABLE_EVENT (void) event_raise(event_action, US"tls:fail:connect", *errstr, NULL); +#endif return FAIL; } @@ -3372,7 +3375,9 @@ if (rc <= 0) if (!errno) { *errstr = US"SSL_accept: TCP connection closed by peer"; +#ifndef DISABLE_EVENT (void) event_raise(event_action, US"tls:fail:connect", *errstr, NULL); +#endif return FAIL; } DEBUG(D_tls) debug_printf(" - syscall %s\n", strerror(errno)); @@ -3381,7 +3386,9 @@ if (rc <= 0) sigalrm_seen ? US"timed out" : ERR_peek_error() ? NULL : string_sprintf("ret %d", error), errstr); +#ifndef DISABLE_EVENT (void) event_raise(event_action, US"tls:fail:connect", *errstr, NULL); +#endif return FAIL; } } |