mirror of
https://github.com/samba-team/samba.git
synced 2025-03-09 08:58:35 +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:
parent
ccfd2647c7
commit
79a6fc0532
@ -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,
|
||||
uint8_t auth_type,
|
||||
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;
|
||||
|
||||
|
@ -198,3 +198,26 @@ NTSTATUS auth_generic_client_start_by_authtype(struct auth_generic_state *ans,
|
||||
|
||||
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user