Ensure that a mismatched host keys and MACs results in a failure
(self)
| 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" |
| 438 | version = 1 |
| 439 | compressions = comp_alg1, comp_alg2 |
| 440 | host keys = key_alg1, key_alg2, XXXmismatchedXXX |
| 441 | key exchanges = kex_alg1, kex_alg2 |
| 442 | ciphers = cipher_alg1, cipher_alg2, cipher_alg3 |
| 443 | macs = 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): |