| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 610 if (security_info.security_bits > 0 && cipher_suite) { | 610 if (security_info.security_bits > 0 && cipher_suite) { |
| 611 int ssl_version = | 611 int ssl_version = |
| 612 net::SSLConnectionStatusToVersion(security_info.connection_status); | 612 net::SSLConnectionStatusToVersion(security_info.connection_status); |
| 613 const char* ssl_version_str; | 613 const char* ssl_version_str; |
| 614 net::SSLVersionToString(&ssl_version_str, ssl_version); | 614 net::SSLVersionToString(&ssl_version_str, ssl_version); |
| 615 site_connection_details_ += ASCIIToUTF16("\n\n"); | 615 site_connection_details_ += ASCIIToUTF16("\n\n"); |
| 616 site_connection_details_ += l10n_util::GetStringFUTF16( | 616 site_connection_details_ += l10n_util::GetStringFUTF16( |
| 617 IDS_PAGE_INFO_SECURITY_TAB_SSL_VERSION, | 617 IDS_PAGE_INFO_SECURITY_TAB_SSL_VERSION, |
| 618 ASCIIToUTF16(ssl_version_str)); | 618 ASCIIToUTF16(ssl_version_str)); |
| 619 | 619 |
| 620 bool no_renegotiation = | |
| 621 (security_info.connection_status & | |
| 622 net::SSL_CONNECTION_NO_RENEGOTIATION_EXTENSION) != 0; | |
| 623 const char *key_exchange, *cipher, *mac; | 620 const char *key_exchange, *cipher, *mac; |
| 624 bool is_aead, is_tls13; | 621 bool is_aead, is_tls13; |
| 625 net::SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, | 622 net::SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, |
| 626 &is_tls13, cipher_suite); | 623 &is_tls13, cipher_suite); |
| 627 | 624 |
| 628 site_connection_details_ += ASCIIToUTF16("\n\n"); | 625 site_connection_details_ += ASCIIToUTF16("\n\n"); |
| 629 if (is_aead) { | 626 if (is_aead) { |
| 630 if (is_tls13) { | 627 if (is_tls13) { |
| 631 // For TLS 1.3 ciphers, report the group (historically, curve) as the | 628 // For TLS 1.3 ciphers, report the group (historically, curve) as the |
| 632 // key exchange. | 629 // key exchange. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 643 site_connection_details_ += l10n_util::GetStringFUTF16( | 640 site_connection_details_ += l10n_util::GetStringFUTF16( |
| 644 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS, | 641 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS, |
| 645 ASCIIToUTF16(cipher), ASCIIToUTF16(mac), ASCIIToUTF16(key_exchange)); | 642 ASCIIToUTF16(cipher), ASCIIToUTF16(mac), ASCIIToUTF16(key_exchange)); |
| 646 } | 643 } |
| 647 | 644 |
| 648 if (ssl_version == net::SSL_CONNECTION_VERSION_SSL3 && | 645 if (ssl_version == net::SSL_CONNECTION_VERSION_SSL3 && |
| 649 site_connection_status_ < | 646 site_connection_status_ < |
| 650 SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE) { | 647 SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE) { |
| 651 site_connection_status_ = SITE_CONNECTION_STATUS_ENCRYPTED_ERROR; | 648 site_connection_status_ = SITE_CONNECTION_STATUS_ENCRYPTED_ERROR; |
| 652 } | 649 } |
| 653 | |
| 654 if (no_renegotiation) { | |
| 655 site_connection_details_ += ASCIIToUTF16("\n\n"); | |
| 656 site_connection_details_ += l10n_util::GetStringUTF16( | |
| 657 IDS_PAGE_INFO_SECURITY_TAB_RENEGOTIATION_MESSAGE); | |
| 658 } | |
| 659 } | 650 } |
| 660 | 651 |
| 661 // Check if a user decision has been made to allow or deny certificates with | 652 // Check if a user decision has been made to allow or deny certificates with |
| 662 // errors on this site. | 653 // errors on this site. |
| 663 ChromeSSLHostStateDelegate* delegate = | 654 ChromeSSLHostStateDelegate* delegate = |
| 664 ChromeSSLHostStateDelegateFactory::GetForProfile(profile_); | 655 ChromeSSLHostStateDelegateFactory::GetForProfile(profile_); |
| 665 DCHECK(delegate); | 656 DCHECK(delegate); |
| 666 // Only show an SSL decision revoke button if the user has chosen to bypass | 657 // Only show an SSL decision revoke button if the user has chosen to bypass |
| 667 // SSL host errors for this host in the past. | 658 // SSL host errors for this host in the past. |
| 668 show_ssl_decision_revoke_button_ = delegate->HasAllowException(url.host()); | 659 show_ssl_decision_revoke_button_ = delegate->HasAllowException(url.host()); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 info.connection_status = site_connection_status_; | 775 info.connection_status = site_connection_status_; |
| 785 info.connection_status_description = | 776 info.connection_status_description = |
| 786 UTF16ToUTF8(site_connection_details_); | 777 UTF16ToUTF8(site_connection_details_); |
| 787 info.identity_status = site_identity_status_; | 778 info.identity_status = site_identity_status_; |
| 788 info.identity_status_description = | 779 info.identity_status_description = |
| 789 UTF16ToUTF8(site_identity_details_); | 780 UTF16ToUTF8(site_identity_details_); |
| 790 info.certificate = certificate_; | 781 info.certificate = certificate_; |
| 791 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; | 782 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; |
| 792 ui_->SetIdentityInfo(info); | 783 ui_->SetIdentityInfo(info); |
| 793 } | 784 } |
| OLD | NEW |