Fix cipher color

v1
Aeris 7 years ago
parent 8b6f08ab4d
commit 97ac325af0
  1. 2
      bin/supported.rb
  2. 20
      lib/cryptcheck/tls/cipher.rb

@ -8,4 +8,4 @@ puts 'Supported methods'
puts OpenSSL::SSL::SSLContext::METHODS.select { |m| CryptCheck::Tls::Server::EXISTING_METHODS.include? m }.sort.join ' '
puts 'Supported ciphers'
puts CryptCheck::Tls::Cipher.list.collect { |c| c.name }.sort.join ' '
puts CryptCheck::Tls::Cipher.list.collect { |c| c.colorize }.join ' '

@ -48,20 +48,12 @@ module CryptCheck
end
def colorize
colors = case
when dss?,
anonymous?,
null?,
export?,
md5?,
des?,
rc4?
{ color: :white, background: :red }
when des3?
{ color: :yellow }
when pfs?
{ color: :green }
end
colors = case self.score
when :error then { color: :white, background: :red }
when :danger then { color: :red }
when :warning then { color: :yellow }
when :success then { color: :green }
end
@name.colorize colors
end

Loading…
Cancel
Save