Order ciphers by strength
rodič
1141af5d9d
revize
b20c94ff2d
|
@ -90,7 +90,8 @@ module CheckHelper
|
|||
end
|
||||
end
|
||||
|
||||
def cipher_name_label(cipher, state)
|
||||
def cipher_name_label(cipher)
|
||||
state = cipher.state
|
||||
color = case
|
||||
when !state[:error].empty? then :error
|
||||
when !state[:danger].empty? then :danger
|
||||
|
|
|
@ -86,17 +86,15 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<% %w(TLSv1_2 TLSv1_1 TLSv1 SSLv3 SSLv2).each do |protocol|
|
||||
ciphers = @result.ciphers.select { |c| c.protocol == protocol }
|
||||
.sort { |a, b| -1 * (a['size'] <=> b['size']) }
|
||||
ciphers = CryptCheck::Tls::Cipher.sort(@result.ciphers.select { |c| c.protocol == protocol }
|
||||
.collect { |c| CryptCheck::Tls::Cipher.new protocol, [c.name, nil, c[:size]], c.dh })
|
||||
unless ciphers.empty? %>
|
||||
<tr>
|
||||
<th colspan="3"><%= protocol_label protocol %></th>
|
||||
</tr>
|
||||
<% ciphers.each do |cipher|
|
||||
cipher = CryptCheck::Tls::Cipher.new protocol, [cipher.name, nil, cipher[:size]], cipher.dh
|
||||
%>
|
||||
<% ciphers.each do |cipher| %>
|
||||
<tr>
|
||||
<th><%= cipher_name_label cipher, cipher.state %></th>
|
||||
<th><%= cipher_name_label cipher %></th>
|
||||
<td><%= cipher_size_label cipher %></td>
|
||||
<td><%= key_label cipher.dh if cipher.dh %></td>
|
||||
<td><%= cipher_labels cipher %></td>
|
||||
|
|
|
@ -19,13 +19,12 @@
|
|||
-->
|
||||
<%
|
||||
context.ciphers = 'ALL:COMPLEMENTOFALL'
|
||||
context.ciphers.collect { |c| CryptCheck::Tls::Cipher.new protocol, c }
|
||||
.sort { |a, b| -1 * (a.size <=> b.size)}.each do |cipher| %>
|
||||
ciphers = context.ciphers.collect { |c| CryptCheck::Tls::Cipher.new protocol, c }
|
||||
CryptCheck::Tls::Cipher.sort(ciphers).each do |cipher| %>
|
||||
<tr>
|
||||
<% state = cipher.state %>
|
||||
<th><%= cipher_name_label cipher, state %></th>
|
||||
<th><%= cipher_name_label cipher %></th>
|
||||
<th><%= cipher_size_label cipher %></th>
|
||||
<th><%= cipher_labels state %></th>
|
||||
<th><%= cipher_labels cipher %></th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
Načítá se…
Odkázat v novém úkolu