mirror of
https://github.com/samba-team/samba.git
synced 2025-11-04 00:23:49 +03:00
s3:auth_generic: add auth_generic_client_start_by_sasl()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
@@ -47,6 +47,8 @@ NTSTATUS auth_generic_client_start_by_name(struct auth_generic_state *ans,
|
|||||||
NTSTATUS auth_generic_client_start_by_authtype(struct auth_generic_state *ans,
|
NTSTATUS auth_generic_client_start_by_authtype(struct auth_generic_state *ans,
|
||||||
uint8_t auth_type,
|
uint8_t auth_type,
|
||||||
uint8_t auth_level);
|
uint8_t auth_level);
|
||||||
|
NTSTATUS auth_generic_client_start_by_sasl(struct auth_generic_state *ans,
|
||||||
|
const char **sasl_list);
|
||||||
|
|
||||||
extern const struct gensec_security_ops gensec_ntlmssp3_client_ops;
|
extern const struct gensec_security_ops gensec_ntlmssp3_client_ops;
|
||||||
|
|
||||||
|
|||||||
@@ -198,3 +198,26 @@ NTSTATUS auth_generic_client_start_by_authtype(struct auth_generic_state *ans,
|
|||||||
|
|
||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NTSTATUS auth_generic_client_start_by_sasl(struct auth_generic_state *ans,
|
||||||
|
const char **sasl_list)
|
||||||
|
{
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
|
/* Transfer the credentials to gensec */
|
||||||
|
status = gensec_set_credentials(ans->gensec_security, ans->credentials);
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
DEBUG(1, ("Failed to set GENSEC credentials: %s\n",
|
||||||
|
nt_errstr(status)));
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
talloc_unlink(ans, ans->credentials);
|
||||||
|
ans->credentials = NULL;
|
||||||
|
|
||||||
|
status = gensec_start_mech_by_sasl_list(ans->gensec_security, sasl_list);
|
||||||
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NT_STATUS_OK;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user