summaryrefslogtreecommitdiff
path: root/source4/torture
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2011-01-28 15:33:51 +0100
committerGünther Deschner <gd@samba.org>2011-01-28 16:23:30 +0100
commit7182da7f919b9201126129cb2628004b588a2e60 (patch)
treebd69963f4c95d992818670b252d54a7ff7f149b6 /source4/torture
parent6957109e8deb5e6761195c1e69b2b1514ff5b788 (diff)
downloadsamba-7182da7f919b9201126129cb2628004b588a2e60.tar.gz
samba-7182da7f919b9201126129cb2628004b588a2e60.tar.bz2
samba-7182da7f919b9201126129cb2628004b588a2e60.zip
s4-smbtorture: add (disabled) ndr torture test to check for a w2k samlogon reply we can't currently parse.
Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Fri Jan 28 16:23:30 CET 2011 on sn-devel-104
Diffstat (limited to 'source4/torture')
-rw-r--r--source4/torture/ndr/netlogon.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source4/torture/ndr/netlogon.c b/source4/torture/ndr/netlogon.c
index 18a33930d7..d247eb1a8b 100644
--- a/source4/torture/ndr/netlogon.c
+++ b/source4/torture/ndr/netlogon.c
@@ -168,6 +168,27 @@ static bool netrlogonsamlogon_in_check(struct torture_context *tctx,
return true;
}
+static const uint8_t netrlogonsamlogon_out_data[] = {
+ 0x6c, 0xdb, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0xc0
+};
+
+static bool netrlogonsamlogon_out_check(struct torture_context *tctx,
+ struct netr_LogonSamLogon *r)
+{
+ uint8_t return_authenticator_expected[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+
+ torture_assert_mem_equal(tctx, r->out.return_authenticator->cred.data, return_authenticator_expected, 8, "return_authenticator.cred.data");
+ torture_assert_int_equal(tctx, r->out.return_authenticator->timestamp, 0, "return_authenticator.timestamp");
+ torture_assert(tctx, r->out.validation, "validation NULL pointer");
+ torture_assert(tctx, (r->out.validation->sam6 == NULL), "sam6 not NULL");
+ torture_assert_int_equal(tctx, *r->out.authoritative, 1, "authoritative");
+ torture_assert_ntstatus_equal(tctx, r->out.result, NT_STATUS_INVALID_INFO_CLASS, "unexpected result");
+
+ return true;
+}
+
struct torture_suite *ndr_netlogon_suite(TALLOC_CTX *ctx)
{
struct torture_suite *suite = torture_suite_create(ctx, "netlogon");
@@ -179,6 +200,11 @@ struct torture_suite *ndr_netlogon_suite(TALLOC_CTX *ctx)
torture_suite_add_ndr_pull_fn_test(suite, netr_ServerAuthenticate3, netrserverauthenticate3_out_data, NDR_OUT, netrserverauthenticate3_out_check );
torture_suite_add_ndr_pull_fn_test(suite, netr_LogonSamLogon, netrlogonsamlogon_in_data, NDR_IN, netrlogonsamlogon_in_check );
+#if 0
+ /* samba currently fails to parse a validation level 6 samlogon reply
+ * from w2k and other servers - gd */
+ torture_suite_add_ndr_pull_io_test(suite, netr_LogonSamLogon, netrlogonsamlogon_in_data, netrlogonsamlogon_out_data, netrlogonsamlogon_out_check);
+#endif
return suite;
}