24 RCSID(
"$Id: 527ba041343b8d0c06061207fc2e4770af26371e $")
28 #include <freeradius-devel/ldap/base.h>
29 #include <freeradius-devel/util/debug.h>
121 ret = ldap_install_tls(c->
handle);
123 if (ret != LDAP_SUCCESS) {
124 ERROR(
"ldap_install_tls failed: %s", ldap_err2string(ret));
132 PERROR(
"StartTLS failed");
164 ret = ldap_start_tls(c->
handle, our_serverctrls, our_clientctrls, &tls_ctx->
msgid);
172 case LDAP_X_CONNECTING:
173 ret = ldap_get_option(c->
handle, LDAP_OPT_DESC, &fd);
192 ret = ldap_get_option(c->
handle, LDAP_OPT_DESC, &fd);
193 if ((ret != LDAP_OPT_SUCCESS) || (fd < 0))
goto error;
205 ERROR(
"ldap_start_tls failed: %s", ldap_err2string(ret));
228 DEBUG2(
"Starting TLS negotiation");
241 if ((ldap_get_option(c->
handle, LDAP_OPT_DESC, &fd) == LDAP_SUCCESS) && (fd >= 0)) {
#define USES_APPLE_DEPRECATED_API
fr_dcursor_eval_t void const * uctx
#define fr_cond_assert(_x)
Calls panic_action ifndef NDEBUG, else logs error and evaluates to value of _x.
#define fr_event_fd_insert(...)
LDAP * handle
libldap handle.
void fr_ldap_control_merge(LDAPControl *serverctrls_out[], LDAPControl *clientctrls_out[], size_t serverctrls_len, size_t clientctrls_len, fr_ldap_connection_t *conn, LDAPControl *serverctrls_in[], LDAPControl *clientctrls_in[])
Merge connection and call specific client and server controls.
int fr_ldap_connection_timeout_set(fr_ldap_connection_t const *conn, fr_time_delta_t timeout)
int fd
File descriptor for this connection.
void fr_ldap_state_error(fr_ldap_connection_t *c)
Signal that there's been an error on the connection.
fr_time_delta_t tls_handshake_timeout
How long we wait for the TLS handshake to complete.
fr_ldap_config_t const * config
rlm_ldap connection configuration.
fr_ldap_state_t fr_ldap_state_next(fr_ldap_connection_t *c)
Move between LDAP connection states.
#define LDAP_MAX_CONTROLS
Maximum number of client/server controls.
int fr_ldap_connection_timeout_reset(fr_ldap_connection_t const *conn)
connection_t * conn
Connection state handle.
fr_ldap_rcode_t
Codes returned by fr_ldap internal functions.
@ LDAP_PROC_SUCCESS
Operation was successful.
Tracks the state of a libldap connection handle.
fr_ldap_rcode_t fr_ldap_result(LDAPMessage **result, LDAPControl ***ctrls, fr_ldap_connection_t const *conn, int msgid, int all, char const *dn, fr_time_delta_t timeout)
Parse response from LDAP server dealing with any errors.
Stores all information relating to an event list.
static void _ldap_start_tls_io_error(UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED int flags, UNUSED int fd_errno, void *uctx)
Error reading from or writing to the file descriptor.
static void _ldap_start_tls_io_read(UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED int flags, void *uctx)
Event handler for the response to the StartTLS extended operation.
fr_ldap_connection_t * c
The current connection.
static void _ldap_start_tls_io_write(fr_event_list_t *el, int fd, UNUSED int flags, void *uctx)
Send an extended operation to the LDAP server, requesting a transition to TLS.
int fr_ldap_start_tls_async(fr_ldap_connection_t *c, LDAPControl **serverctrls, LDAPControl **clientctrls)
Install I/O handlers for Start TLS negotiation.
LDAPControl ** serverctrls
Controls to pass to the server.
LDAPControl ** clientctrls
Controls to pass to the client (library).
Holds arguments for the start_tls operation.
MEM(pair_append_request(&vp, attr_eap_aka_sim_identity) >=0)
#define fr_time_delta_wrap(_time)
static fr_event_list_t * el