5 if (-f "/etc/ssh/ssh_known_hosts")
 
   7     open(SSHFP, "-|","sshfp", "-k", "/etc/ssh/ssh_known_hosts") || die $!;
 
   9     while (my $line = <SSHFP>)
 
  11         if ($line =~ /^(\S+)\.openstreetmap\.org IN SSHFP (\d+) (\d+) ([0-9A-F]+)$/)
 
  18             if ($type == 2 && $algorithm != 2)
 
  22                 if (exists($hosts{$host}))
 
  28                     elsif ($algorithm == 4 && $hosts{$host}->{algorithm} != 3)
 
  41                         algorithm => $algorithm,
 
  57 open(SSHFP_JS, ">", "include/sshfp.js") || die $!;
 
  59 print SSHFP_JS qq|var SSHFP_RECORDS = [\n|;
 
  61 foreach my $host (sort keys %hosts)
 
  63     my $algorithm = $hosts{$host}->{algorithm};
 
  64     my $type = $hosts{$host}->{type};
 
  65     my $value = $hosts{$host}->{value};
 
  67     print SSHFP_JS qq|  SSHFP("${host}", ${algorithm}, ${type}, "${value}"),\n|;
 
  70 print SSHFP_JS qq|];\n|;