summaryrefslogtreecommitdiff
path: root/python/samba/tests/dcerpc/raw_protocol.py
AgeCommit message (Collapse)AuthorFilesLines
2024-10-10tests/dcerpc/raw_protocol: test invalid schannel bindsStefan Metzmacher1-0/+152
Note the ad_member will keep these as expected failures, as it doesn't provide the netlogon service, while the knownfail for the ADDC is only temporary. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14356 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-10-10tests/dcerpc/raw_protocol: add more tests for auth_pad alignmentStefan Metzmacher1-2/+17
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14356 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-10-10tests/dcerpc/raw_protocol: add tests for max auth_padding, auth_len or ↵Stefan Metzmacher1-0/+537
auth_offset BUG: https://bugzilla.samba.org/show_bug.cgi?id=14356 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-10-10tests/dcerpc/raw_protocol: fix comment in test_spnego_change_auth_type1Stefan Metzmacher1-1/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14356 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-10-10tests/dcerpc/raw_protocol: test_no_auth_ctx_requestStefan Metzmacher1-0/+33
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14356 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-10-10tests/dcerpc/raw_protocol: run test_neg_xmit_ffff_ffff over tcp and smbStefan Metzmacher1-5/+23
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14356 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-10-10tests/dcerpc/raw_protocol: add more test for auth padding during ↵Stefan Metzmacher1-3/+369
ALTER_CONTEXT/AUTH3 The aim is to keep testing the code paths, which are no longer testing because allow_bind_auth_pad is false now, which means the existing tests fail directly at the BIND, but we also want to test the error handling on ALTER_CONTEXT (and AUTH3). BUG: https://bugzilla.samba.org/show_bug.cgi?id=14356 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2024-10-10tests/dcerpc/raw_protocol: pass against Windows 2022 and require special env ↵Stefan Metzmacher1-18/+190
vars for legacy servers Test works against Windows 2022 and works like this: SMB_CONF_PATH=/dev/null SERVER=172.31.9.118 \ TARGET_HOSTNAME=w2022-118.w2022-l7.base IGNORE_RANDOM_PAD=1 \ DOMAIN=W2022-L7 REALM=W2022-L7.BASE \ USERNAME=administrator PASSWORD=A1b2C3d4 \ python/samba/tests/dcerpc/raw_protocol.py -v -f TestDCERPC_BIND Against a legacy Windows2012R2 server this still works: SMB_CONF_PATH=/dev/null SERVER=172.31.9.188 \ TARGET_HOSTNAME=w2012r2-188.w2012r2-l6.base ALLOW_BIND_AUTH_PAD=1 \ LEGACY_BIND_NACK_NO_REASON=1 AUTH_LEVEL_CONNECT_LSA=1 \ IGNORE_RANDOM_PAD=1 DOMAIN=W2012R2-L6 REALM=W2012R2-L6.BASE \ USERNAME=administrator PASSWORD=A1b2C3d4 \ python/samba/tests/dcerpc/raw_protocol.py -v -f TestDCERPC_BIND Currently Samba behaves like 2012R2, but the next commits will change that... BUG: https://bugzilla.samba.org/show_bug.cgi?id=14356 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2023-11-30python: tests: update all super calls to python 3 style in testsRob van der Linde1-1/+1
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> [abartlet@samba.org Some python2 style super() calls remain due to being an actual, even if reasonable, behaviour change]
2021-11-09CVE-2021-23192: python/tests/dcerpc: add tests to check how security ↵Stefan Metzmacher1-0/+1273
contexts relate to fragmented requests BUG: https://bugzilla.samba.org/show_bug.cgi?id=14875 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Samuel Cabrero <scabrero@samba.org>
2021-11-09CVE-2021-23192: python/tests/dcerpc: change assertNotEquals() into ↵Stefan Metzmacher1-144/+144
assertNotEqual() BUG: https://bugzilla.samba.org/show_bug.cgi?id=14875 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Samuel Cabrero <scabrero@samba.org>
2020-08-11python compat: remove binary_typeDouglas Bagnall1-3/+2
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2020-02-07pytests: heed assertEquals deprecation warning en-masseDouglas Bagnall1-752/+752
TestCase.assertEquals() is an alias for TestCase.assertEqual() and has been deprecated since Python 2.7. When we run our tests with in python developer mode (`PYTHONDEVMODE=1 make test`) we get 580 DeprecationWarnings about this. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2019-08-01tests/dcerpc/raw_protocol: Add more tests for DCERPC_AUTH_LEVEL_PACKETGünther Deschner1-0/+11
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Aug 1 16:59:02 UTC 2019 on sn-devel-184
2019-08-01tests/dcerpc/raw_protocol: split test_spnego_integrity_request into 2 partsStefan Metzmacher1-2/+6
This can be a generic test that can be used for more auth_levels. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-08-01tests/dcerpc/raw_protocol: split test_spnego_connect_request() into 2 partsStefan Metzmacher1-3/+7
This can be a generic test that can be used for more auth_levels. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-01-12py:dcerpc/raw_protocol: add tests to demonstrate how security context ↵Stefan Metzmacher1-0/+967
multiplexing works Important things are this: - It's not required to use the bind time feature negotiation in order to use it, it's only a hint for the client, but nothing is really negotiated, unlike the request multiplexing with the DCERPC_PFC_FLAG_CONC_MPX. - There's special handling related to AUTH_LEVEL_CONNECT and requests without auth trailer - An security context is identified by the unique tuple of auth_type, auth_level and auth_context_id (all together!), not just the auth_context_id. - There's a limit of 2049 explicit authentication contexts. BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-01-12py:dcerpc/raw_protocol: demonstrate that \\pipe\lsarpc returns \\pipe\lsass ↵Stefan Metzmacher1-2/+4
as secondary_address BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-01-12py:dcerpc/raw_protocol: add test_assoc_group_fail3()Stefan Metzmacher1-0/+45
This demonstrates that assoc groups are only shared on the same transport (endpoint). BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-01-12py:dcerpc/raw_protocol: add test_assoc_group_ok2 to check assoc groups over ↵Stefan Metzmacher1-0/+31
ncacn_np BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-01-12py:dcerpc/raw_protocol: enable tests with the ↵Stefan Metzmacher1-9/+3
DCERPC_PFC_FLAG_SUPPORT_HEADER_SIGN bit BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-01-12py:dcerpc/raw_protocol: consistently call self.recv_pdu(timeout=0.01) after ↵Stefan Metzmacher1-1/+3
auth3 When we don't expect a FAULT, we should wait a little bit to check there's no response to auth3 request. This reduces the raw_procol test from 45s down to 35s total runtime against Windows. BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-01-12py:dcerpc/raw_protocol: add tests for delayed header signing activationStefan Metzmacher1-0/+186
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-12-23py:dcerpc/raw_protocol: test signing also with raw NTLMSSP and KerberosStefan Metzmacher1-0/+44
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-12-23py:dcerpc/raw_protocol: test signing with and without header signingStefan Metzmacher1-1/+16
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-12-23py:dcerpc/raw_protocol: rename _test_spnego_signing_auth_level_request to ↵Stefan Metzmacher1-4/+5
_test_auth_signing_auth_level_request We now pass down dcerpc.DCERPC_AUTH_TYPE_SPNEGO from callers instead of having SPNEGO specific functions. BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-12-23py:dcerpc/raw_protocol: rename _test_spnego_bind_auth_level ↵Stefan Metzmacher1-6/+8
to_test_auth_bind_auth_level We now pass down dcerpc.DCERPC_AUTH_TYPE_SPNEGO from callers instead of having SPNEGO specific functions. BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-12-23py:dcerpc/raw_protocol: let self._test_spnego_bind_auth_level() return ↵Stefan Metzmacher1-4/+8
auth_context BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-12-23py:dcerpc/raw_protocol: make use of assertPadding()Stefan Metzmacher1-128/+60
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-12-23py:dcerpc/raw_protocol: explicitly disconnect additional connectionsStefan Metzmacher1-0/+2
BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-12-23py:dcerpc/raw_protocol: rename test_spnego_packet_bind_sign_privacy => ↵Stefan Metzmacher1-1/+1
test_spnego_packet_bind_seal This makes it consistent with other tests like test_spnego_integrity_bind_seal. BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-12-14PY3: change shebang to python3 in misc dirsJoe Guo1-1/+1
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Fri Dec 14 18:00:40 CET 2018 on sn-devel-144
2018-10-25python/tests/raw_protocol: reveal shadowed test via disambiguationDouglas Bagnall1-1/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2018-09-06PEP8: fix E127: continuation line over-indented for visual indentJoe Guo1-1/+1
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-03python/samba/test/dcerpc: Py3 port of samba.tests.dcerpc.raw_protocolNoel Power1-166/+173
Port code to allow this test run with either py2 or py3 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-08-24dcerpc py tests: improve argument formattingDouglas Bagnall1-3/+4
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-08-24PEP8: fix E305: expected 2 blank lines after class or function definition, ↵Joe Guo1-0/+1
found 1 Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E303: too many blank lines (2)Joe Guo1-3/+0
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E302: expected 2 blank lines, found 1Joe Guo1-0/+1
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E301: expected 1 blank line, found 0Joe Guo1-0/+2
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E251: unexpected spaces around keyword / parameter equalsJoe Guo1-93/+93
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E231: missing whitespace after ','Joe Guo1-20/+20
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E226: missing whitespace around arithmetic operatorJoe Guo1-18/+18
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E222: multiple spaces after operatorJoe Guo1-1/+1
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E128: continuation line under-indented for visual indentJoe Guo1-173/+173
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E127: continuation line over-indented for visual indentJoe Guo1-3/+3
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-07-10python/tests: make the test_assoc_group_fail2() test more resilient against ↵Stefan Metzmacher1-0/+3
timing On a busy system [e]poll() on the server will mark both the old connection fd and also the listening fd as readable. epoll() returns the events in order, so the server processes the disconnect first. With poll() we don't have an order of the events and the server is likely to process the connect before the disconnect. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-02-21tests:dcerpc/raw_protocol: reproduce call_id truncation bugStefan Metzmacher1-1/+1
We need to make sure the server handles call_id values > UINT16_MAX. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13289 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2017-03-10python: samba.tests.dcerpc: Move Class RawDCERPCTest to separated file.Lumir Balhar1-1/+1
The class is quite big, used in only one place, and it complicates situation around bootstrapping of Python 3 port. Signed-off-by: Lumir Balhar <lbalhar@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2016-10-26python/tests: add simple dcerpc orphaned testsStefan Metzmacher1-0/+218
ORPHANED is mostly ignored. It's up to the application server implementation to install a orphaned handler. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>