You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
2.5 KiB
82 lines
2.5 KiB
<div class="container">
|
|
<div class="row">
|
|
<div class="col-sm-11">
|
|
<h1>
|
|
[<%= self.type.to_s.upcase %>] <%= @host %> <span class="small">(<%= l @analysis.updated_at %>)</span>
|
|
</h1>
|
|
</div>
|
|
<% if Time.now - @analysis.updated_at >= Rails.configuration.refresh_delay %>
|
|
<div class="col-sm-1">
|
|
<%= link_to t('Refresh'), { action: :refresh }, class: %i(btn btn-default) %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<% @result.each do |host| %>
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<h2>
|
|
<%= rank_label host[:grade].to_sym %>
|
|
<%= host[:ip] %> : <%= host[:port] %>
|
|
<span class="small">(<%= host[:hostname] %>)</span></h2>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<table class="table table-bordered table-condensed table-striped center">
|
|
<thead>
|
|
<tr>
|
|
<th rowspan="2"><%= t 'Name' %></th>
|
|
<th rowspan="2"><%= t 'Key exchange' %></th>
|
|
<th rowspan="2"><%= t 'Authentication' %></th>
|
|
<th colspan="4"><%= t 'Encryption' %></th>
|
|
<th colspan="2"><%= t 'MAC' %></th>
|
|
<th rowspan="2"><%= t 'PFS' %></th>
|
|
</tr>
|
|
<tr>
|
|
<th><%= t 'Type' %></th>
|
|
<th><%= t 'Key size' %></th>
|
|
<th><%= t 'Block size' %></th>
|
|
<th><%= t 'Mode' %></th>
|
|
<th><%= t 'Type' %></th>
|
|
<th><%= t 'Size' %></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<%
|
|
handshakes = host[:handshakes]
|
|
all_ciphers = handshakes[:ciphers].group_by { |c| c[:protocol] }
|
|
CryptCheck::Tls::Method.each do |protocol|
|
|
ciphers = all_ciphers.fetch(protocol.to_sym.to_s, [])
|
|
.collect { |c| CryptCheck::Tls::Cipher.new protocol, c[:name] }.sort
|
|
unless ciphers.empty? %>
|
|
<tr>
|
|
<th colspan="12"><%= protocol_label protocol %></th>
|
|
</tr>
|
|
<% ciphers.each do |cipher|
|
|
kex = cipher.kex
|
|
auth = cipher.auth
|
|
enc = cipher.encryption
|
|
mac = cipher.hmac
|
|
pfs = cipher.pfs?
|
|
%>
|
|
<tr>
|
|
<th><%= cipher_name_label cipher %></th>
|
|
<%= cipher_kex_type_cell kex %>
|
|
<%= cipher_auth_type_cell auth %>
|
|
<%= cipher_enc_type_cell enc[0] %>
|
|
<%= cipher_enc_key_size_cell enc[1] %>
|
|
<%= cipher_enc_block_size_cell enc[2] %>
|
|
<%= cipher_enc_mode_cell enc[3] %>
|
|
<%= cipher_mac_type_cell mac[0] %>
|
|
<%= cipher_mac_size_cell mac[1] %>
|
|
<%= cipher_pfs_cell pfs %>
|
|
</tr>
|
|
<% end end end %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|