瀏覽代碼

Improve scripts

new-scoring
aeris 2 年之前
父節點
當前提交
9ad705beba
共有 6 個文件被更改,包括 7 次插入26 次删除
  1. 1
    10
      bin/check_smtp.rb
  2. 1
    3
      bin/check_ssh.rb
  3. 0
    2
      bin/check_tls.rb
  4. 1
    10
      bin/check_xmpp.rb
  5. 0
    1
      bin/generate-test-material.rb
  6. 4
    0
      bin/supported.rb

+ 1
- 10
bin/check_smtp.rb 查看文件

@@ -3,13 +3,4 @@ $:.unshift File.expand_path File.join File.dirname(__FILE__), '../lib'
3 3
 require 'rubygems'
4 4
 require 'bundler/setup'
5 5
 require 'cryptcheck'
6
-
7
-name = ARGV[0] || 'smtp'
8
-file = ::File.join 'output', "#{name}.yml"
9
-if ::File.exist? file
10
-	::CryptCheck::Logger.level = ENV['LOG'] || :none
11
-	::CryptCheck::Tls::Smtp.analyze_file file, "output/#{name}.html"
12
-else
13
-	::CryptCheck::Logger.level = ENV['LOG'] || :info
14
-	::CryptCheck::Tls::Smtp.analyze_domain ARGV[0]
15
-end
6
+::CryptCheck::Tls::Smtp.analyze_domain ARGV[0]

+ 1
- 3
bin/check_ssh.rb 查看文件

@@ -3,6 +3,4 @@ $:.unshift File.expand_path File.join File.dirname(__FILE__), '../lib'
3 3
 require 'rubygems'
4 4
 require 'bundler/setup'
5 5
 require 'cryptcheck'
6
-
7
-::CryptCheck::Logger.level = ENV['LOG'] || :info
8
-::CryptCheck::Ssh.analyze ARGV[0], (ARGV[1] || 22)
6
+::CryptCheck::Ssh.analyze ARGV[0], ARGV.fetch(1, 22)

+ 0
- 2
bin/check_tls.rb 查看文件

@@ -3,6 +3,4 @@ $:.unshift File.expand_path File.join File.dirname(__FILE__), '../lib'
3 3
 require 'rubygems'
4 4
 require 'bundler/setup'
5 5
 require 'cryptcheck'
6
-
7
-::CryptCheck::Logger.level = ENV['LOG'] || :info
8 6
 ::CryptCheck::Tls::analyze ARGV[0], ARGV[1]

+ 1
- 10
bin/check_xmpp.rb 查看文件

@@ -3,13 +3,4 @@ $:.unshift File.expand_path File.join File.dirname(__FILE__), '../lib'
3 3
 require 'rubygems'
4 4
 require 'bundler/setup'
5 5
 require 'cryptcheck'
6
-
7
-name = ARGV[0] || 'xmpp'
8
-file = ::File.join 'output', "#{name}.yml"
9
-if ::File.exist? file
10
-	::CryptCheck::Logger.level = ENV['LOG'] || :none
11
-	::CryptCheck::Tls::Xmpp.analyze_file file, "output/#{name}.html"
12
-else
13
-	::CryptCheck::Logger.level = ENV['LOG'] || :info
14
-	::CryptCheck::Tls::Xmpp.analyze_domain ARGV[0], type: (ARGV[1] || :s2s).to_sym
15
-end
6
+::CryptCheck::Tls::Xmpp.analyze_domain ARGV[0], type: ARGV.fetch(1, :s2s).to_sym

+ 0
- 1
bin/generate-test-material.rb 查看文件

@@ -7,7 +7,6 @@ require 'socket'
7 7
 require 'cryptcheck'
8 8
 
9 9
 LOG       = ::CryptCheck::Logger
10
-LOG.level = ENV['LOG'] || :info
11 10
 
12 11
 OpenSSL::PKey::EC.send :alias_method, :private?, :private_key?
13 12
 

+ 4
- 0
bin/supported.rb 查看文件

@@ -14,3 +14,7 @@ CryptCheck::Tls::Cipher.each do |method, ciphers|
14 14
 		puts "  #{cipher}"
15 15
 	end
16 16
 end
17
+
18
+puts
19
+puts 'Supported curves'
20
+puts CryptCheck::Tls::Curve::SUPPORTED.collect(&:to_s).sort.join ' '

Loading…
取消
儲存