Ensure that a mismatched key exchange list results in a failure
(self)
| 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" |
| 384 | version = 1 |
| 385 | compressions = comp_alg1, comp_alg2 |
| 386 | host keys = key_alg1, key_alg2 |
| 387 | key exchanges = XXXmismatchedXXX, kex_alg1, kex_alg2 |
| 388 | ciphers = cipher_alg1, cipher_alg2, cipher_alg3 |
| 389 | macs = 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): |