OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // TODO(eroman): put these methods into a namespace. | 5 // TODO(eroman): put these methods into a namespace. |
6 | 6 |
7 var createLogEntryTablePrinter; | 7 var createLogEntryTablePrinter; |
8 var proxySettingsToString; | 8 var proxySettingsToString; |
9 var stripPrivacyInfo; | 9 var stripPrivacyInfo; |
10 | 10 |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
282 return writeParamsForRequestHeaders; | 282 return writeParamsForRequestHeaders; |
283 | 283 |
284 case EventType.PROXY_CONFIG_CHANGED: | 284 case EventType.PROXY_CONFIG_CHANGED: |
285 return writeParamsForProxyConfigChanged; | 285 return writeParamsForProxyConfigChanged; |
286 | 286 |
287 case EventType.CERT_VERIFIER_JOB: | 287 case EventType.CERT_VERIFIER_JOB: |
288 case EventType.SSL_CERTIFICATES_RECEIVED: | 288 case EventType.SSL_CERTIFICATES_RECEIVED: |
289 return writeParamsForCertificates; | 289 return writeParamsForCertificates; |
290 case EventType.EV_CERT_CT_COMPLIANCE_CHECKED: | 290 case EventType.EV_CERT_CT_COMPLIANCE_CHECKED: |
291 return writeParamsForCheckedEVCertificates; | 291 return writeParamsForCheckedEVCertificates; |
292 | |
293 case EventType.SSL_VERSION_FALLBACK: | |
294 return writeParamsForSSLVersionFallback; | |
295 } | 292 } |
296 return null; | 293 return null; |
297 } | 294 } |
298 | 295 |
299 /** | 296 /** |
300 * Default parameter writer that outputs a visualization of field named |key| | 297 * Default parameter writer that outputs a visualization of field named |key| |
301 * with value |value| to |out|. | 298 * with value |value| to |out|. |
302 */ | 299 */ |
303 function defaultWriteParameter(key, value, out) { | 300 function defaultWriteParameter(key, value, out) { |
304 if (key == 'headers' && value instanceof Array) { | 301 if (key == 'headers' && value instanceof Array) { |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
400 if (matchingFlagNames.length == 0) | 397 if (matchingFlagNames.length == 0) |
401 return zeroName; | 398 return zeroName; |
402 | 399 |
403 return matchingFlagNames.join(' | '); | 400 return matchingFlagNames.join(' | '); |
404 } | 401 } |
405 | 402 |
406 /** | 403 /** |
407 * Converts an SSL version number to a textual representation. | 404 * Converts an SSL version number to a textual representation. |
408 * For instance, SSLVersionNumberToName(0x0301) returns 'TLS 1.0'. | 405 * For instance, SSLVersionNumberToName(0x0301) returns 'TLS 1.0'. |
409 */ | 406 */ |
410 function SSLVersionNumberToName(version) { | 407 function SSLVersionNumberToName(version) { |
eroman
2016/06/24 19:19:44
If you are going to delete the specific formatter
davidben
2016/06/24 19:26:18
Done. I put it in the event list since it seems I
eroman
2016/06/24 19:42:00
Actually I was envisioning the deprecation solely
davidben
2016/06/27 19:27:44
From talking offline, it seems there were all kind
eroman
2016/06/27 19:31:28
Up to you, I don't feel too strongly about it.
davidben
2016/06/27 19:38:48
Alright. I'll go land this as-is then and then ass
| |
411 if ((version & 0xFFFF) != version) { | 408 if ((version & 0xFFFF) != version) { |
412 // If the version number is more than 2 bytes long something is wrong. | 409 // If the version number is more than 2 bytes long something is wrong. |
413 // Print it as hex. | 410 // Print it as hex. |
414 return 'SSL 0x' + version.toString(16); | 411 return 'SSL 0x' + version.toString(16); |
415 } | 412 } |
416 | 413 |
417 // See if it is a known TLS name. | 414 // See if it is a known TLS name. |
418 var kTLSNames = { | 415 var kTLSNames = { |
419 0x0301: 'TLS 1.0', | 416 0x0301: 'TLS 1.0', |
420 0x0302: 'TLS 1.1', | 417 0x0302: 'TLS 1.1', |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
649 } | 646 } |
650 | 647 |
651 } | 648 } |
652 | 649 |
653 function writeParamsForCheckedEVCertificates(entry, out, consumedParams) { | 650 function writeParamsForCheckedEVCertificates(entry, out, consumedParams) { |
654 if (typeof(entry.params.certificate) == 'object') | 651 if (typeof(entry.params.certificate) == 'object') |
655 writeCertificateParam( | 652 writeCertificateParam( |
656 entry.params.certificate, out, consumedParams, 'certificate'); | 653 entry.params.certificate, out, consumedParams, 'certificate'); |
657 } | 654 } |
658 | 655 |
659 /** | |
660 * Outputs the SSL version fallback parameters of |entry| to |out|. | |
661 */ | |
662 function writeParamsForSSLVersionFallback(entry, out, consumedParams) { | |
663 var params = entry.params; | |
664 | |
665 if (typeof params.version_before != 'number' || | |
666 typeof params.version_after != 'number') { | |
667 // Unrecognized params. | |
668 return; | |
669 } | |
670 | |
671 var line = SSLVersionNumberToName(params.version_before) + | |
672 ' ==> ' + | |
673 SSLVersionNumberToName(params.version_after); | |
674 out.writeArrowIndentedLines([line]); | |
675 | |
676 consumedParams.version_before = true; | |
677 consumedParams.version_after = true; | |
678 } | |
679 | |
680 function writeParamsForProxyConfigChanged(entry, out, consumedParams) { | 656 function writeParamsForProxyConfigChanged(entry, out, consumedParams) { |
681 var params = entry.params; | 657 var params = entry.params; |
682 | 658 |
683 if (typeof params.new_config != 'object') { | 659 if (typeof params.new_config != 'object') { |
684 // Unrecognized params. | 660 // Unrecognized params. |
685 return; | 661 return; |
686 } | 662 } |
687 | 663 |
688 if (typeof params.old_config == 'object') { | 664 if (typeof params.old_config == 'object') { |
689 var oldConfigString = proxySettingsToString(params.old_config); | 665 var oldConfigString = proxySettingsToString(params.old_config); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
802 } | 778 } |
803 | 779 |
804 if (config.source != undefined && config.source != 'UNKNOWN') | 780 if (config.source != undefined && config.source != 'UNKNOWN') |
805 result.push('Source: ' + config.source); | 781 result.push('Source: ' + config.source); |
806 | 782 |
807 return result.join('\n'); | 783 return result.join('\n'); |
808 }; | 784 }; |
809 | 785 |
810 // End of anonymous namespace. | 786 // End of anonymous namespace. |
811 })(); | 787 })(); |
OLD | NEW |