libcli/auth: check E_md4hash() result in netlogon_creds_cli_ServerPasswordSet_send()
authorStefan Metzmacher <metze@samba.org>
Wed, 18 Jan 2017 19:02:21 +0000 (19:02 +0000)
committerRalph Boehme <slow@samba.org>
Tue, 21 Feb 2017 15:09:21 +0000 (16:09 +0100)
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 <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
libcli/auth/netlogon_creds_cli.c

index b97d60e3a02d67dcd623cf79719bc7a4a6480840..93ec1bfd194f8f2d2b3814de178f53838b030057 100644 (file)
@@ -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