Skip to content

Commit

Permalink
selftest: Confirm that NDR bugs are fixed in DCOM code
Browse files Browse the repository at this point in the history
Test input provided by Michael Hanselmann and found using Hongfuzz.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13875
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
  • Loading branch information
abartlet committed Nov 20, 2019
1 parent 1aec742 commit ac1be89
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions python/samba/tests/blackbox/ndrdump.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,62 @@ def test_ndrdump_fuzzed_clusapi_QueryAllValues(self):
except BlackboxProcessError as e:
self.fail(e)
self.assertEqual(actual, expected)

def test_ndrdump_fuzzed_IOXIDResolver_ResolveOxid(self):
expected = '''pull returned Character Conversion Error
'''
try:
actual = self.check_exit_code(
'ndrdump IOXIDResolver ResolveOxid out ' +\
'--base64-input --input=' +\
'c87PMf7CBAUAAAAADgQMBASjfPqKw0KPld6DY87PMfQ=',
2)
except BlackboxProcessError as e:
self.fail(e)
self.assertRegex(actual.decode('utf8'), expected + "$")

def test_ndrdump_fuzzed_IOXIDResolver_ResolveOxid2(self):
expected = '''pull returned Buffer Size Error
'''
try:
actual = self.check_exit_code(
'ndrdump IOXIDResolver ResolveOxid2 out ' +\
'--base64-input --input=' +\
'AAAAAQ0K9Q0AAAAAAAAAA6ampqampqampqampqampqampqampqamNAAAAAAtNDQ=',
2)
except BlackboxProcessError as e:
self.fail(e)
self.assertRegex(actual.decode('utf8'), expected + "$")

def test_ndrdump_fuzzed_IOXIDResolver_ServerAlive2(self):
expected = b'''pull returned Success
WARNING! 46 unread bytes
[0000] 0D 36 0A 0A 0A 0A 0A 00 00 00 00 00 00 00 03 00 .6...... ........
[0010] 00 00 01 00 00 33 39 36 31 36 31 37 37 36 38 34 .....396 16177684
[0020] 32 34 FC 85 AC 49 0B 61 87 0A 0A 0A F5 00 24...I.a ......
ServerAlive: struct ServerAlive
out: struct ServerAlive
result : DOS code 0x01000000
dump OK
'''
try:
actual = self.check_output(
'ndrdump IOXIDResolver ServerAlive out ' +\
'--base64-input --input=' +\
'AAAAAQ02CgoKCgoAAAAAAAAAAwAAAAEAADM5NjE2MTc3Njg0MjT8haxJC2GHCgoK9QA=')
except BlackboxProcessError as e:
self.fail(e)
self.assertEqual(actual, expected)

def test_ndrdump_fuzzed_IRemoteActivation_RemoteActivation(self):
expected = '''pull returned Buffer Size Error
'''
try:
actual = self.check_exit_code(
'ndrdump IRemoteActivation RemoteActivation out ' +\
'--base64-input --input=' +\
'AAAAAQAAAAAAAABKAAD/AAAAAP4AAAAAAAAASgAAAAAAAAABIiIjIiIiIiIiIiIiIiMiAAAAAAD/AAAAAAAA',
2)
except BlackboxProcessError as e:
self.fail(e)
self.assertRegex(actual.decode('utf8'), expected + "$")

0 comments on commit ac1be89

Please sign in to comment.