]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Define fr_ldap_sasl_bind_auth_send()
authorNick Porter <nick@portercomputing.co.uk>
Tue, 11 Apr 2023 14:38:02 +0000 (15:38 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Thu, 4 May 2023 14:27:21 +0000 (15:27 +0100)
src/lib/ldap/base.h
src/lib/ldap/sasl.c

index 5d72d7b349e8c838695b8e1a893464556434de14..613f7bc42a4db97151f64ee7c957b5901bfd0c41 100644 (file)
@@ -877,6 +877,10 @@ int                fr_ldap_sasl_bind_async(fr_ldap_connection_t *c,
                                        char const *realm,
                                        LDAPControl **serverctrls, LDAPControl **clientctrls);
 
+int            fr_ldap_sasl_bind_auth_send(fr_ldap_sasl_ctx_t *sasl_ctx,
+                                           int *msgid,
+                                           fr_ldap_connection_t *ldap_conn);
+
 int            fr_ldap_sasl_bind_auth_async(request_t *request,
                                             fr_ldap_thread_t *thread,
                                             char const *mechs,
index 1cc7471954cdb10402489d201080e44cabeb4387..9445ee15bd9bea0182428794fed503e76817492f 100644 (file)
@@ -357,6 +357,23 @@ int fr_ldap_sasl_bind_async(fr_ldap_connection_t *c,
 }
 
 
+/** Send a SASL LDAP auth bind
+ *
+ * Shares the same callback as SASL admin binds
+ *
+ * @param[in] sasl_ctx containing SASL parameters / state for the bind.
+ * @param[out] msgid   where to write the LDAP message ID.
+ * @param[in] ldap_conn        on which the message should be sent.
+ */
+int fr_ldap_sasl_bind_auth_send(fr_ldap_sasl_ctx_t *sasl_ctx, int *msgid,
+                                fr_ldap_connection_t *ldap_conn)
+{
+       return ldap_sasl_interactive_bind(ldap_conn->handle, NULL, sasl_ctx->mechs,
+                                         NULL, NULL, LDAP_SASL_AUTOMATIC,
+                                         _sasl_interact, sasl_ctx, sasl_ctx->result,
+                                         &sasl_ctx->rmech, msgid);
+}
+
 /** Submit an async SASL LDAP auth bind
  *
  * @param[in] p_result Unused.