diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb
index d37c53c..b5abf2a 100644
--- a/app/controllers/site_controller.rb
+++ b/app/controllers/site_controller.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
diff --git a/app/views/check/show.html.erb b/app/views/check/show.html.erb
index 1dcca01..822e4f5 100644
--- a/app/views/check/show.html.erb
+++ b/app/views/check/show.html.erb
@@ -78,7 +78,7 @@
- Algorithme |
+ Algorithme |
Clef |
DH |
|
diff --git a/app/views/site/ciphers.html.erb b/app/views/site/ciphers.html.erb
index 879f973..9e8c4a0 100644
--- a/app/views/site/ciphers.html.erb
+++ b/app/views/site/ciphers.html.erb
@@ -3,9 +3,9 @@
- Algorithme |
+ Algorithme |
Taille |
- |
+ |
diff --git a/app/workers/check_worker.rb b/app/workers/check_worker.rb
index 728468f..04418cb 100644
--- a/app/workers/check_worker.rb
+++ b/app/workers/check_worker.rb
@@ -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 },
diff --git a/app/workers/https_worker.rb b/app/workers/https_worker.rb
index 336e5bf..133a5b7 100644
--- a/app/workers/https_worker.rb
+++ b/app/workers/https_worker.rb
@@ -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
diff --git a/app/workers/smtp_worker.rb b/app/workers/smtp_worker.rb
index 1b1a37f..f667431 100644
--- a/app/workers/smtp_worker.rb
+++ b/app/workers/smtp_worker.rb
@@ -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
diff --git a/app/workers/ssh_worker.rb b/app/workers/ssh_worker.rb
index 1262315..11ce68e 100644
--- a/app/workers/ssh_worker.rb
+++ b/app/workers/ssh_worker.rb
@@ -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,
diff --git a/app/workers/tls_worker.rb b/app/workers/tls_worker.rb
index 747b7ce..f3ebbf1 100644
--- a/app/workers/tls_worker.rb
+++ b/app/workers/tls_worker.rb
@@ -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
diff --git a/app/workers/xmpp_worker.rb b/app/workers/xmpp_worker.rb
index 8891d47..26580a4 100644
--- a/app/workers/xmpp_worker.rb
+++ b/app/workers/xmpp_worker.rb
@@ -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