1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-20 22:50:26 +03:00

s3:auth_generic: add auth_generic_client_start_by_sasl()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11804

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 79a6fc0532936558421eb4321f795655b5280763)
This commit is contained in:
Stefan Metzmacher 2016-03-01 19:39:04 +01:00
parent a0feacff89
commit 14b2a51610
2 changed files with 25 additions and 0 deletions

View File

@ -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;

View File

@ -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;
}