diff --git a/tests/test_auth_dce.py b/tests/test_auth_dce.py index 4d21e91..5be8cce 100644 --- a/tests/test_auth_dce.py +++ b/tests/test_auth_dce.py @@ -72,29 +72,29 @@ def _ntlm_exchange( assert not client.complete assert not server.complete - if client.protocol == "negotiate": - authentication = client.step(challenge) - assert authentication - assert not client.complete - assert not server.complete + authentication = client.step(challenge) + assert authentication - mech_list = server.step(authentication) - assert mech_list - assert not client.complete - assert server.complete + # If it's being wrapped by SPNEGO then an extra msg is expected + if authentication.startswith(b"NTLMSSP\x00"): + assert client.complete + assert not server.complete - final = client.step(mech_list) + final = server.step(authentication) assert not final assert client.complete assert server.complete else: - authentication = client.step(challenge) - assert authentication - assert client.complete + assert not client.complete assert not server.complete - final = server.step(authentication) + mech_list = server.step(authentication) + assert mech_list + assert not client.complete + assert server.complete + + final = client.step(mech_list) assert not final assert client.complete assert server.complete