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

Method test_policy_evaluate_failing_4

test/test_policy.py:380–395  ·  view source on GitHub ↗

Ensure that a mismatched key exchange list results in a failure

(self)

Source from the content-addressed store, hash-verified

378
379
380 def test_policy_evaluate_failing_4(self):
381 '''Ensure that a mismatched key exchange list results in a failure'''
382
383 policy_data = '''name = "Test Policy"
384version = 1
385compressions = comp_alg1, comp_alg2
386host keys = key_alg1, key_alg2
387key exchanges = XXXmismatchedXXX, kex_alg1, kex_alg2
388ciphers = cipher_alg1, cipher_alg2, cipher_alg3
389macs = mac_alg1, mac_alg2, mac_alg3'''
390
391 policy = self.Policy(policy_data=policy_data)
392 ret, errors, error_str = policy.evaluate('SSH Server 1.0', self._get_kex())
393 assert ret is False
394 assert len(errors) == 1
395 assert error_str.find('Key exchanges did not match.') != -1
396
397
398 def test_policy_evaluate_failing_5(self):

Callers

nothing calls this directly

Calls 2

evaluateMethod · 0.95
_get_kexMethod · 0.95

Tested by

no test coverage detected