From 0269265c1d83e990800fa7105eb5bb7de681c422 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 18 Jan 2017 19:02:21 +0000 Subject: [PATCH] libcli/auth: check E_md4hash() result in netlogon_creds_cli_ServerPasswordSet_send() We need to make sure we can convert the given string to an nthash. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12262 Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme (cherry picked from commit 8a209e5a0ca810d8cf0e5ebc1902fae8c5cb241e) --- libcli/auth/netlogon_creds_cli.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libcli/auth/netlogon_creds_cli.c b/libcli/auth/netlogon_creds_cli.c index 38b1351f591..d2ffe694d1c 100644 --- a/libcli/auth/netlogon_creds_cli.c +++ b/libcli/auth/netlogon_creds_cli.c @@ -1747,7 +1747,11 @@ struct tevent_req *netlogon_creds_cli_ServerPasswordSet_send(TALLOC_CTX *mem_ctx /* * netr_ServerPasswordSet */ - E_md4hash(new_password, state->samr_password.hash); + ok = E_md4hash(new_password, state->samr_password.hash); + if (!ok) { + tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER_MIX); + return tevent_req_post(req, ev); + } /* * netr_ServerPasswordSet2 -- 2.47.2