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.

suite.html.erb 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <div class="container">
  2. <div class="row">
  3. <div class="col-sm-12">
  4. <h1><%= t 'Cipher suite:' %> <%= @suite %></h1>
  5. </div>
  6. </div>
  7. <div class="row">
  8. <table class="table table-bordered table-condensed table-striped col-sm-12">
  9. <thead>
  10. <tr>
  11. <th rowspan="2"><%= t 'User agent' %></th>
  12. <th rowspan="2"><%= t 'Name' %></th>
  13. <th rowspan="2"><%= t 'Key exchange' %></th>
  14. <th rowspan="2"><%= t 'Authentication' %></th>
  15. <th colspan="4"><%= t 'Encryption' %></th>
  16. <th colspan="2"><%= t 'MAC' %></th>
  17. <th rowspan="2"><%= t 'PFS' %></th>
  18. </tr>
  19. <tr>
  20. <th><%= t 'Type' %></th>
  21. <th><%= t 'Key size' %></th>
  22. <th><%= t 'Block size' %></th>
  23. <th><%= t 'Mode' %></th>
  24. <th><%= t 'Type' %></th>
  25. <th><%= t 'Size' %></th>
  26. </tr>
  27. </thead>
  28. <tbody>
  29. <%
  30. iana_ciphers = Hash[@ciphers.collect { |c| [Rails.application.config.openssl_ciphers[c.name], c] }]
  31. Rails.application.config.user_agents_ciphers.each do |ua, support|
  32. cipher = (support['ciphers'].collect(&:first) & iana_ciphers.keys).first
  33. if cipher
  34. cipher = iana_ciphers[cipher]
  35. params = cipher.params
  36. kex = params[:kex]
  37. auth = params[:auth]
  38. enc = params[:enc]
  39. mac = params[:mac]
  40. pfs = params[:pfs]
  41. end
  42. %>
  43. <tr>
  44. <th><%= ua %></th>
  45. <% if cipher %>
  46. <th><%= cipher_name_label cipher %></th>
  47. <%= cipher_kex_type_cell kex&.first %>
  48. <%= cipher_auth_type_cell auth&.first %>
  49. <%= cipher_enc_type_cell enc&.first %>
  50. <%= cipher_enc_key_size_cell enc&.[] 1 %>
  51. <%= cipher_enc_block_size_cell enc&.[] 2 %>
  52. <%= cipher_enc_mode_cell enc&.last %>
  53. <%= cipher_mac_type_cell mac&.first %>
  54. <%= cipher_mac_size_cell mac&.last %>
  55. <%= cipher_pfs_cell pfs %>
  56. <% else %>
  57. <td colspan="10"><%= label('Non supporté', :error) %></td>
  58. <% end %>
  59. </tr>
  60. <% end %>
  61. </tbody>
  62. </table>
  63. </div>
  64. <br/>
  65. <div class="row">
  66. <table class="table table-bordered table-condensed table-striped center col-sm-12">
  67. <thead>
  68. <tr>
  69. <th rowspan="2"><%= t 'Name' %></th>
  70. <th rowspan="2"><%= t 'Key exchange' %></th>
  71. <th rowspan="2"><%= t 'Authentication' %></th>
  72. <th colspan="4"><%= t 'Encryption' %></th>
  73. <th colspan="2"><%= t 'MAC' %></th>
  74. <th rowspan="2"><%= t 'PFS' %></th>
  75. </tr>
  76. <tr>
  77. <th><%= t 'Type' %></th>
  78. <th><%= t 'Key size' %></th>
  79. <th><%= t 'Block size' %></th>
  80. <th><%= t 'Mode' %></th>
  81. <th><%= t 'Type' %></th>
  82. <th><%= t 'Size' %></th>
  83. </tr>
  84. </thead>
  85. <tbody>
  86. <% @ciphers.each do |cipher|
  87. params = cipher.params
  88. kex = params[:kex]
  89. auth = params[:auth]
  90. enc = params[:enc]
  91. mac = params[:mac]
  92. pfs = params[:pfs]
  93. %>
  94. <tr>
  95. <th><%= cipher_name_label cipher %></th>
  96. <%= cipher_kex_type_cell kex&.first %>
  97. <%= cipher_auth_type_cell auth&.first %>
  98. <%= cipher_enc_type_cell enc&.first %>
  99. <%= cipher_enc_key_size_cell enc&.[] 1 %>
  100. <%= cipher_enc_block_size_cell enc&.[] 2 %>
  101. <%= cipher_enc_mode_cell enc&.last %>
  102. <%= cipher_mac_type_cell mac&.first %>
  103. <%= cipher_mac_size_cell mac&.last %>
  104. <%= cipher_pfs_cell pfs %>
  105. </tr>
  106. <% end %>
  107. </tbody>
  108. </table>
  109. </div>
  110. </div>