Skip to content

Commit

Permalink
better helps
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Apr 30, 2014
1 parent 4cf3eb0 commit 4968bd0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
22 changes: 11 additions & 11 deletions src/data/registration/certificate_summary.erb
Expand Up @@ -12,20 +12,20 @@ textdomain "registration"
<%= _("Error: %s") % h(Storage::SSLErrors.instance.ssl_error_msg) %>
</p>

<h3><%= _("Certificate Details") %></h3>
<h3><%= _("Failed Certificate Details") %></h3>

<h4><%= _("Issued To") %></h4>
<blockquote>
<p>
<% # %s is SSL certificate issuer identification
%>
<%= _("<b>Common Name (CN):</b> %s") % h(find_name_attribute(@subject, "CN")) %><br>
<b><%= _("Common Name (CN):") %></b> <%= h(find_name_attribute(@subject, "CN")) %><br>
<% # %s is SSL certificate issuer identification
%>
<%= _("<b>Organization (O):</b> %s") % h(find_name_attribute(@subject, "O")) %><br>
<b><%= _("Organization (O):") %></b> <%= h(find_name_attribute(@subject, "O")) %><br>
<% # %s is SSL certificate issuer identification
%>
<%= _("<b>Organization Unit (OU):</b> %s") % h(find_name_attribute(@subject, "OU")) %>
<b><%= _("Organization Unit (OU):") %></b> <%= h(find_name_attribute(@subject, "OU")) %>
</p>
</blockquote>

Expand All @@ -34,13 +34,13 @@ textdomain "registration"
<p>
<% # %s is SSL certificate issuer identification
%>
<%= _("<b>Common Name (CN):</b> %s") % h(find_name_attribute(@issuer, "CN")) %><br>
<b><%= _("Common Name (CN):") %></b> <%= h(find_name_attribute(@issuer, "CN")) %><br>
<% # %s is SSL certificate issuer identification
%>
<%= _("<b>Organization (O):</b> %s") % h(find_name_attribute(@issuer, "O")) %><br>
<b><%= _("Organization (O):") %></b> <%= h(find_name_attribute(@issuer, "O")) %><br>
<% # %s is SSL certificate issuer identification
%>
<%= _("<b>Organization Unit (OU):</b> %s") % h(find_name_attribute(@issuer, "OU")) %>
<b><%= _("Organization Unit (OU):") %></b> <%= h(find_name_attribute(@issuer, "OU")) %>
</p>
</blockquote>

Expand All @@ -49,10 +49,10 @@ textdomain "registration"
<p>
<% # %s is date
%>
<%= _("<b>Issued On:</b> %s") % h(@certificate.not_before.localtime.strftime("%F")) %><br>
<b><%= _("Issued On:") %></b> <%= h(@certificate.not_before.localtime.strftime("%F")) %><br>
<% # %s is date
%>
<%= _("<b>Expires On:</b> %s") % h(@certificate.not_after.localtime.strftime("%F")) %><br>
<b><%= _("Expires On:") %></b> <%= h(@certificate.not_after.localtime.strftime("%F")) %><br>
<% if true || Time.now > @certificate.not_after %>
<% # warning added after the certificate expiration date
# if the certificate has expired
Expand All @@ -64,9 +64,9 @@ textdomain "registration"
</blockquote>

<p>
<%= _("<b>Serial Number:</b> %s") % @certificate.serial.to_s(16).scan(/../).join(":") %><br>
<b><%= _("Serial Number:") %></b> <%= h(@certificate.serial.to_s(16).scan(/../).join(":")) %><br>

<% # %s is SHA1 sum in HEX format, e.g. AB:CD:00:42:FF...
%>
<%= _("<b>SHA1 Fingerprint:</b> %s") % OpenSSL::Digest::SHA1.new(@certificate.to_der).to_s.upcase.scan(/../).join(':') %>
<b><%= _("SHA1 Fingerprint:") %></b> <%= h(OpenSSL::Digest::SHA1.new(@certificate.to_der).to_s.upcase.scan(/../).join(':')) %>
</p>
28 changes: 15 additions & 13 deletions src/lib/registration/ui/import_certificate_dialog.rb
Expand Up @@ -90,25 +90,27 @@ def certificate_description
end

def warning_text
# additional Richtext (HTML) warning text (kind of help) (1/2)
_("<p>Secure connection (HTTPS) uses SSL certificates to verify the authenticity " \
"of the server and for encrypting the transferred data.</p>") +
# help text for importing a SSL certificate (1/5)
_("<p>Secure connection (HTTPS) uses SSL certificates for verifying the " \
"authenticity of the server and for encrypting the transferred data.</p>") +

# additional Richtext (HTML) warning text (kind of help) (2/2)
# help text for importing a SSL certificate (2/5)
_("<p>You can choose to import the certificate it into the list of known " \
"certificate autohorities (CA), meaning that you trust the subject " \
"and the issuer of the certificate.</p>") +

# additional Richtext (HTML) warning text (kind of help) (2/2)
_("<p>Importing the certificate into the list of trusted certificates " \
"allows the registration client to verify the authenticity of " \
"the server if the server certificate was not issued by a well " \
"known certification autority (known by the system).</p>") +
# help text for importing a SSL certificate (3/5)
_("<p>Importing a certificate will allow to use for example a " \
"self-signed certificate.</p>") +

# additional Richtext (HTML) warning text (kind of help) (2/2)
_("<p><b>Important:</b> You should verify SHA1 fingerprint of the certificate " \
"to be sure you import the right certificate. Importing an unknown " \
"certificate without verification is a security risk.</p>")
# help text for importing a SSL certificate (4/5)
_("<p><b>Important:</b> You should verify SHA1 fingerprint of the " \
"certificate to be sure you import the right certificate from " \
"the requested server.</p>") +

# help text for importing a SSL certificate (5/5)
_("<p><b>Importing an unknown certificate without " \
"verification is a big security risk.</b></p>")
end

# @param x509_name [OpenSSL::X509::Name] name object
Expand Down

0 comments on commit 4968bd0

Please sign in to comment.