From 228d252ab14f65f8433c8d53122a7d1e9429c23e Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Thu, 1 Mar 2018 09:02:37 +0100 Subject: DevTools - network - security (improvements) https://github.com/MoonchildProductions/moebius/pull/113 https://github.com/MoonchildProductions/moebius/pull/118 https://github.com/MoonchildProductions/moebius/pull/127 --- .../client/locales/en-US/netmonitor.properties | 31 ++++++++++++++++++++++ devtools/client/netmonitor/netmonitor-view.js | 2 ++ devtools/client/netmonitor/netmonitor.xul | 20 ++++++++++++++ .../test/browser_net_security-details.js | 4 +++ devtools/shared/webconsole/network-helper.js | 27 +++++++++++++++++++ 5 files changed, 84 insertions(+) (limited to 'devtools') diff --git a/devtools/client/locales/en-US/netmonitor.properties b/devtools/client/locales/en-US/netmonitor.properties index f07f38907..1f6f671c9 100644 --- a/devtools/client/locales/en-US/netmonitor.properties +++ b/devtools/client/locales/en-US/netmonitor.properties @@ -617,6 +617,37 @@ netmonitor.security.protocolVersion=Protocol version: # in the security tab describing the cipher suite used to secure this connection. netmonitor.security.cipherSuite=Cipher suite: +# LOCALIZATION NOTE (netmonitor.security.keaGroup): This is the label displayed +# in the security tab describing the key exchange group suite used to secure +# this connection. +netmonitor.security.keaGroup=Key Exchange Group: + +# LOCALIZATION NOTE (netmonitor.security.keaGroup.none): This is the label +# displayed in the security tab describing the case when no group was used. +netmonitor.security.keaGroup.none=none + +# LOCALIZATION NOTE (netmonitor.security.keaGroup.custom): This is the label +# displayed in the security tab describing the case when a custom group was used. +netmonitor.security.keaGroup.custom=custom + +# LOCALIZATION NOTE (netmonitor.security.keaGroup.unknown): This is the value +# displayed in the security tab describing an unknown group. +netmonitor.security.keaGroup.unknown=unknown group + +# LOCALIZATION NOTE (netmonitor.security.signatureScheme): This is the label +# displayed in the security tab describing the signature scheme used by for +# the server certificate in this connection. +netmonitor.security.signatureScheme=Signature Scheme: + +# LOCALIZATION NOTE (netmonitor.security.signatureScheme.none): This is the +# label displayed in the security tab describing the case when no signature +# was used. +netmonitor.security.signatureScheme.none=none + +# LOCALIZATION NOTE (netmonitor.security.signatureScheme.unknown): This is the +# value displayed in the security tab describing an unknown signature scheme. +netmonitor.security.signatureScheme.unknown=unknown signature scheme + # LOCALIZATION NOTE (netmonitor.security.hsts): This is the label displayed # in the security tab describing the usage of HTTP Strict Transport Security. netmonitor.security.hsts=HTTP Strict Transport Security: diff --git a/devtools/client/netmonitor/netmonitor-view.js b/devtools/client/netmonitor/netmonitor-view.js index 1f957db1b..19dd96ff1 100644 --- a/devtools/client/netmonitor/netmonitor-view.js +++ b/devtools/client/netmonitor/netmonitor-view.js @@ -1124,6 +1124,8 @@ NetworkDetailsView.prototype = { setValue("#security-protocol-version-value", securityInfo.protocolVersion); setValue("#security-ciphersuite-value", securityInfo.cipherSuite); + setValue("#security-keagroup-value", securityInfo.keaGroupName); + setValue("#security-signaturescheme-value", securityInfo.signatureSchemeName); // Host header let domain = getUriHostPort(url); diff --git a/devtools/client/netmonitor/netmonitor.xul b/devtools/client/netmonitor/netmonitor.xul index 8a0c60389..117ecf261 100644 --- a/devtools/client/netmonitor/netmonitor.xul +++ b/devtools/client/netmonitor/netmonitor.xul @@ -550,6 +550,26 @@ id="security-warning-cipher" data-localization="tooltiptext=netmonitor.security.warning.cipher" /> + + + + "); + // These two values can change. So only check they're not empty. + checkLabelNotEmpty("#security-keagroup-value"); + checkLabelNotEmpty("#security-signaturescheme-value"); + // Locale sensitive and varies between timezones. Cant't compare equality or // the test fails depending on which part of the world the test is executed. checkLabelNotEmpty("#security-cert-validity-begins"); diff --git a/devtools/shared/webconsole/network-helper.js b/devtools/shared/webconsole/network-helper.js index af6a2e55b..4e25fac26 100644 --- a/devtools/shared/webconsole/network-helper.js +++ b/devtools/shared/webconsole/network-helper.js @@ -63,6 +63,8 @@ const {components, Cc, Ci} = require("chrome"); loader.lazyImporter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm"); const DevToolsUtils = require("devtools/shared/DevToolsUtils"); const Services = require("Services"); +const { LocalizationHelper } = require("devtools/shared/l10n"); +const L10N = new LocalizationHelper("devtools/client/locales/netmonitor.properties"); // The cache used in the `nsIURL` function. const gNSURLStore = new Map(); @@ -620,6 +622,31 @@ var NetworkHelper = { // Cipher suite. info.cipherSuite = SSLStatus.cipherName; + // Key exchange group name. + info.keaGroupName = SSLStatus.keaGroupName; + // Localise two special values. + if (info.keaGroupName == "none") { + info.keaGroupName = L10N.getStr("netmonitor.security.keaGroup.none"); + } + if (info.keaGroupName == "custom") { + info.keaGroupName = L10N.getStr("netmonitor.security.keaGroup.custom"); + } + if (info.keaGroupName == "unknown group") { + info.keaGroupName = L10N.getStr("netmonitor.security.keaGroup.unknown"); + } + + // Certificate signature scheme. + info.signatureSchemeName = SSLStatus.signatureSchemeName; + // Localise two special values. + if (info.signatureSchemeName == "none") { + info.signatureSchemeName = + L10N.getStr("netmonitor.security.signatureScheme.none"); + } + if (info.signatureSchemeName == "unknown signature") { + info.signatureSchemeName = + L10N.getStr("netmonitor.security.signatureScheme.unknown"); + } + // Protocol version. info.protocolVersion = this.formatSecurityProtocol(SSLStatus.protocolVersion); -- cgit v1.2.3