Chromium Code Reviews| 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 544 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_ERROR : | 544 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_ERROR : |
| 545 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_WARNING))); | 545 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_WARNING))); |
| 546 } | 546 } |
| 547 } | 547 } |
| 548 | 548 |
| 549 uint16 cipher_suite = | 549 uint16 cipher_suite = |
| 550 net::SSLConnectionStatusToCipherSuite(ssl.connection_status); | 550 net::SSLConnectionStatusToCipherSuite(ssl.connection_status); |
| 551 if (ssl.security_bits > 0 && cipher_suite) { | 551 if (ssl.security_bits > 0 && cipher_suite) { |
| 552 int ssl_version = | 552 int ssl_version = |
| 553 net::SSLConnectionStatusToVersion(ssl.connection_status); | 553 net::SSLConnectionStatusToVersion(ssl.connection_status); |
| 554 const bool is_sslv3 = ssl_version == net::SSL_CONNECTION_VERSION_SSL3; | |
| 554 const char* ssl_version_str; | 555 const char* ssl_version_str; |
| 555 net::SSLVersionToString(&ssl_version_str, ssl_version); | 556 net::SSLVersionToString(&ssl_version_str, ssl_version); |
| 556 site_connection_details_ += ASCIIToUTF16("\n\n"); | 557 site_connection_details_ += ASCIIToUTF16("\n\n"); |
| 557 site_connection_details_ += l10n_util::GetStringFUTF16( | 558 site_connection_details_ += l10n_util::GetStringFUTF16( |
| 558 IDS_PAGE_INFO_SECURITY_TAB_SSL_VERSION, | 559 IDS_PAGE_INFO_SECURITY_TAB_SSL_VERSION, |
| 559 ASCIIToUTF16(ssl_version_str)); | 560 ASCIIToUTF16(ssl_version_str)); |
| 560 | 561 |
| 561 bool did_fallback = (ssl.connection_status & | |
| 562 net::SSL_CONNECTION_VERSION_FALLBACK) != 0; | |
| 563 bool no_renegotiation = | 562 bool no_renegotiation = |
| 564 (ssl.connection_status & | 563 (ssl.connection_status & |
| 565 net::SSL_CONNECTION_NO_RENEGOTIATION_EXTENSION) != 0; | 564 net::SSL_CONNECTION_NO_RENEGOTIATION_EXTENSION) != 0; |
| 566 const char *key_exchange, *cipher, *mac; | 565 const char *key_exchange, *cipher, *mac; |
| 567 bool is_aead; | 566 bool is_aead; |
| 568 net::SSLCipherSuiteToStrings( | 567 net::SSLCipherSuiteToStrings( |
| 569 &key_exchange, &cipher, &mac, &is_aead, cipher_suite); | 568 &key_exchange, &cipher, &mac, &is_aead, cipher_suite); |
| 570 | 569 |
| 571 site_connection_details_ += ASCIIToUTF16("\n\n"); | 570 site_connection_details_ += ASCIIToUTF16("\n\n"); |
| 572 if (is_aead) { | 571 if (is_aead) { |
| 573 site_connection_details_ += l10n_util::GetStringFUTF16( | 572 site_connection_details_ += l10n_util::GetStringFUTF16( |
| 574 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS_AEAD, | 573 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS_AEAD, |
| 575 ASCIIToUTF16(cipher), ASCIIToUTF16(key_exchange)); | 574 ASCIIToUTF16(cipher), ASCIIToUTF16(key_exchange)); |
| 576 } else { | 575 } else { |
| 577 site_connection_details_ += l10n_util::GetStringFUTF16( | 576 site_connection_details_ += l10n_util::GetStringFUTF16( |
| 578 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS, | 577 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS, |
| 579 ASCIIToUTF16(cipher), ASCIIToUTF16(mac), ASCIIToUTF16(key_exchange)); | 578 ASCIIToUTF16(cipher), ASCIIToUTF16(mac), ASCIIToUTF16(key_exchange)); |
| 580 } | 579 } |
| 581 | 580 |
| 582 if (did_fallback) { | 581 if (is_sslv3 && |
| 583 // For now, only SSLv3 fallback will trigger a warning icon. | 582 site_connection_status_ < SITE_CONNECTION_STATUS_MIXED_CONTENT) { |
| 584 if (site_connection_status_ < SITE_CONNECTION_STATUS_MIXED_CONTENT) | 583 site_connection_status_ = SITE_CONNECTION_STATUS_ENCRYPTED_ERROR; |
| 585 site_connection_status_ = SITE_CONNECTION_STATUS_MIXED_CONTENT; | 584 // No message because, if we are planning on removing SSLv3 in M40 then |
| 586 site_connection_details_ += ASCIIToUTF16("\n\n"); | 585 // there's no time to get a translation. |
|
Ryan Sleevi
2014/10/17 22:27:45
Comment nit: There's a weird comma splice here, bu
agl
2014/10/17 23:25:36
Done.
| |
| 587 site_connection_details_ += l10n_util::GetStringUTF16( | |
| 588 IDS_PAGE_INFO_SECURITY_TAB_FALLBACK_MESSAGE); | |
| 589 } | 586 } |
| 587 | |
| 590 if (no_renegotiation) { | 588 if (no_renegotiation) { |
| 591 site_connection_details_ += ASCIIToUTF16("\n\n"); | 589 site_connection_details_ += ASCIIToUTF16("\n\n"); |
| 592 site_connection_details_ += l10n_util::GetStringUTF16( | 590 site_connection_details_ += l10n_util::GetStringUTF16( |
| 593 IDS_PAGE_INFO_SECURITY_TAB_RENEGOTIATION_MESSAGE); | 591 IDS_PAGE_INFO_SECURITY_TAB_RENEGOTIATION_MESSAGE); |
| 594 } | 592 } |
| 595 } | 593 } |
| 596 | 594 |
| 597 // Check if a user decision has been made to allow or deny certificates with | 595 // Check if a user decision has been made to allow or deny certificates with |
| 598 // errors on this site. | 596 // errors on this site. |
| 599 ChromeSSLHostStateDelegate* delegate = | 597 ChromeSSLHostStateDelegate* delegate = |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 762 if (visited_before_today) { | 760 if (visited_before_today) { |
| 763 first_visit_text = l10n_util::GetStringFUTF16( | 761 first_visit_text = l10n_util::GetStringFUTF16( |
| 764 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY, | 762 IDS_PAGE_INFO_SECURITY_TAB_VISITED_BEFORE_TODAY, |
| 765 base::TimeFormatShortDate(first_visit)); | 763 base::TimeFormatShortDate(first_visit)); |
| 766 } else { | 764 } else { |
| 767 first_visit_text = l10n_util::GetStringUTF16( | 765 first_visit_text = l10n_util::GetStringUTF16( |
| 768 IDS_PAGE_INFO_SECURITY_TAB_FIRST_VISITED_TODAY); | 766 IDS_PAGE_INFO_SECURITY_TAB_FIRST_VISITED_TODAY); |
| 769 } | 767 } |
| 770 ui_->SetFirstVisit(first_visit_text); | 768 ui_->SetFirstVisit(first_visit_text); |
| 771 } | 769 } |
| OLD | NEW |