diff options
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/ndr/nbt.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/source4/torture/ndr/nbt.c b/source4/torture/ndr/nbt.c index 21cd571114..a753c2fe6f 100644 --- a/source4/torture/ndr/nbt.c +++ b/source4/torture/ndr/nbt.c @@ -2,7 +2,7 @@ Unix SMB/CIFS implementation. test suite for nbt ndr operations - Copyright (C) Guenther Deschner 2010,2011 + Copyright (C) Guenther Deschner 2010-2012 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -136,12 +136,42 @@ static bool nbt_netlogon_packet_check(struct torture_context *tctx, return true; } +static const uint8_t nbt_netlogon_packet_logon_primary_query_data[] = { + 0x07, 0x00, 0x58, 0x50, 0x44, 0x41, 0x54, 0x45, 0x56, 0x2d, 0x50, 0x52, + 0x4f, 0x00, 0x5c, 0x4d, 0x41, 0x49, 0x4c, 0x53, 0x4c, 0x4f, 0x54, 0x5c, + 0x4e, 0x45, 0x54, 0x5c, 0x47, 0x45, 0x54, 0x44, 0x43, 0x38, 0x31, 0x37, + 0x00, 0x00, 0x58, 0x00, 0x50, 0x00, 0x44, 0x00, 0x41, 0x00, 0x54, 0x00, + 0x45, 0x00, 0x56, 0x00, 0x2d, 0x00, 0x50, 0x00, 0x52, 0x00, 0x4f, 0x00, + 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff +}; + +static bool nbt_netlogon_packet_logon_primary_query_check(struct torture_context *tctx, + struct nbt_netlogon_packet *r) +{ + torture_assert_int_equal(tctx, r->command, LOGON_PRIMARY_QUERY, "command"); + torture_assert_str_equal(tctx, r->req.pdc.computer_name, "XPDATEV-PRO", "computer_name"); + torture_assert_str_equal(tctx, r->req.pdc.mailslot_name, "\\MAILSLOT\\NET\\GETDC817", "mailslot_name"); + torture_assert_int_equal(tctx, r->req.pdc._pad.length, 1, "_pad.length"); + torture_assert_int_equal(tctx, r->req.pdc._pad.data[0], 0, "_pad.data"); + torture_assert_str_equal(tctx, r->req.pdc.unicode_name, "XPDATEV-PRO", "unicode_name"); + torture_assert_int_equal(tctx, r->req.pdc.nt_version, 0x0000000b, "nt_version"); + torture_assert_int_equal(tctx, r->req.pdc.lmnt_token, 0xffff, "lmnt_token"); + torture_assert_int_equal(tctx, r->req.pdc.lm20_token, 0xffff, "lm20_token"); + + return true; +} + struct torture_suite *ndr_nbt_suite(TALLOC_CTX *ctx) { struct torture_suite *suite = torture_suite_create(ctx, "nbt"); torture_suite_add_ndr_pull_test(suite, nbt_netlogon_packet, netlogon_logon_request_req_data, netlogon_logon_request_req_check); + torture_suite_add_ndr_pull_test(suite, + nbt_netlogon_packet, + nbt_netlogon_packet_logon_primary_query_data, + nbt_netlogon_packet_logon_primary_query_check); + torture_suite_add_ndr_pull_test(suite, nbt_netlogon_response2, netlogon_logon_request_resp_data, netlogon_logon_request_resp_check); torture_suite_add_ndr_pull_test(suite, @@ -159,5 +189,10 @@ struct torture_suite *ndr_nbt_suite(TALLOC_CTX *ctx) data_blob_const(nbt_netlogon_packet_data, sizeof(nbt_netlogon_packet_data)), nbt_netlogon_packet_check); + torture_suite_add_ndr_pullpush_test(suite, + nbt_netlogon_packet, + data_blob_const(nbt_netlogon_packet_logon_primary_query_data, sizeof(nbt_netlogon_packet_logon_primary_query_data)), + nbt_netlogon_packet_logon_primary_query_check); + return suite; } |