|
|
1524bc |
From 92a1bd505e5bb9c793f05b386d4e9ee2b2b74027 Mon Sep 17 00:00:00 2001
|
|
|
1524bc |
From: Andreas Schneider <asn@samba.org>
|
|
|
1524bc |
Date: Wed, 24 Jul 2019 15:56:08 +0200
|
|
|
1524bc |
Subject: [PATCH 040/187] s4:torture: Use init_samr_CryptPassword in
|
|
|
1524bc |
test_SetUserPass
|
|
|
1524bc |
|
|
|
1524bc |
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
|
1524bc |
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
|
|
|
1524bc |
(cherry picked from commit 70e05d7eb78a0c363dbd72cbbf4f3a264636c840)
|
|
|
1524bc |
---
|
|
|
1524bc |
source4/torture/rpc/samr.c | 12 +++++++++---
|
|
|
1524bc |
1 file changed, 9 insertions(+), 3 deletions(-)
|
|
|
1524bc |
|
|
|
1524bc |
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
|
|
|
1524bc |
index eb1bb14a555..f281be654cc 100644
|
|
|
1524bc |
--- a/source4/torture/rpc/samr.c
|
|
|
1524bc |
+++ b/source4/torture/rpc/samr.c
|
|
|
1524bc |
@@ -31,7 +31,7 @@
|
|
|
1524bc |
#include "librpc/gen_ndr/ndr_netlogon_c.h"
|
|
|
1524bc |
#include "librpc/gen_ndr/ndr_samr_c.h"
|
|
|
1524bc |
#include "librpc/gen_ndr/ndr_lsa_c.h"
|
|
|
1524bc |
-#include "../lib/crypto/crypto.h"
|
|
|
1524bc |
+#include "lib/crypto/crypto.h"
|
|
|
1524bc |
#include "libcli/auth/libcli_auth.h"
|
|
|
1524bc |
#include "libcli/security/security.h"
|
|
|
1524bc |
#include "torture/rpc/torture_rpc.h"
|
|
|
1524bc |
@@ -40,6 +40,8 @@
|
|
|
1524bc |
#include "auth/gensec/gensec_proto.h"
|
|
|
1524bc |
#include "../libcli/auth/schannel.h"
|
|
|
1524bc |
#include "torture/util.h"
|
|
|
1524bc |
+#include "source4/librpc/rpc/dcerpc.h"
|
|
|
1524bc |
+#include "source3/rpc_client/init_samr.h"
|
|
|
1524bc |
|
|
|
1524bc |
#define TEST_ACCOUNT_NAME "samrtorturetest"
|
|
|
1524bc |
#define TEST_ACCOUNT_NAME_PWD "samrpwdlastset"
|
|
|
1524bc |
@@ -637,7 +639,6 @@ static bool test_SetUserPass(struct dcerpc_pipe *p, struct torture_context *tctx
|
|
|
1524bc |
s.in.info = &u;
|
|
|
1524bc |
s.in.level = 24;
|
|
|
1524bc |
|
|
|
1524bc |
- encode_pw_buffer(u.info24.password.data, newpass, STR_UNICODE);
|
|
|
1524bc |
u.info24.password_expired = 0;
|
|
|
1524bc |
|
|
|
1524bc |
status = dcerpc_fetch_session_key(p, &session_key);
|
|
|
1524bc |
@@ -647,7 +648,12 @@ static bool test_SetUserPass(struct dcerpc_pipe *p, struct torture_context *tctx
|
|
|
1524bc |
return false;
|
|
|
1524bc |
}
|
|
|
1524bc |
|
|
|
1524bc |
- arcfour_crypt_blob(u.info24.password.data, 516, &session_key);
|
|
|
1524bc |
+ status = init_samr_CryptPassword(newpass,
|
|
|
1524bc |
+ &session_key,
|
|
|
1524bc |
+ &u.info24.password);
|
|
|
1524bc |
+ torture_assert_ntstatus_ok(tctx,
|
|
|
1524bc |
+ status,
|
|
|
1524bc |
+ "init_samr_CryptPassword failed");
|
|
|
1524bc |
|
|
|
1524bc |
torture_comment(tctx, "Testing SetUserInfo level 24 (set password)\n");
|
|
|
1524bc |
|
|
|
1524bc |
--
|
|
|
1524bc |
2.23.0
|
|
|
1524bc |
|