Browse Source

Refactor analyze for cryptcheck-lib compliance

master
Aeris 3 years ago
parent
commit
a4aba73914

+ 1
- 1
app/controllers/site_controller.rb View File

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

+ 1
- 1
app/views/check/show.html.erb View File

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

+ 2
- 2
app/views/site/ciphers.html.erb View File

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

+ 2
- 2
app/workers/check_worker.rb View File

@@ -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
- 5
app/workers/https_worker.rb View File

@@ -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
- 5
app/workers/smtp_worker.rb View File

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

+ 1
- 1
app/workers/ssh_worker.rb View File

@@ -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
- 5
app/workers/tls_worker.rb View File

@@ -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
- 5
app/workers/xmpp_worker.rb View File

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