raise exception if manual fingerprint verification failed

If a fingerprint could not be verified automatically or manually
raise an exception to ensure that we do not continue with handling
the problematic or even evil response.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2017-12-14 11:12:06 +01:00 committed by Wolfgang Bumiller
parent 097484f42d
commit 8153e67107

View File

@ -139,8 +139,7 @@ sub manual_verify_fingerprint {
my ($self, $fingerprint) = @_;
if (!$self->{manual_verification}) {
warn "fingerprint: $fingerprint\n";
return 0;
raise("fingerprint '$fingerprint' not verified, abort!\n");
}
print "The authenticity of host '$self->{host}' can't be established.\n" .
@ -153,6 +152,8 @@ sub manual_verify_fingerprint {
$self->{cached_fingerprints}->{$fingerprint} = $valid;
raise("Fingerprint not verified, abort!\n") if !$valid;
if (my $cb = $self->{register_fingerprint_cb}) {
$cb->($fingerprint) if $valid;
}