summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-02-15 22:59:10 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:48:22 -0500
commit612cfb84d955c31192ae1429198c580d3585bc24 (patch)
treee039c825af960b1b13b44ea58f23bfc48ce00d1a /source4
parent5f23c888afa56d2deecbedeb6c17ba99665d0db3 (diff)
downloadsamba-612cfb84d955c31192ae1429198c580d3585bc24.tar.gz
samba-612cfb84d955c31192ae1429198c580d3585bc24.tar.bz2
samba-612cfb84d955c31192ae1429198c580d3585bc24.zip
r21375: More lsa tests.
(This used to be commit 88fa90778a0e1f5efca08e5e6ba1b165399de30c)
Diffstat (limited to 'source4')
-rw-r--r--source4/librpc/idl/lsa.idl12
-rw-r--r--source4/torture/ndr/atsvc.c8
-rw-r--r--source4/torture/ndr/lsa.c220
3 files changed, 226 insertions, 14 deletions
diff --git a/source4/librpc/idl/lsa.idl b/source4/librpc/idl/lsa.idl
index 10514570a1..a6f4458645 100644
--- a/source4/librpc/idl/lsa.idl
+++ b/source4/librpc/idl/lsa.idl
@@ -47,7 +47,7 @@ import "security.idl";
/******************/
/* Function: 0x01 */
- NTSTATUS lsa_Delete (
+ [public] NTSTATUS lsa_Delete (
[in] policy_handle *handle
);
@@ -247,7 +247,7 @@ import "security.idl";
/******************/
/* Function: 0x0a */
- NTSTATUS lsa_CreateAccount (
+ [public] NTSTATUS lsa_CreateAccount (
[in] policy_handle *handle,
[in] dom_sid2 *sid,
[in] uint32 access_mask,
@@ -375,7 +375,7 @@ import "security.idl";
/* Function: 0x10 */
- NTSTATUS lsa_CreateSecret(
+ [public] NTSTATUS lsa_CreateSecret(
[in] policy_handle *handle,
[in] lsa_String name,
[in] uint32 access_mask,
@@ -555,7 +555,7 @@ import "security.idl";
NTSTATUS lsa_SetInformationTrustedDomain();
/* Function: 0x1c */
- NTSTATUS lsa_OpenSecret(
+ [public] NTSTATUS lsa_OpenSecret(
[in] policy_handle *handle,
[in] lsa_String name,
[in] uint32 access_mask,
@@ -564,7 +564,7 @@ import "security.idl";
/* Function: 0x1d */
- NTSTATUS lsa_SetSecret(
+ [public] NTSTATUS lsa_SetSecret(
[in] policy_handle *sec_handle,
[in,unique] lsa_DATA_BUF *new_val,
[in,unique] lsa_DATA_BUF *old_val
@@ -575,7 +575,7 @@ import "security.idl";
} lsa_DATA_BUF_PTR;
/* Function: 0x1e */
- NTSTATUS lsa_QuerySecret (
+ [public] NTSTATUS lsa_QuerySecret (
[in] policy_handle *sec_handle,
[in,out,unique] lsa_DATA_BUF_PTR *new_val,
[in,out,unique] NTTIME_hyper *new_mtime,
diff --git a/source4/torture/ndr/atsvc.c b/source4/torture/ndr/atsvc.c
index 45dcb8bc87..fe77dccdd1 100644
--- a/source4/torture/ndr/atsvc.c
+++ b/source4/torture/ndr/atsvc.c
@@ -199,16 +199,16 @@ struct torture_suite *ndr_atsvc_suite(TALLOC_CTX *ctx)
struct torture_suite *suite = torture_suite_create(ctx, "atsvc");
torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobEnum, jobenum_in_data, NDR_IN, jobenum_in_check );
- /* torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobEnum, jobenum_out_data, NDR_IN, jobenum_out_check ); */
+ torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobEnum, jobenum_out_data, NDR_OUT, jobenum_out_check );
torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobAdd, jobadd_in_data, NDR_IN, jobadd_in_check );
- /* torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobAdd, jobadd_out_data, NDR_IN, jobadd_out_check ); */
+ torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobAdd, jobadd_out_data, NDR_OUT, jobadd_out_check );
torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobDel, jobdel_in_data, NDR_IN, jobdel_in_check );
- /* torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobDel, jobdel_out_data, NDR_IN, jobdel_out_check ); */
+ torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobDel, jobdel_out_data, NDR_OUT, jobdel_out_check );
torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobGetInfo, jobgetinfo_in_data, NDR_IN, jobgetinfo_in_check );
- /* torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobGetInfo, jobgetinfo_out_data, NDR_IN, jobgetinfo_out_check ); */
+ torture_suite_add_ndr_pull_fn_test(suite, atsvc_JobGetInfo, jobgetinfo_out_data, NDR_OUT, jobgetinfo_out_check );
return suite;
}
diff --git a/source4/torture/ndr/lsa.c b/source4/torture/ndr/lsa.c
index 4cfcce5c37..d54acc7b77 100644
--- a/source4/torture/ndr/lsa.c
+++ b/source4/torture/ndr/lsa.c
@@ -1092,22 +1092,234 @@ static bool lsaropenpolicy_out_check(struct torture_context *tctx,
return true;
}
+static const uint8_t lsarcreateaccount_in_data[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x2a, 0xab, 0xb8, 0x84, 0x36, 0xc6, 0xed, 0x4f,
+ 0x83, 0x16, 0x04, 0xe8, 0x63, 0x15, 0xeb, 0x84, 0x03, 0x00, 0x00, 0x00,
+ 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0xb4, 0x71, 0xbc, 0x00,
+ 0xe1, 0x10, 0x00, 0x00, 0x26, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02
+};
+
+static bool lsarcreateaccount_in_check(struct torture_context *tctx,
+ struct lsa_CreateAccount *r)
+{
+ /* FIXME: Handle */
+ /* FIXME: Sid */
+ torture_assert_int_equal(tctx, r->in.access_mask, 0x2000000, "access mask");
+ return true;
+}
+
+static const uint8_t lsarcreateaccount_out_data[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x3d, 0x28, 0x64, 0xd8, 0x9a, 0xad, 0x2f, 0x48,
+ 0xa5, 0x37, 0x26, 0xb4, 0x17, 0x71, 0x3a, 0xe8, 0x00, 0x00, 0x00, 0x00
+};
+
+static bool lsarcreateaccount_out_check(struct torture_context *tctx,
+ struct lsa_CreateAccount *r)
+{
+ /* FIXME */
+ torture_assert_ntstatus_ok(tctx, r->out.result, "return code");
+ return true;
+}
+
+static const uint8_t lsardelete_in_data[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x3d, 0x28, 0x64, 0xd8, 0x9a, 0xad, 0x2f, 0x48,
+ 0xa5, 0x37, 0x26, 0xb4, 0x17, 0x71, 0x3a, 0xe8
+};
+
+static bool lsardelete_in_check(struct torture_context *tctx,
+ struct lsa_Delete *r)
+{
+ /* FIXME: Handle */
+ return true;
+}
+
+static const uint8_t lsardelete_out_data[] = {
+ 0x00, 0x00, 0x00, 0x00
+};
+
+static bool lsardelete_out_check(struct torture_context *tctx,
+ struct lsa_Delete *r)
+{
+ torture_assert_ntstatus_ok(tctx, r->out.result, "return code");
+ return true;
+}
+
+static const uint8_t lsarcreatesecret_in_data[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x2a, 0xab, 0xb8, 0x84, 0x36, 0xc6, 0xed, 0x4f,
+ 0x83, 0x16, 0x04, 0xe8, 0x63, 0x15, 0xeb, 0x84, 0x2e, 0x00, 0x2e, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x17, 0x00, 0x00, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x74, 0x00,
+ 0x75, 0x00, 0x72, 0x00, 0x65, 0x00, 0x73, 0x00, 0x65, 0x00, 0x63, 0x00,
+ 0x72, 0x00, 0x65, 0x00, 0x74, 0x00, 0x2d, 0x00, 0x38, 0x00, 0x35, 0x00,
+ 0x32, 0x00, 0x38, 0x00, 0x38, 0x00, 0x35, 0x00, 0x33, 0x00, 0x35, 0x00,
+ 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02
+};
+
+static bool lsarcreatesecret_in_check(struct torture_context *tctx,
+ struct lsa_CreateSecret *r)
+{
+ /* FIXME: Handle */
+ torture_assert_str_equal(tctx, r->in.name.string, "torturesecret-852885356", "name");
+ torture_assert_int_equal(tctx, r->in.access_mask, 0x2000000, "access mask");
+ return true;
+}
+
+static const uint8_t lsarcreatesecret_out_data[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x2d, 0x02, 0x15, 0x3d, 0xfb, 0x27, 0x4c,
+ 0xaa, 0x22, 0x13, 0x79, 0x20, 0x14, 0x7f, 0xad, 0x00, 0x00, 0x00, 0x00
+};
+
+static bool lsarcreatesecret_out_check(struct torture_context *tctx,
+ struct lsa_CreateSecret *r)
+{
+ /* FIXME: Handle */
+ torture_assert_ntstatus_ok(tctx, r->out.result, "return code");
+ return true;
+}
+
+static const uint8_t lsaropensecret_in_data[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x2a, 0xab, 0xb8, 0x84, 0x36, 0xc6, 0xed, 0x4f,
+ 0x83, 0x16, 0x04, 0xe8, 0x63, 0x15, 0xeb, 0x84, 0x2e, 0x00, 0x2e, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x17, 0x00, 0x00, 0x00, 0x74, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x74, 0x00,
+ 0x75, 0x00, 0x72, 0x00, 0x65, 0x00, 0x73, 0x00, 0x65, 0x00, 0x63, 0x00,
+ 0x72, 0x00, 0x65, 0x00, 0x74, 0x00, 0x2d, 0x00, 0x38, 0x00, 0x35, 0x00,
+ 0x32, 0x00, 0x38, 0x00, 0x38, 0x00, 0x35, 0x00, 0x33, 0x00, 0x35, 0x00,
+ 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02
+};
+
+static bool lsaropensecret_in_check(struct torture_context *tctx,
+ struct lsa_OpenSecret *r)
+{
+ /* FIXME: Handle */
+ torture_assert_str_equal(tctx, r->in.name.string, "torturesecret-852885356", "name");
+ torture_assert_int_equal(tctx, r->in.access_mask, 0x2000000, "access mask");
+ return true;
+}
+
+static const uint8_t lsaropensecret_out_data[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x9f, 0x6d, 0x07, 0x35, 0x08, 0x43, 0xd9, 0x4b,
+ 0xbb, 0xcf, 0xeb, 0x4a, 0x91, 0xd2, 0x24, 0xe7, 0x00, 0x00, 0x00, 0x00
+};
+
+static bool lsaropensecret_out_check(struct torture_context *tctx,
+ struct lsa_OpenSecret *r)
+{
+ /* FIXME: Handle */
+ torture_assert_ntstatus_ok(tctx, r->out.result, "return code");
+ return true;
+}
+
+static const uint8_t lsarsetsecret_in_data[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x2d, 0x02, 0x15, 0x3d, 0xfb, 0x27, 0x4c,
+ 0xaa, 0x22, 0x13, 0x79, 0x20, 0x14, 0x7f, 0xad, 0x01, 0x00, 0x00, 0x00,
+ 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0xda, 0xb8, 0x19, 0xb6, 0xaf, 0x8c, 0x0f, 0xf5, 0x28, 0x81, 0xca, 0xce,
+ 0xcc, 0x8b, 0x70, 0xc4, 0x8a, 0xe5, 0xad, 0x51, 0x1a, 0x0e, 0xb5, 0xaa,
+ 0x3b, 0xdc, 0xbf, 0x38, 0x30, 0xb4, 0x18, 0x6d, 0x00, 0x00, 0x00, 0x00
+};
+
+static bool lsarsetsecret_in_check(struct torture_context *tctx,
+ struct lsa_SetSecret *r)
+{
+ /* FIXME: Handle */
+ torture_assert(tctx, r->in.new_val != NULL, "new val ptr");
+ torture_assert(tctx, r->in.old_val == NULL, "old val ptr");
+ torture_assert_int_equal(tctx, r->in.new_val->length, 32, "new val len");
+ torture_assert_int_equal(tctx, r->in.new_val->size, 32, "new val size");
+ return true;
+}
+
+
+static const uint8_t lsarsetsecret_out_data[] = {
+ 0x00, 0x00, 0x00, 0x00
+};
+
+static bool lsarsetsecret_out_check(struct torture_context *tctx,
+ struct lsa_SetSecret *r)
+{
+ torture_assert_ntstatus_ok(tctx, r->out.result, "return code");
+ return true;
+}
+
+static const uint8_t lsarquerysecret_in_data[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x2d, 0x02, 0x15, 0x3d, 0xfb, 0x27, 0x4c,
+ 0xaa, 0x22, 0x13, 0x79, 0x20, 0x14, 0x7f, 0xad, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+static bool lsarquerysecret_in_check(struct torture_context *tctx,
+ struct lsa_QuerySecret *r)
+{
+ /* FIXME: Handle */
+ torture_assert(tctx, r->in.new_val != NULL, "new val ptr");
+ torture_assert(tctx, r->in.new_val->buf == NULL, "new val ptr ptr");
+ torture_assert(tctx, r->in.new_mtime != NULL, "new mtime ptr");
+ /* FIXME: *new_mtime */
+ torture_assert(tctx, r->in.old_val == NULL, "old val ptr");
+ torture_assert(tctx, r->in.old_mtime == NULL, "old mtime ptr");
+ return true;
+}
+
+
+static const uint8_t lsarquerysecret_out_data[] = {
+ 0x00, 0x00, 0x02, 0x00, 0x04, 0x00, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x20, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0xda, 0xb8, 0x19, 0xb6,
+ 0xaf, 0x8c, 0x0f, 0xf5, 0x28, 0x81, 0xca, 0xce, 0xcc, 0x8b, 0x70, 0xc4,
+ 0x8a, 0xe5, 0xad, 0x51, 0x1a, 0x0e, 0xb5, 0xaa, 0x3b, 0xdc, 0xbf, 0x38,
+ 0x30, 0xb4, 0x18, 0x6d, 0x0c, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x90, 0x3e, 0x63, 0x7e, 0xee, 0xf1, 0xc4, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+static bool lsarquerysecret_out_check(struct torture_context *tctx,
+ struct lsa_QuerySecret *r)
+{
+ /* FIXME: Handle */
+ torture_assert(tctx, r->out.new_val != NULL, "new val ptr");
+ torture_assert(tctx, r->out.new_mtime != NULL, "new mtime ptr");
+ /* FIXME: *new_mtime */
+ torture_assert(tctx, r->out.old_val == NULL, "old val ptr");
+ torture_assert(tctx, r->out.old_mtime == NULL, "old mtime ptr");
+ return true;
+}
+
struct torture_suite *ndr_lsa_suite(TALLOC_CTX *ctx)
{
struct torture_suite *suite = torture_suite_create(ctx, "lsa");
torture_suite_add_ndr_pull_fn_test(suite, lsa_OpenPolicy, lsaropenpolicy_in_data, NDR_IN, lsaropenpolicy_in_check);
- /* torture_suite_add_ndr_pull_fn_test(suite, lsa_OpenPolicy, lsaropenpolicy_out_data, NDR_IN, lsaropenpolicy_out_check); */
+ torture_suite_add_ndr_pull_fn_test(suite, lsa_OpenPolicy, lsaropenpolicy_out_data, NDR_OUT, lsaropenpolicy_out_check);
torture_suite_add_ndr_pull_fn_test(suite, lsa_OpenPolicy2, lsaropenpolicy2_in_data, NDR_IN, lsaropenpolicy2_in_check);
- /* torture_suite_add_ndr_pull_fn_test(suite, lsa_OpenPolicy2, lsaropenpolicy2_out_data, NDR_IN, lsaropenpolicy2_out_check); */
+ torture_suite_add_ndr_pull_fn_test(suite, lsa_OpenPolicy2, lsaropenpolicy2_out_data, NDR_OUT, lsaropenpolicy2_out_check);
torture_suite_add_ndr_pull_fn_test(suite, lsa_LookupNames, lsarlookupnames_in_data, NDR_IN, lsarlookupnames_in_check);
- /* torture_suite_add_ndr_pull_fn_test(suite, lsa_LookupNames, lsarlookupnames_out_data, NDR_IN, lsarlookupnames_out_check); */
+ torture_suite_add_ndr_pull_fn_test(suite, lsa_LookupNames, lsarlookupnames_out_data, NDR_OUT, lsarlookupnames_out_check);
torture_suite_add_ndr_pull_fn_test(suite, lsa_LookupSids, lsarlookupsids_in_data, NDR_IN, lsarlookupsids_in_check);
- /* torture_suite_add_ndr_pull_fn_test(suite, lsa_LookupSids, lsarlookupsids_out_data, NDR_IN, lsarlookupsids_out_check); */
+ torture_suite_add_ndr_pull_fn_test(suite, lsa_LookupSids, lsarlookupsids_out_data, NDR_OUT, lsarlookupsids_out_check);
+
+ torture_suite_add_ndr_pull_fn_test(suite, lsa_CreateAccount, lsarcreateaccount_in_data, NDR_IN, lsarcreateaccount_in_check);
+ torture_suite_add_ndr_pull_fn_test(suite, lsa_CreateAccount, lsarcreateaccount_out_data, NDR_OUT, lsarcreateaccount_out_check);
+
+ torture_suite_add_ndr_pull_fn_test(suite, lsa_Delete, lsardelete_in_data, NDR_IN, lsardelete_in_check);
+ torture_suite_add_ndr_pull_fn_test(suite, lsa_Delete, lsardelete_out_data, NDR_OUT, lsardelete_out_check);
+
+ torture_suite_add_ndr_pull_fn_test(suite, lsa_CreateSecret, lsarcreatesecret_in_data, NDR_IN, lsarcreatesecret_in_check);
+ torture_suite_add_ndr_pull_fn_test(suite, lsa_CreateSecret, lsarcreatesecret_out_data, NDR_OUT, lsarcreatesecret_out_check);
+
+ torture_suite_add_ndr_pull_fn_test(suite, lsa_OpenSecret, lsaropensecret_in_data, NDR_IN, lsaropensecret_in_check);
+ torture_suite_add_ndr_pull_fn_test(suite, lsa_OpenSecret, lsaropensecret_out_data, NDR_OUT, lsaropensecret_out_check);
+
+ torture_suite_add_ndr_pull_fn_test(suite, lsa_SetSecret, lsarsetsecret_in_data, NDR_IN, lsarsetsecret_in_check);
+ torture_suite_add_ndr_pull_fn_test(suite, lsa_SetSecret, lsarsetsecret_out_data, NDR_OUT, lsarsetsecret_out_check);
+ torture_suite_add_ndr_pull_fn_test(suite, lsa_QuerySecret, lsarquerysecret_in_data, NDR_IN, lsarquerysecret_in_check);
+ torture_suite_add_ndr_pull_fn_test(suite, lsa_QuerySecret, lsarquerysecret_out_data, NDR_OUT, lsarquerysecret_out_check);
return suite;
}