[project @ peter@palfrader.org-20080623071923-ek2m28u2alttindo]
[mirror/dsa-nagios.git] / dsa-nagios-nrpe-config / weak-ssh-keys-check
index a1a5294..68b73b6 100755 (executable)
@@ -194,7 +194,7 @@ sub from_ssh_key_file ($) {
     my $name = shift;
     if (open (my $FH, '<', $name)) {
        my $key = <$FH>; 
-       if ($key =~ m/^ssh-dss/) {
+       if ($key =~ m/ssh-dss/) {
                $dsa_keys++;
                $text .= "$name is a DSA key\n";
        }
@@ -229,7 +229,7 @@ sub from_ssh_auth_file ($) {
        clear_tmp $tmp;
        next if $line =~ m/^$/; # ignore empty lines
        next if $line =~ m/^#/; # ignore comments
-       if ($line =~ m/^ssh-dss/) {
+       if ($line =~ m/ssh-dss/) {
                $dsa_keys++;
                $text .= "$name:$lineno is a DSA key\n";
        }
@@ -253,6 +253,7 @@ sub from_ssh_host (@) {
     my $tmp = new File::Temp;
     for my $line (@lines) {
        next if $line =~ /^#/;
+       next if $line =~ /^no hostkey alg/;
        my ($host, $data) = $line =~ /^(\S+) (.*)$/;
        clear_tmp $tmp;
        print $tmp "$data\n" or die "print: $!";