MCPcopy
hub / github.com/jtesta/ssh-audit / test_policy_evaluate_failing_7

Method test_policy_evaluate_failing_7

test/test_policy.py:434–450  ·  view source on GitHub ↗

Ensure that a mismatched host keys and MACs results in a failure

(self)

Source from the content-addressed store, hash-verified

432
433
434 def test_policy_evaluate_failing_7(self):
435 '''Ensure that a mismatched host keys and MACs results in a failure'''
436
437 policy_data = '''name = "Test Policy"
438version = 1
439compressions = comp_alg1, comp_alg2
440host keys = key_alg1, key_alg2, XXXmismatchedXXX
441key exchanges = kex_alg1, kex_alg2
442ciphers = cipher_alg1, cipher_alg2, cipher_alg3
443macs = mac_alg1, mac_alg2, XXXmismatchedXXX, mac_alg3'''
444
445 policy = self.Policy(policy_data=policy_data)
446 ret, errors, error_str = policy.evaluate('SSH Server 1.0', self._get_kex())
447 assert ret is False
448 assert len(errors) == 2
449 assert error_str.find('Host keys did not match.') != -1
450 assert error_str.find('MACs did not match.') != -1
451
452
453 def test_policy_evaluate_subset_passing_1(self):

Callers

nothing calls this directly

Calls 2

evaluateMethod · 0.95
_get_kexMethod · 0.95

Tested by

no test coverage detected