Refactor analyze for cryptcheck-lib compliance

v1
Aeris 7 years ago
parent 9c93fbf5e2
commit a4aba73914
  1. 2
      app/controllers/site_controller.rb
  2. 2
      app/views/check/show.html.erb
  3. 4
      app/views/site/ciphers.html.erb
  4. 4
      app/workers/check_worker.rb
  5. 7
      app/workers/https_worker.rb
  6. 7
      app/workers/smtp_worker.rb
  7. 2
      app/workers/ssh_worker.rb
  8. 7
      app/workers/tls_worker.rb
  9. 7
      app/workers/xmpp_worker.rb

@ -31,7 +31,7 @@ class SiteController < ApplicationController
end
def suite
@suite = params.require :suite
@suite = params[:id] || params.require(:suite)
@ciphers = CryptCheck::Tls::Cipher.list @suite
end
end

@ -78,7 +78,7 @@
<table class="table table-bordered table-condensed table-striped">
<thead>
<tr>
<th class="col-sm-3">Algorithme</th>
<th class="col-sm-5">Algorithme</th>
<th class="col-sm-1">Clef</th>
<th class="col-sm-1">DH</th>
<th></th>

@ -3,9 +3,9 @@
<table class="table-bordered table-condensed table-striped col-sm-12">
<thead>
<tr>
<th class="col-sm-4">Algorithme</th>
<th class="col-sm-6">Algorithme</th>
<th class="col-sm-1">Taille</th>
<td class="col-sm-7"></td>
<td class="col-sm-5"></td>
</tr>
</thead>
<tbody>

@ -9,8 +9,8 @@ class CheckWorker
def perform(host, port=nil)
host = SimpleIDN.to_ascii host.downcase
result = begin
server = self.server.new *(port ? [host, port] : [host])
grade = self.grade.new server
grade = self.analyze *(port ? [host, port] : [host])
server = grade.server
result = {
key: key_to_json(server.key),
dh: server.dh.collect { |k| key_to_json k },

@ -2,11 +2,8 @@ class HTTPSWorker < CheckWorker
sidekiq_options retry: false
protected
def server
CryptCheck::Tls::Https::Server
end
def grade
CryptCheck::Tls::Https::Grade
def analyze(host, port=443)
CryptCheck::Tls::Https.analyze host, port
end
def type

@ -2,11 +2,8 @@ class SMTPWorker < CheckWorker
sidekiq_options retry: false
protected
def server
CryptCheck::Tls::Smtp::Server
end
def grade
CryptCheck::Tls::Smtp::Grade
def analyze(host, port=25)
CryptCheck::Tls::Smtp.analyze host, port
end
def type

@ -5,7 +5,7 @@ class SSHWorker
def perform(host, port=nil)
host = SimpleIDN.to_ascii host.downcase
result = begin
server = CryptCheck::Ssh::Server.new *(port ? [host, port] : [host])
server = CryptCheck::Ssh.analyze host, port
{
kex: server.kex,
encryption: server.encryption,

@ -2,11 +2,8 @@ class TLSWorker < CheckWorker
sidekiq_options retry: false
protected
def server
CryptCheck::Tls::TcpServer
end
def grade
CryptCheck::Tls::Grade
def analyze(host, port)
CryptCheck::Tls.analyze host, port
end
def type

@ -2,11 +2,8 @@ class XMPPWorker < CheckWorker
sidekiq_options retry: false
protected
def server
CryptCheck::Tls::Xmpp::Server
end
def grade
CryptCheck::Tls::Xmpp::Grade
def analyze(host)
CryptCheck::Tls::Xmpp.analyze host
end
def type

Loading…
Cancel
Save