From 7d5a5e8e5ae557f75a512b75d17574802e0bd563 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sun, 18 May 2008 14:29:23 +0200 Subject: [PATCH] Remove from_ssh_key_file, scan identity.pub as well --- dowkd.in | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/dowkd.in b/dowkd.in index 27040bf..d314dbf 100644 --- a/dowkd.in +++ b/dowkd.in @@ -155,16 +155,6 @@ sub ssh_fprint_check ($$$) { } } -sub from_ssh_key_file ($) { - my $name = shift; - my ($length, $hash) = ssh_fprint_file $name; - if ($length && $hash) { - ssh_fprint_check "$name:1", $length, $hash; - } else { - warn "$name:1: warning: failed to parse SSH key file\n"; - } -} - sub clear_tmp ($) { my $tmp = shift; seek $tmp, 0, 0 or die "seek: $!"; @@ -314,18 +304,12 @@ sub from_user ($) { warn "warning: user $user does not exist\n"; return; } - my $file = "$dir/.ssh/authorized_keys"; - from_ssh_auth_file $file if -r $file; - $file = "$dir/.ssh/authorized_keys2"; - from_ssh_auth_file $file if -r $file; - $file = "$dir/.ssh/known_hosts"; - from_ssh_auth_file $file if -r $file; - $file = "$dir/.ssh/known_hosts2"; - from_ssh_auth_file $file if -r $file; - $file = "$dir/.ssh/id_rsa.pub"; - from_ssh_key_file $file if -r $file; - $file = "$dir/.ssh/id_dsa.pub"; - from_ssh_key_file $file if -r $file; + for my $name (qw/authorized_keys authorized_keys2 + known_hosts known_hosts2 + id_rsa.pub id_dsa.pub identity.pub/) { + my $file = "$dir/.ssh/$name"; + from_ssh_auth_file $file if -r $file; + } } sub from_user_all () { -- 2.11.4.GIT