ports/sysutils/ruby-facter/files/facts/sshfp_algorithm.rb

21 lines
500 B
Ruby
Raw Normal View History

2023-08-16 22:26:55 +00:00
# frozen_string_literal: true
module Facts
module Openbsd
class SshfpAlgorithm
FACT_NAME = 'sshfp_.*'
TYPE = :legacy
def call_the_resolver
facts = []
result = Facter::Resolvers::Ssh.resolve(:ssh)
result.each do |ssh|
facts << Facter::ResolvedFact.new("sshfp_#{ssh.name.to_sym}",
"#{ssh.fingerprint.sha1}\n#{ssh.fingerprint.sha256}", :legacy)
end
facts
end
end
end
end