1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

s4:torture/ndr: Add supplementalCredentials blob from Win2012R2

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Andrew Bartlett 2016-07-20 16:45:34 +12:00 committed by Stefan Metzmacher
parent 9e8228692d
commit 7eab12fa63

View File

@ -341,17 +341,78 @@ static bool release_4_1_0rc3_supplementalCredentials_check(struct torture_contex
return true;
}
static const char *win2012R2_supplementalCredentials =
"AAAAACgIAAAAAAAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAg"
"ACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAI"
"AAgACAAIAAgACAAUAAEADYA3AEBAFAAcgBpAG0AYQByAHkAOgBLAGUAcgBiAGUAcgBvAHMALQBOAG"
"UAdwBlAHIALQBLAGUAeQBzADA0MDAwMDAwMDMwMDAwMDAwMDAwMDAwMDNlMDAzZTAwNzgwMDAwMDA"
"wMDEwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDEwMDAwMDEyMDAwMDAwMjAwMDAwMDBiNjAwMDAwMDAw"
"MDAwMDAwMDAwMDAwMDAwMDEwMDAwMDExMDAwMDAwMTAwMDAwMDBkNjAwMDAwMDAwMDAwMDAwMDAwM"
"DAwMDAwMDEwMDAwMDAzMDAwMDAwMDgwMDAwMDBlNjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMD"
"AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDMyMDAzMDAwMzAwMDM4MDA1MjAwMzIwMDJlMDA0ODA"
"wNGYwMDU3MDA1NDAwNGYwMDJlMDA0MTAwNDIwMDQxMDA1MjAwNTQwMDRjMDA0NTAwNTQwMDJlMDA0"
"ZTAwNDUwMDU0MDA2YjAwNzIwMDYyMDA3NDAwNjcwMDc0MDAwNzNhYTVmMjVmZjU2MzUyZ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Q5MmIwZjE3ZmIwZmRmMjhkN2E2MWMzNTFlYTRkYWU2MDc0MzMxMTAwYjk5YWJiOTY1NTk5ZDY"
"1NjkxNDVjOWM5MTJjOWI2Yzk0ZjNiMDA3ZmM5YTA2OGFiMDhkNTA5gA==";
static bool win2012R2_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, 0x828, "__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, we force to 0 */
return true;
}
struct torture_suite *ndr_drsblobs_suite(TALLOC_CTX *ctx)
{
DATA_BLOB win2012R2_supplementalCredentials_blob;
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");
struct torture_suite *win2012R2_suite = torture_suite_create(ctx, "win2012R2_suite");
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_suite(suite, win2012R2_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);
@ -386,5 +447,13 @@ struct torture_suite *ndr_drsblobs_suite(TALLOC_CTX *ctx)
base64_decode_data_blob_talloc(suite, release_4_1_0rc3_supplementalCredentials),
release_4_1_0rc3_supplementalCredentials_check);
/* This last byte is typically not initialized, we force to zero to allow pull/push */
win2012R2_supplementalCredentials_blob = base64_decode_data_blob_talloc(suite, win2012R2_supplementalCredentials);
win2012R2_supplementalCredentials_blob.data[win2012R2_supplementalCredentials_blob.length-1] = 0;
torture_suite_add_ndr_pull_validate_test(win2012R2_suite,
supplementalCredentialsBlob,
win2012R2_supplementalCredentials_blob,
win2012R2_supplementalCredentials_check);
return suite;
}