]> git.openstreetmap.org Git - dns.git/commitdiff
Limit the number of SSHFP records we generate
authorTom Hughes <tom@compton.nu>
Sat, 8 Feb 2020 16:02:02 +0000 (16:02 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 8 Feb 2020 16:02:02 +0000 (16:02 +0000)
Makefile
bin/mksshfp

index 8a26dd0c0adb8b4f841e80375a3bd19b171e2d68..781165159cc7c32af25ecd0e1d3bc1c01884b5c7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -66,7 +66,7 @@ data/switch2osm.org: src/switch2osm
 data/switch2osm.com: src/switch2osm
 data/stateofthemap.eu: src/stateofthemap-eu
 
-include/sshfp.js:
+include/sshfp.js: $(wildcard /etc/ssh/ssh_known_hosts)
        bin/mksshfp
 
 origins/tile.openstreetmap.yml: bin/mkcountries lib/countries.xml bandwidth/tile.openstreetmap.yml
index e4bc8ed30c84f293c680e46daaba43bac18a3a8e..7c0f518034332dd72c1111ea9bb6f79bf12068ff 100755 (executable)
@@ -18,7 +18,11 @@ if (-f "/etc/ssh/ssh_known_hosts")
             my $type = $3;
             my $value = $4;
 
-            print SSHFP_JS qq|  SSHFP("${host}", ${algorithm}, ${type}, "${value}"),\n|;
+            if ($type == 2 &&
+                ($algorithm == 3 || $algorithm == 4))
+            {
+                print SSHFP_JS qq|  SSHFP("${host}", ${algorithm}, ${type}, "${value}"),\n|;
+            }
         }
         else
         {