From 92c136c904be9197783db936f54082355730d300 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 8 Feb 2020 16:02:02 +0000 Subject: [PATCH] Limit the number of SSHFP records we generate --- Makefile | 2 +- bin/mksshfp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8a26dd0..7811651 100644 --- 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 diff --git a/bin/mksshfp b/bin/mksshfp index e4bc8ed..7c0f518 100755 --- a/bin/mksshfp +++ b/bin/mksshfp @@ -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 { -- 2.39.5