Browse Source

Fix cipher color

master
Aeris 3 years ago
parent
commit
97ac325af0
2 changed files with 7 additions and 15 deletions
  1. 1
    1
      bin/supported.rb
  2. 6
    14
      lib/cryptcheck/tls/cipher.rb

+ 1
- 1
bin/supported.rb View File

@@ -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 ' '

+ 6
- 14
lib/cryptcheck/tls/cipher.rb View File

@@ -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