+check_ssh_hostkeys() {
+ if [ -e /etc/ssh/ssh_host_ed25519_key ] ; then
+ if ! [ -e /etc/ssh/ssh_host_ed25519_key.pub ]; then
+ log warn "Have /etc/ssh/ssh_host_ed25519_key without .pub"
+ return
+ fi
+ if cat /etc/ssh/ssh_known_hosts | awk -v hostname=$(hostname -f) '{split($1,a,","); if (a[1] == hostname) { print } }' | grep -q -F -f /etc/ssh/ssh_host_ed25519_key.pub; then
+ log ok "ed25519 host key in known_hosts"
+ return
+ else
+ log warn "ed25519 host key missing from known_hosts"
+ return
+ fi
+ else
+ log ok "no ed25519 host key."
+ return
+ fi
+}
+
+