diff options
author | Andrew Bartlett <abartlet@samba.org> | 2019-07-25 17:43:23 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2019-07-26 01:48:26 +0000 |
commit | 19d9c2c01a54957bc3852e2565d92c1cdd89498b (patch) | |
tree | 667ab3320121d1aac09420a90c460ffd7dc1910d /source4 | |
parent | 8380668be7963b74cbbd31bfab3d01d1f3089034 (diff) | |
download | samba-19d9c2c01a54957bc3852e2565d92c1cdd89498b.tar.gz |
s4:torture: Use init_samr_CryptPassword in test_ChangePasswordRandomBytes
This allows the use of GnuTLS for the underlying RC4 crypto
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/rpc/samr.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c index 20afa9392e2..10377850314 100644 --- a/source4/torture/rpc/samr.c +++ b/source4/torture/rpc/samr.c @@ -2790,6 +2790,9 @@ bool test_ChangePasswordRandomBytes(struct dcerpc_pipe *p, struct torture_contex char *oldpass; struct dcerpc_binding_handle *b = p->binding_handle; uint8_t old_nt_hash[16], new_nt_hash[16]; + DATA_BLOB old_nt_hash_blob + = data_blob_const(old_nt_hash, + sizeof(old_nt_hash)); NTTIME t; struct samr_DomInfo1 *dominfo = NULL; struct userPwdChangeFailureInformation *reject = NULL; @@ -2893,8 +2896,13 @@ bool test_ChangePasswordRandomBytes(struct dcerpc_pipe *p, struct torture_contex E_md4hash(newpass, new_nt_hash); - encode_pw_buffer(nt_pass.data, newpass, STR_UNICODE); - arcfour_crypt(nt_pass.data, old_nt_hash, 516); + status = init_samr_CryptPassword(newpass, + &old_nt_hash_blob, + &nt_pass); + torture_assert_ntstatus_ok(tctx, + status, + "init_samr_CryptPassword failed"); + E_old_pw_hash(new_nt_hash, old_nt_hash, nt_verifier.hash); r.in.server = &server; |