Only show [same fingerprint] if we haven't verified the host in the same file

This commit is contained in:
Juhani Krekelä 2018-09-01 22:50:29 +03:00
parent 922efa7eea
commit 4b8317f36e
1 changed files with 7 additions and 2 deletions

View File

@ -96,8 +96,13 @@ def main():
host_display = entry.normalize_host(fail_host, fail_port).decode()
print('[\x1b[31mfail\x1b[0m] %s: %s: %s' % (name, host_display, fail_comment))
for _, _, same_fingerprint_comment in same_fingerprint:
print('[same fingerprint] %s: (unknown host): %s' % (name, same_fingerprint_comment))
# Only display this if we didn't get a match in this file
# The value in the [same fingerprint] message is finding a host
# someone trusts impersonating as another host. But if the host
# has already been verified, it's just going to be noise
if len(success) == 0:
for _, _, same_fingerprint_comment in same_fingerprint:
print('[same fingerprint] %s: (unknown host): %s' % (name, same_fingerprint_comment))
if __name__ == '__main__':
try: