No Description https://cryptcheck.fr/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ssh_worker.rb 563B

123456789101112131415161718192021222324
  1. require 'simpleidn'
  2. require 'cryptcheck'
  3. class SSHWorker
  4. include Sidekiq::Worker
  5. sidekiq_options retry: false
  6. def perform(host, port=nil)
  7. idn = SimpleIDN.to_ascii host
  8. result = begin
  9. server = CryptCheck::Ssh::Server.new idn, port
  10. {
  11. kex: server.kex,
  12. encryption: server.encryption,
  13. hmac: server.hmac,
  14. compression: server.compression,
  15. key: server.key
  16. }
  17. rescue CryptCheck::Ssh::Server::SshNotAvailableException
  18. { no_tls: true }
  19. end
  20. Datastore.post :ssh, "#{host}:#{port}", result
  21. end
  22. end