|
|
1524bc |
From e1fd1c24002f30d31367d1caa59ccb057e8c9794 Mon Sep 17 00:00:00 2001
|
|
|
1524bc |
From: Andreas Schneider <asn@samba.org>
|
|
|
1524bc |
Date: Fri, 22 Feb 2019 13:06:34 +0100
|
|
|
1524bc |
Subject: [PATCH 055/187] s4:torture: Use init_samr_CryptPassword in testjoin
|
|
|
1524bc |
RPC test
|
|
|
1524bc |
|
|
|
1524bc |
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14031
|
|
|
1524bc |
|
|
|
1524bc |
Signed-off-by: Andreas Schneider <asn@samba.org>
|
|
|
1524bc |
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
|
|
|
1524bc |
(cherry picked from commit 301544ab2b0c85752d5307f2daab59652c08e1e0)
|
|
|
1524bc |
---
|
|
|
1524bc |
source4/torture/rpc/testjoin.c | 11 +++++++----
|
|
|
1524bc |
1 file changed, 7 insertions(+), 4 deletions(-)
|
|
|
1524bc |
|
|
|
1524bc |
diff --git a/source4/torture/rpc/testjoin.c b/source4/torture/rpc/testjoin.c
|
|
|
1524bc |
index c4e287d579b..11394b1c277 100644
|
|
|
1524bc |
--- a/source4/torture/rpc/testjoin.c
|
|
|
1524bc |
+++ b/source4/torture/rpc/testjoin.c
|
|
|
1524bc |
@@ -26,7 +26,6 @@
|
|
|
1524bc |
|
|
|
1524bc |
#include "includes.h"
|
|
|
1524bc |
#include "system/time.h"
|
|
|
1524bc |
-#include "../lib/crypto/crypto.h"
|
|
|
1524bc |
#include "libnet/libnet.h"
|
|
|
1524bc |
#include "lib/cmdline/popt_common.h"
|
|
|
1524bc |
#include "librpc/gen_ndr/ndr_lsa_c.h"
|
|
|
1524bc |
@@ -36,6 +35,7 @@
|
|
|
1524bc |
#include "torture/rpc/torture_rpc.h"
|
|
|
1524bc |
#include "libcli/security/security.h"
|
|
|
1524bc |
#include "param/param.h"
|
|
|
1524bc |
+#include "source3/rpc_client/init_samr.h"
|
|
|
1524bc |
|
|
|
1524bc |
struct test_join {
|
|
|
1524bc |
struct dcerpc_pipe *p;
|
|
|
1524bc |
@@ -145,7 +145,6 @@ struct test_join *torture_create_testuser_max_pwlen(struct torture_context *tctx
|
|
|
1524bc |
char *random_pw;
|
|
|
1524bc |
const char *dc_binding = torture_setting_string(tctx, "dc_binding", NULL);
|
|
|
1524bc |
struct dcerpc_binding_handle *b = NULL;
|
|
|
1524bc |
-
|
|
|
1524bc |
join = talloc(NULL, struct test_join);
|
|
|
1524bc |
if (join == NULL) {
|
|
|
1524bc |
return NULL;
|
|
|
1524bc |
@@ -330,7 +329,6 @@ again:
|
|
|
1524bc |
s.in.info = &u;
|
|
|
1524bc |
s.in.level = 24;
|
|
|
1524bc |
|
|
|
1524bc |
- encode_pw_buffer(u.info24.password.data, random_pw, STR_UNICODE);
|
|
|
1524bc |
u.info24.password_expired = 0;
|
|
|
1524bc |
|
|
|
1524bc |
status = dcerpc_fetch_session_key(join->p, &session_key);
|
|
|
1524bc |
@@ -341,7 +339,12 @@ again:
|
|
|
1524bc |
goto failed;
|
|
|
1524bc |
}
|
|
|
1524bc |
|
|
|
1524bc |
- arcfour_crypt_blob(u.info24.password.data, 516, &session_key);
|
|
|
1524bc |
+ status = init_samr_CryptPassword(random_pw,
|
|
|
1524bc |
+ &session_key,
|
|
|
1524bc |
+ &u.info24.password);
|
|
|
1524bc |
+ torture_assert_ntstatus_ok(tctx,
|
|
|
1524bc |
+ status,
|
|
|
1524bc |
+ "init_samr_CryptPassword failed");
|
|
|
1524bc |
|
|
|
1524bc |
status = dcerpc_samr_SetUserInfo_r(b, join, &s);
|
|
|
1524bc |
if (!NT_STATUS_IS_OK(status)) {
|
|
|
1524bc |
--
|
|
|
1524bc |
2.23.0
|
|
|
1524bc |
|