summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/net_internals
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-07 22:26:28 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-07 22:26:28 +0000
commitaf96412a25b8e0e177ee601c163caac007aecf0c (patch)
tree443780a78320336311f9ff928b976ab1643915d1 /chrome/browser/resources/net_internals
parent874d1080b7099789e2acf99f51f2672f257b72df (diff)
downloadchromium_src-af96412a25b8e0e177ee601c163caac007aecf0c.zip
chromium_src-af96412a25b8e0e177ee601c163caac007aecf0c.tar.gz
chromium_src-af96412a25b8e0e177ee601c163caac007aecf0c.tar.bz2
Add pretty printing on about:net-internals for the parameters of SSL_VERSION_FALLBACK.
BUG=126340 Review URL: https://chromiumcodereview.appspot.com/10473013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/net_internals')
-rw-r--r--chrome/browser/resources/net_internals/log_view_painter.js52
1 files changed, 52 insertions, 0 deletions
diff --git a/chrome/browser/resources/net_internals/log_view_painter.js b/chrome/browser/resources/net_internals/log_view_painter.js
index 63b3c14..05f429c 100644
--- a/chrome/browser/resources/net_internals/log_view_painter.js
+++ b/chrome/browser/resources/net_internals/log_view_painter.js
@@ -252,6 +252,9 @@ function getParamaterWriterForEventType(eventType) {
case LogEventType.CERT_VERIFIER_JOB:
case LogEventType.SSL_CERTIFICATES_RECEIVED:
return writeParamsForCertificates;
+
+ case LogEventType.SSL_VERSION_FALLBACK:
+ return writeParamsForSSLVersionFallback;
}
return null;
}
@@ -319,6 +322,34 @@ function getLoadFlagSymbolicString(loadFlag) {
}
/**
+ * Converts an SSL version number to a textual representation.
+ * For instance, SSLVersionNumberToName(0x0301) returns 'TLS 1.0'.
+ */
+function SSLVersionNumberToName(version) {
+ if ((version & 0xFFFF) != version) {
+ // If the version number is more than 2 bytes long something is wrong.
+ // Print it as hex.
+ return 'SSL 0x' + version.toString(16);
+ }
+
+ // See if it is a known TLS name.
+ var kTLSNames = {
+ 0x0301: 'TLS 1.0',
+ 0x0302: 'TLS 1.1',
+ 0x0303: 'TLS 1.2'
+ };
+ var name = kTLSNames[version];
+ if (name)
+ return name;
+
+ // Otherwise label it as an SSL version.
+ var major = (version & 0xFF00) >> 8;
+ var minor = version & 0x00FF;
+
+ return 'SSL ' + major + '.' + minor;
+}
+
+/**
* TODO(eroman): get rid of this, as it is only used by 1 callsite.
*
* Indent |lines| by |start|.
@@ -445,6 +476,27 @@ function writeParamsForCertificates(entry, out, consumedParams) {
consumedParams.certificates = true;
}
+/**
+ * Outputs the SSL version fallback parameters of |entry| to |out|.
+ */
+function writeParamsForSSLVersionFallback(entry, out, consumedParams) {
+ var params = entry.params;
+
+ if (typeof params.version_before != 'number' ||
+ typeof params.version_after != 'number') {
+ // Unrecognized params.
+ return;
+ }
+
+ var line = SSLVersionNumberToName(params.version_before) +
+ ' ==> ' +
+ SSLVersionNumberToName(params.version_after);
+ out.writeArrowIndentedLines([line]);
+
+ consumedParams.version_before = true;
+ consumedParams.version_after = true;
+}
+
function writeParamsForProxyConfigChanged(entry, out, consumedParams) {
var params = entry.params;