mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
s4-smbtorture: add test_oemchangepassword to RAP-SAM.
Guenther
This commit is contained in:
parent
1cee92caaa
commit
b73b237a6b
@ -50,11 +50,40 @@ static bool test_userpasswordset2(struct torture_context *tctx,
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool test_oemchangepassword(struct torture_context *tctx,
|
||||
struct smbcli_state *cli)
|
||||
{
|
||||
struct rap_NetOEMChangePassword r;
|
||||
|
||||
const char *oldpass = "secret";
|
||||
const char *newpass = "newpwd";
|
||||
uint8_t old_pw_hash[16];
|
||||
uint8_t new_pw_hash[16];
|
||||
|
||||
r.in.UserName = "gd";
|
||||
|
||||
E_deshash(oldpass, old_pw_hash);
|
||||
E_deshash(newpass, new_pw_hash);
|
||||
|
||||
encode_pw_buffer(r.in.crypt_password, newpass, STR_ASCII);
|
||||
arcfour_crypt(r.in.crypt_password, old_pw_hash, 516);
|
||||
E_old_pw_hash(new_pw_hash, old_pw_hash, r.in.password_hash);
|
||||
|
||||
torture_comment(tctx, "Testing rap_NetOEMChangePassword(%s)\n", r.in.UserName);
|
||||
|
||||
torture_assert_ntstatus_ok(tctx,
|
||||
smbcli_rap_netoemchangepassword(cli->tree, lp_iconv_convenience(tctx->lp_ctx), tctx, &r),
|
||||
"smbcli_rap_netoemchangepassword failed");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
struct torture_suite *torture_rap_sam(TALLOC_CTX *mem_ctx)
|
||||
{
|
||||
struct torture_suite *suite = torture_suite_create(mem_ctx, "SAM");
|
||||
|
||||
torture_suite_add_1smb_test(suite, "userpasswordset2", test_userpasswordset2);
|
||||
torture_suite_add_1smb_test(suite, "oemchangepassword", test_oemchangepassword);
|
||||
|
||||
return suite;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user