| 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 #include "chrome/browser/ui/website_settings/website_settings.h" | 5 #include "chrome/browser/ui/website_settings/website_settings.h" |
| 6 | 6 |
| 7 #include <openssl/ssl.h> |
| 7 #include <stddef.h> | 8 #include <stddef.h> |
| 8 #include <stdint.h> | 9 #include <stdint.h> |
| 9 | 10 |
| 10 #include <string> | 11 #include <string> |
| 11 #include <vector> | 12 #include <vector> |
| 12 | 13 |
| 13 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 14 #include "base/i18n/time_formatting.h" | 15 #include "base/i18n/time_formatting.h" |
| 15 #include "base/macros.h" | 16 #include "base/macros.h" |
| 16 #include "base/metrics/field_trial.h" | 17 #include "base/metrics/field_trial.h" |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 net::SSLVersionToString(&ssl_version_str, ssl_version); | 632 net::SSLVersionToString(&ssl_version_str, ssl_version); |
| 632 site_connection_details_ += ASCIIToUTF16("\n\n"); | 633 site_connection_details_ += ASCIIToUTF16("\n\n"); |
| 633 site_connection_details_ += l10n_util::GetStringFUTF16( | 634 site_connection_details_ += l10n_util::GetStringFUTF16( |
| 634 IDS_PAGE_INFO_SECURITY_TAB_SSL_VERSION, | 635 IDS_PAGE_INFO_SECURITY_TAB_SSL_VERSION, |
| 635 ASCIIToUTF16(ssl_version_str)); | 636 ASCIIToUTF16(ssl_version_str)); |
| 636 | 637 |
| 637 bool no_renegotiation = | 638 bool no_renegotiation = |
| 638 (security_info.connection_status & | 639 (security_info.connection_status & |
| 639 net::SSL_CONNECTION_NO_RENEGOTIATION_EXTENSION) != 0; | 640 net::SSL_CONNECTION_NO_RENEGOTIATION_EXTENSION) != 0; |
| 640 const char *key_exchange, *cipher, *mac; | 641 const char *key_exchange, *cipher, *mac; |
| 641 bool is_aead; | 642 bool is_aead, is_tls13; |
| 642 net::SSLCipherSuiteToStrings( | 643 net::SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, |
| 643 &key_exchange, &cipher, &mac, &is_aead, cipher_suite); | 644 &is_tls13, cipher_suite); |
| 644 | 645 |
| 645 site_connection_details_ += ASCIIToUTF16("\n\n"); | 646 site_connection_details_ += ASCIIToUTF16("\n\n"); |
| 646 if (is_aead) { | 647 if (is_aead) { |
| 648 if (is_tls13) { |
| 649 // For TLS 1.3 ciphers, report the group (historically, curve) as the |
| 650 // key exchange. |
| 651 key_exchange = SSL_get_curve_name(security_info.key_exchange_group); |
| 652 if (!key_exchange) { |
| 653 NOTREACHED(); |
| 654 key_exchange = ""; |
| 655 } |
| 656 } |
| 647 site_connection_details_ += l10n_util::GetStringFUTF16( | 657 site_connection_details_ += l10n_util::GetStringFUTF16( |
| 648 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS_AEAD, | 658 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS_AEAD, |
| 649 ASCIIToUTF16(cipher), ASCIIToUTF16(key_exchange)); | 659 ASCIIToUTF16(cipher), ASCIIToUTF16(key_exchange)); |
| 650 } else { | 660 } else { |
| 651 site_connection_details_ += l10n_util::GetStringFUTF16( | 661 site_connection_details_ += l10n_util::GetStringFUTF16( |
| 652 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS, | 662 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS, |
| 653 ASCIIToUTF16(cipher), ASCIIToUTF16(mac), ASCIIToUTF16(key_exchange)); | 663 ASCIIToUTF16(cipher), ASCIIToUTF16(mac), ASCIIToUTF16(key_exchange)); |
| 654 } | 664 } |
| 655 | 665 |
| 656 if (ssl_version == net::SSL_CONNECTION_VERSION_SSL3 && | 666 if (ssl_version == net::SSL_CONNECTION_VERSION_SSL3 && |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 798 info.connection_status = site_connection_status_; | 808 info.connection_status = site_connection_status_; |
| 799 info.connection_status_description = | 809 info.connection_status_description = |
| 800 UTF16ToUTF8(site_connection_details_); | 810 UTF16ToUTF8(site_connection_details_); |
| 801 info.identity_status = site_identity_status_; | 811 info.identity_status = site_identity_status_; |
| 802 info.identity_status_description = | 812 info.identity_status_description = |
| 803 UTF16ToUTF8(site_identity_details_); | 813 UTF16ToUTF8(site_identity_details_); |
| 804 info.certificate = certificate_; | 814 info.certificate = certificate_; |
| 805 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; | 815 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; |
| 806 ui_->SetIdentityInfo(info); | 816 ui_->SetIdentityInfo(info); |
| 807 } | 817 } |
| OLD | NEW |