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_helper.rb 690B

4 years ago
4 years ago
12345678910111213141516171819202122232425262728
  1. module SshHelper
  2. COLORS = { green: :success, yellow: :warning, red: :danger, nil => :default }
  3. def kex_label(key)
  4. label key, COLORS[CryptCheck::Ssh::Server::KEX[key]]
  5. end
  6. def cipher_label(cipher)
  7. label cipher, COLORS[CryptCheck::Ssh::Server::ENCRYPTION[cipher]]
  8. end
  9. def hmac_label(hmac)
  10. label hmac, COLORS[CryptCheck::Ssh::Server::HMAC[hmac]]
  11. end
  12. def compression_label(compression)
  13. label compression, COLORS[CryptCheck::Ssh::Server::COMPRESSION[compression]]
  14. end
  15. def key_label(key)
  16. label key, COLORS[CryptCheck::Ssh::Server::KEY[key]]
  17. end
  18. private
  19. #def label(name, color)
  20. # "<span class=\"label label-#{color}\">&nbsp;</span>&nbsp;#{name}".html_safe
  21. #end
  22. end