Bug 886752 - Show TLS/SSL version in page info dialog. r=dao
authorTom Schuster <evilpies@gmail.com>
Fri, 24 Oct 2014 13:53:35 +0200
changeset 212228 128fd9cbc29bcec8e325ad247dfebe569bdc8a65
parent 212227 eaaa68a7c2d8085969f5f15304b790bbf992ff63
child 212229 21b64777a90ea279fc658e780dad193bebb297b8
push id27702
push userkwierso@gmail.com
push dateFri, 24 Oct 2014 22:05:50 +0000
treeherdermozilla-central@c70f62375f7d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs886752
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 886752 - Show TLS/SSL version in page info dialog. r=dao
browser/base/content/pageinfo/security.js
security/manager/locales/en-US/chrome/pippki/pippki.properties
--- a/browser/base/content/pageinfo/security.js
+++ b/browser/base/content/pageinfo/security.js
@@ -47,40 +47,59 @@ var security = {
       var issuerName =
         this.mapIssuerOrganization(cert.issuerOrganization) || cert.issuerName;
 
       var retval = {
         hostName : hName,
         cAName : issuerName,
         encryptionAlgorithm : undefined,
         encryptionStrength : undefined,
+        version: undefined,
         isBroken : isBroken,
         isEV : isEV,
         cert : cert,
         fullLocation : gWindow.location
       };
 
+      var version;
       try {
         retval.encryptionAlgorithm = status.cipherName;
         retval.encryptionStrength = status.secretKeyLength;
+        version = status.protocolVersion;
       }
       catch (e) {
       }
 
+      switch (version) {
+        case nsISSLStatus.SSL_VERSION_3:
+          retval.version = "SSL 3";
+          break;
+        case nsISSLStatus.TLS_VERSION_1:
+          retval.version = "TLS 1.0";
+          break;
+        case nsISSLStatus.TLS_VERSION_1_1:
+          retval.version = "TLS 1.1";
+          break;
+        case nsISSLStatus.TLS_VERSION_1_2:
+          retval.version = "TLS 1.2"
+          break;
+      }
+
       return retval;
     } else {
       return {
         hostName : hName,
         cAName : "",
         encryptionAlgorithm : "",
         encryptionStrength : 0,
+        version: "",
         isBroken : isBroken,
         isEV : isEV,
         cert : null,
-        fullLocation : gWindow.location        
+        fullLocation : gWindow.location
       };
     }
   },
 
   // Find the secureBrowserUI object (if present)
   _getSecurityUI : function() {
     if (window.opener.gBrowser)
       return window.opener.gBrowser.securityUI;
@@ -234,25 +253,29 @@ function securityOnLoad() {
   var msg2;
 
   if (info.isBroken) {
     hdr = pkiBundle.getString("pageInfo_MixedContent");
     msg1 = pkiBundle.getString("pageInfo_Privacy_Mixed1");
     msg2 = pkiBundle.getString("pageInfo_Privacy_None2");
   }
   else if (info.encryptionStrength >= 90) {
-    hdr = pkiBundle.getFormattedString("pageInfo_StrongEncryptionWithBits",
-                                       [info.encryptionAlgorithm, info.encryptionStrength + ""]);
+    hdr = pkiBundle.getFormattedString("pageInfo_StrongEncryptionWithBitsAndProtocol",
+                                       [info.encryptionAlgorithm,
+                                        info.encryptionStrength + "",
+                                        info.version]);
     msg1 = pkiBundle.getString("pageInfo_Privacy_Strong1");
     msg2 = pkiBundle.getString("pageInfo_Privacy_Strong2");
     security._cert = info.cert;
   }
   else if (info.encryptionStrength > 0) {
-    hdr  = pkiBundle.getFormattedString("pageInfo_WeakEncryptionWithBits",
-                                        [info.encryptionAlgorithm, info.encryptionStrength + ""]);
+    hdr  = pkiBundle.getFormattedString("pageInfo_WeakEncryptionWithBitsAndProtocol",
+                                        [info.encryptionAlgorithm,
+                                         info.encryptionStrength + "",
+                                         info.version]);
     msg1 = pkiBundle.getFormattedString("pageInfo_Privacy_Weak1", [info.hostName]);
     msg2 = pkiBundle.getString("pageInfo_Privacy_Weak2");
   }
   else {
     hdr = pkiBundle.getString("pageInfo_NoEncryption");
     if (info.hostName != null)
       msg1 = pkiBundle.getFormattedString("pageInfo_Privacy_None1", [info.hostName]);
     else
--- a/security/manager/locales/en-US/chrome/pippki/pippki.properties
+++ b/security/manager/locales/en-US/chrome/pippki/pippki.properties
@@ -68,24 +68,26 @@ clientAuthMessage2=Issued Under: "%S"
 pageInfo_SiteNotVerified=Website Identity Not Verified
 pageInfo_WebSiteVerified=Website Identity Verified
 pageInfo_Identity_Verified=The website %S supports authentication for the page you are viewing. The identity of this website has been verified by %S, a certificate authority you trust for this purpose.
 pageInfo_ViewCertificate=View the security certificate that verifies this website's identity.
 pageInfo_NoEncryption=Connection Not Encrypted
 pageInfo_Privacy_None1=The website %S does not support encryption for the page you are viewing.
 pageInfo_Privacy_None2=Information sent over the Internet without encryption can be seen by other people while it is in transit. 
 pageInfo_Privacy_None3=The page you are viewing is not encrypted.
-# LOCALIZATION NOTE (pageInfo_StrongEncryptionWithBits): %1$S is the name of the encryption standard,
+# LOCALIZATION NOTE (pageInfo_StrongEncryptionWithBitsAndProtocol): %1$S is the name of the encryption standard,
 # %2$S is the key size of the cipher.
-pageInfo_StrongEncryptionWithBits=Connection Encrypted: High-grade Encryption (%1$S, %2$S bit keys)
+# %3$S is protocol version like "SSL 3" or "TLS 1.2"
+pageInfo_StrongEncryptionWithBitsAndProtocol=Connection Encrypted: High-grade Encryption (%1$S, %2$S bit keys, %3$S)
 pageInfo_Privacy_Strong1=The page you are viewing was encrypted before being transmitted over the Internet.
 pageInfo_Privacy_Strong2=Encryption makes it very difficult for unauthorized people to view information traveling between computers. It is therefore very unlikely that anyone read this page as it traveled across the network.
 # LOCALIZATION NOTE (pageInfo_WeakEncryptionWithBits): %1$S is the name of the encryption standard,
 # %2$S is the key size of the cipher.
-pageInfo_WeakEncryptionWithBits=Connection Encrypted: Low-grade Encryption (%1$S, %2$S bit keys)
+# %3$S is protocol version like "SSL 3" or "TLS 1.2"
+pageInfo_WeakEncryptionWithBitsAndProtocol=Connection Encrypted: Low-grade Encryption (%1$S, %2$S bit keys, %3$S)
 pageInfo_Privacy_Weak1=The website %S is using low-grade encryption for the page you are viewing.
 pageInfo_Privacy_Weak2=Low-grade encryption may allow some unauthorized people to view this information.
 pageInfo_MixedContent=Connection Partially Encrypted
 pageInfo_Privacy_Mixed1=Parts of the page you are viewing were not encrypted before being transmitted over the Internet.
 
 #Cert Viewer
 certDetails=Certificate Viewer:
 notPresent=<Not Part Of Certificate>