From 9b74c5a829ab4f4927c3a9dcc6612a05d4128f48 Mon Sep 17 00:00:00 2001 From: Aeris Date: Wed, 26 Aug 2015 14:29:47 +0200 Subject: [PATCH] Cipher status --- lib/cryptcheck/tls/cipher.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/cryptcheck/tls/cipher.rb b/lib/cryptcheck/tls/cipher.rb index 1a19239..24f82e2 100644 --- a/lib/cryptcheck/tls/cipher.rb +++ b/lib/cryptcheck/tls/cipher.rb @@ -64,6 +64,14 @@ module CryptCheck end @name.colorize colors end + + def state + ok = Proc.new { |n| self.send "#{n}?" } + { success: %i(pfs).select { |n| ok.call n }, + warning: %i(des3 sha1).select { |n| ok.call n }, + danger: %i(md5 psk srp anonymous null export des rc2 rc4).select { |n| ok.call n } + } + end end end end