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/ssl/ssl_blocking_page.h" | 5 #include "chrome/browser/ssl/ssl_blocking_page.h" |
6 | 6 |
7 #include "base/build_time.h" | 7 #include "base/build_time.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
504 help_string = IDS_SSL_NONOVERRIDABLE_INVALID; | 504 help_string = IDS_SSL_NONOVERRIDABLE_INVALID; |
505 break; | 505 break; |
506 default: | 506 default: |
507 if (strict_enforcement_) | 507 if (strict_enforcement_) |
508 help_string = IDS_SSL_NONOVERRIDABLE_HSTS; | 508 help_string = IDS_SSL_NONOVERRIDABLE_HSTS; |
509 } | 509 } |
510 load_time_data.SetString( | 510 load_time_data.SetString( |
511 "finalParagraph", l10n_util::GetStringFUTF16(help_string, url)); | 511 "finalParagraph", l10n_util::GetStringFUTF16(help_string, url)); |
512 } | 512 } |
513 | 513 |
514 // Set debugging information at the bottom of the warning. | |
515 load_time_data.SetString( | |
516 "subject", ssl_info_.cert->subject().GetDisplayName()); | |
517 load_time_data.SetString( | |
518 "issuer", ssl_info_.cert->issuer().GetDisplayName()); | |
519 load_time_data.SetString( | |
520 "expirationDate", | |
521 base::TimeFormatShortDate(ssl_info_.cert->valid_expiry())); | |
522 load_time_data.SetString( | |
523 "currentDate", base::TimeFormatShortDate(now)); | |
524 std::string printed_chain; | |
525 std::vector<std::string> encoded_chain; | |
526 ssl_info_.cert->GetPEMEncodedChain(&encoded_chain); | |
527 for (size_t i = 0; i < encoded_chain.size(); ++i) | |
528 printed_chain.append(encoded_chain[i]); | |
Bernhard Bauer
2014/09/19 08:40:35
I assume you're intentionally concatenating the st
felt
2014/09/20 15:47:02
I don't need to because the pem file format alread
| |
529 load_time_data.SetString("pem", printed_chain); | |
530 | |
514 base::StringPiece html( | 531 base::StringPiece html( |
515 ResourceBundle::GetSharedInstance().GetRawDataResource( | 532 ResourceBundle::GetSharedInstance().GetRawDataResource( |
516 IRD_SECURITY_INTERSTITIAL_HTML)); | 533 IRD_SECURITY_INTERSTITIAL_HTML)); |
517 webui::UseVersion2 version; | 534 webui::UseVersion2 version; |
518 return webui::GetI18nTemplateHtml(html, &load_time_data); | 535 return webui::GetI18nTemplateHtml(html, &load_time_data); |
519 } | 536 } |
520 | 537 |
521 void SSLBlockingPage::OverrideEntry(NavigationEntry* entry) { | 538 void SSLBlockingPage::OverrideEntry(NavigationEntry* entry) { |
522 int cert_id = content::CertStore::GetInstance()->StoreCert( | 539 int cert_id = content::CertStore::GetInstance()->StoreCert( |
523 ssl_info_.cert.get(), web_contents_->GetRenderProcessHost()->GetID()); | 540 ssl_info_.cert.get(), web_contents_->GetRenderProcessHost()->GetID()); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
653 for (; i < 5; i++) { | 670 for (; i < 5; i++) { |
654 strings->SetString(keys[i], std::string()); | 671 strings->SetString(keys[i], std::string()); |
655 } | 672 } |
656 } | 673 } |
657 | 674 |
658 void SSLBlockingPage::OnGotHistoryCount(bool success, | 675 void SSLBlockingPage::OnGotHistoryCount(bool success, |
659 int num_visits, | 676 int num_visits, |
660 base::Time first_visit) { | 677 base::Time first_visit) { |
661 num_visits_ = num_visits; | 678 num_visits_ = num_visits; |
662 } | 679 } |
OLD | NEW |