Ensure that a mismatched host keys results in a failure
(self)
| 360 | |
| 361 | |
| 362 | def test_policy_evaluate_failing_3(self): |
| 363 | '''Ensure that a mismatched host keys results in a failure''' |
| 364 | |
| 365 | policy_data = '''name = "Test Policy" |
| 366 | version = 1 |
| 367 | compressions = comp_alg1, comp_alg2 |
| 368 | host keys = XXXmismatchedXXX, key_alg1, key_alg2 |
| 369 | key exchanges = kex_alg1, kex_alg2 |
| 370 | ciphers = cipher_alg1, cipher_alg2, cipher_alg3 |
| 371 | macs = mac_alg1, mac_alg2, mac_alg3''' |
| 372 | |
| 373 | policy = self.Policy(policy_data=policy_data) |
| 374 | ret, errors, error_str = policy.evaluate('SSH Server 1.0', self._get_kex()) |
| 375 | assert ret is False |
| 376 | assert len(errors) == 1 |
| 377 | assert error_str.find('Host keys did not match.') != -1 |
| 378 | |
| 379 | |
| 380 | def test_policy_evaluate_failing_4(self): |