summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2016-07-20 14:53:42 +1200
committerStefan Metzmacher <metze@samba.org>2016-07-20 21:27:18 +0200
commit9e8228692d8083f855ff00e582bab12246f7ff2d (patch)
tree29992e007ebe0d82600e896f991fab53eb2e09f1 /source4
parentc30dcaee4ccb8b83c907289788e84169ad2624e8 (diff)
downloadsamba-9e8228692d8083f855ff00e582bab12246f7ff2d.tar.gz
s4:torture/ndr: Add supplementalCredentials blobs from alpha13 and release_4_1_0rc3
This coveres the case without AES keys, and before the IDL was changed for SambaGPG support Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/ndr/drsblobs.c131
1 files changed, 128 insertions, 3 deletions
diff --git a/source4/torture/ndr/drsblobs.c b/source4/torture/ndr/drsblobs.c
index 712f857763b..4a1cf3c735f 100644
--- a/source4/torture/ndr/drsblobs.c
+++ b/source4/torture/ndr/drsblobs.c
@@ -234,10 +234,125 @@ static bool supplementalCredentials_empty2_check(struct torture_context *tctx,
return true;
}
+static const char *alpha13_supplementalCredentials =
+ "AAAAAPgFAAAAAAAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAg"
+ "ACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAI"
+ "AAgACAAIAAgACAAUAADACAANAEBAFAAcgBpAG0AYQByAHkAOgBLAGUAcgBiAGUAcgBvAHMAMDMwMD"
+ "AwMDAwMjAwMDAwMDNFMDAzRTAwNEMwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDMwMDAwMDAwODAwMDA"
+ "wMDhBMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAxMDAwMDAwMDgwMDAwMDA5MjAwMDAwMDAwMDAwMDAw"
+ "MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM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E0QjBBM0M2RkRCOTQ2QjM5MkYxMDgzNjEyM0NGQjVFQThFNEZFNjAxNzBFRTA4OTQ2N0"
+ "MyNUJEMEY0OTAxMDc3MzYyNTk4RUFGRUI5MjAzNEJFMjEyRDVDNTM5MTdBQzE0RTRDM0RFRTcwQjh"
+ "BRDU2QUQ5NUMwNkNGNzU3M0VDOTY5MzlGOTYzNDQzNkFDQzY4QjYzRUFEM0ZDRDQ0QUM2RjY5QzND"
+ "MTdDQjlBODA5MDA5M0M0NDQyOERDQTg0ODNERTU5M0JDQUM5NThDNUE0Rjg4NTVDODY5QjAzMTlFR"
+ "jVCMUM3OTkyQTc5Q0I4N0I3NjFBMEU0QjUzQkYzNTQ0REQxNTQ0OEUwMTAzREJBMkMyRjZDMUVDNE"
+ "IwMjU5REZCODdFQTNDMDVDRjNEMUY2QzIwNkFDQkZGNTZDOUVGRDI3QUY2NTBDRjJGQjgxRThERTA"
+ "1QzVGQzE5QjE0QkE4M0UwN0ZCRkM0MUM5RENFQTlFNDY1RTBEODVDNDg2MUZCQTBGQzQyNDI0REEx"
+ "OTU4Mzk5REE3QTY3MTE3RUM5NTUxQTI1QzBFMzg1OEM2OUZFREFGRjUwRjUwQ0RFQzA0MTdFMUQ0M"
+ "UJFRjlBNzM5QzM0QzBDOTk3NzI5MERGRTIyNzJCQzVDOTMyMTVGMzkwRUE4QzYxRTIzQ0UwMDBDNg"
+ "A=";
+
+static bool alpha13_supplementalCredentials_check(struct torture_context *tctx,
+ struct supplementalCredentialsBlob *r)
+{
+ torture_assert_int_equal(tctx, r->unknown1, 0, "unknown1");
+ torture_assert_int_equal(tctx, r->__ndr_size, 0x5F8, "__ndr_size");
+ torture_assert_int_equal(tctx, r->unknown2, 0, "unknown2");
+ torture_assert_str_equal(tctx, r->sub.prefix, SUPPLEMENTAL_CREDENTIALS_PREFIX, "prefix");
+ torture_assert_int_equal(tctx, r->sub.signature, SUPPLEMENTAL_CREDENTIALS_SIGNATURE, "signature");
+ torture_assert_int_equal(tctx, r->sub.num_packages, 3, "num_packages");
+ torture_assert_str_equal(tctx, r->sub.packages[0].name, "Primary:Kerberos", "name of package 0");
+ torture_assert_str_equal(tctx, r->sub.packages[1].name, "Packages", "name of package 1");
+ torture_assert_str_equal(tctx, r->sub.packages[2].name, "Primary:WDigest", "name of package 2");
+ torture_assert_int_equal(tctx, r->unknown3, 0x00, "unknown3"); /* This is typically not initialized */
+
+ return true;
+}
+
+static const char *release_4_1_0rc3_supplementalCredentials =
+ "AAAAALgIAAAAAAAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAg"
+ "ACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAI"
+ "AAgACAAIAAgACAAUAAEADYAEAIBAFAAcgBpAG0AYQByAHkAOgBLAGUAcgBiAGUAcgBvAHMALQBOAG"
+ "UAdwBlAHIALQBLAGUAeQBzADA0MDAwMDAwMDQwMDAwMDAwMDAwMDAwMDUwMDA1MDAwNzgwMDAwMDA"
+ "wMDEwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDEwMDAwMDEyMDAwMDAwMjAwMDAwMDBDODAwMDAwMDAw"
+ "MDAwMDAwMDAwMDAwMDAwMDEwMDAwMDExMDAwMDAwMTAwMDAwMDBFODAwMDAwMDAwMDAwMDAwMDAwM"
+ "DAwMDAwMDEwMDAwMDAzMDAwMDAwMDgwMDAwMDBGODAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDEwMD"
+ "AwMDAxMDAwMDAwMDgwMDAwMDAwMDAxMDAwMDUyMDA0NTAwNEMwMDQ1MDA0MTAwNTMwMDQ1MDAyRDA"
+ "wMzQwMDJEMDAzMTAwMkQwMDMwMDA1MjAwNDMwMDMzMDAyRTAwNTMwMDQxMDA0RDAwNDIwMDQxMDAy"
+ "RTAwNDMwMDRGMDA1MjAwNTAwMDQxMDA2NDAwNkQwMDY5MDA2RTAwNjkwMDczMDA3NDAwNzIwMDYxM"
+ "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jdFQTQ0MjI4QjJCRjVFQjg5MEQ2QjBEODgwNzVEMzhFREYxQzc5NEY1MDgxNUE2MzcxNTM"
+ "5QURCQTEyNkFDODc0Q0EyNzNBMzgwRTM0NjRFQkZERDE4MTgzRDY1MDlDOTJEQzVCQzhCNTg4M0Iy"
+ "QTlGRTcyMUQ0RkQ0MEQ3QkI0QzlENjcxOTYxNTRFRTQ4QkIzMDkxNEE3QkREODcyOTMyMjc1M0JDR"
+ "Dk2QkI5QzY1MzdFQjc1ODg3MUZDQzhGMEUxQjkyRTgyNEIxQTBDMjU1NjE2QURCMzYyMDc5NTQ5OT"
+ "Q5MUJCRTY5NTA0AA==";
+
+static bool release_4_1_0rc3_supplementalCredentials_check(struct torture_context *tctx,
+ struct supplementalCredentialsBlob *r)
+{
+ torture_assert_int_equal(tctx, r->unknown1, 0, "unknown1");
+ torture_assert_int_equal(tctx, r->__ndr_size, 0x8b8, "__ndr_size");
+ torture_assert_int_equal(tctx, r->unknown2, 0, "unknown2");
+ torture_assert_str_equal(tctx, r->sub.prefix, SUPPLEMENTAL_CREDENTIALS_PREFIX, "prefix");
+ torture_assert_int_equal(tctx, r->sub.signature, SUPPLEMENTAL_CREDENTIALS_SIGNATURE, "signature");
+ torture_assert_int_equal(tctx, r->sub.num_packages, 4, "num_packages");
+ torture_assert_str_equal(tctx, r->sub.packages[0].name, "Primary:Kerberos-Newer-Keys", "name of package 0");
+ torture_assert_str_equal(tctx, r->sub.packages[1].name, "Primary:Kerberos", "name of package 0");
+ torture_assert_str_equal(tctx, r->sub.packages[2].name, "Packages", "name of package 1");
+ torture_assert_str_equal(tctx, r->sub.packages[3].name, "Primary:WDigest", "name of package 2");
+ torture_assert_int_equal(tctx, r->unknown3, 0x00, "unknown3"); /* This is typically not initialized */
+
+ return true;
+}
+
struct torture_suite *ndr_drsblobs_suite(TALLOC_CTX *ctx)
{
struct torture_suite *suite = torture_suite_create(ctx, "drsblobs");
-
+ struct torture_suite *empty1_suite = torture_suite_create(ctx, "empty1");
+ struct torture_suite *empty2_suite = torture_suite_create(ctx, "empty2");
+ struct torture_suite *alpha13_suite = torture_suite_create(ctx, "alpha13");
+ struct torture_suite *release_4_1_0rc3_suite = torture_suite_create(ctx, "release-4-1-0rc3");
+ torture_suite_add_suite(suite, empty1_suite);
+ torture_suite_add_suite(suite, empty2_suite);
+ torture_suite_add_suite(suite, alpha13_suite);
+ torture_suite_add_suite(suite, release_4_1_0rc3_suite);
+
torture_suite_add_ndr_pull_test(suite, ForestTrustInfo, forest_trust_info_data_out, forest_trust_info_check_out);
torture_suite_add_ndr_pull_test(suite, trustDomainPasswords, trust_domain_passwords_in, trust_domain_passwords_check_in);
@@ -251,15 +366,25 @@ struct torture_suite *ndr_drsblobs_suite(TALLOC_CTX *ctx)
base64_decode_data_blob_talloc(suite, trustAuthOutgoing),
NULL);
- torture_suite_add_ndr_pull_validate_test(suite, supplementalCredentialsBlob,
+ torture_suite_add_ndr_pull_validate_test(empty1_suite, supplementalCredentialsBlob,
data_blob_const(supplementalCredentials_empty1,
sizeof(supplementalCredentials_empty1)),
supplementalCredentials_empty1_check);
- torture_suite_add_ndr_pull_validate_test(suite, supplementalCredentialsBlob,
+ torture_suite_add_ndr_pull_validate_test(empty2_suite, supplementalCredentialsBlob,
data_blob_const(supplementalCredentials_empty2,
sizeof(supplementalCredentials_empty2)),
supplementalCredentials_empty2_check);
+ torture_suite_add_ndr_pull_validate_test(alpha13_suite,
+ supplementalCredentialsBlob,
+ base64_decode_data_blob_talloc(suite, alpha13_supplementalCredentials),
+ alpha13_supplementalCredentials_check);
+
+ torture_suite_add_ndr_pull_validate_test(release_4_1_0rc3_suite,
+ supplementalCredentialsBlob,
+ base64_decode_data_blob_talloc(suite, release_4_1_0rc3_supplementalCredentials),
+ release_4_1_0rc3_supplementalCredentials_check);
+
return suite;
}