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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 base::string16 issuer_name( | 485 base::string16 issuer_name( |
486 UTF8ToUTF16(certificate_->issuer().GetDisplayName())); | 486 UTF8ToUTF16(certificate_->issuer().GetDisplayName())); |
487 if (issuer_name.empty()) { | 487 if (issuer_name.empty()) { |
488 issuer_name.assign(l10n_util::GetStringUTF16( | 488 issuer_name.assign(l10n_util::GetStringUTF16( |
489 IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY)); | 489 IDS_PAGE_INFO_SECURITY_TAB_UNKNOWN_PARTY)); |
490 } | 490 } |
491 | 491 |
492 site_identity_details_.assign(l10n_util::GetStringFUTF16( | 492 site_identity_details_.assign(l10n_util::GetStringFUTF16( |
493 IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_VERIFIED, issuer_name)); | 493 IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_VERIFIED, issuer_name)); |
494 } | 494 } |
495 switch (security_info.sha1_deprecation_status) { | 495 if (security_info.sha1_in_chain) { |
496 case security_state::DEPRECATED_SHA1_MINOR: | 496 site_identity_status_ = |
497 site_identity_status_ = | 497 SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM; |
498 SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM_MINOR; | 498 site_identity_details_ += |
499 site_identity_details_ += | 499 UTF8ToUTF16("\n\n") + |
500 UTF8ToUTF16("\n\n") + | 500 l10n_util::GetStringUTF16( |
501 l10n_util::GetStringUTF16( | 501 IDS_PAGE_INFO_SECURITY_TAB_DEPRECATED_SIGNATURE_ALGORITHM); |
502 IDS_PAGE_INFO_SECURITY_TAB_DEPRECATED_SIGNATURE_ALGORITHM_MINO
R); | |
503 break; | |
504 case security_state::DEPRECATED_SHA1_MAJOR: | |
505 site_identity_status_ = | |
506 SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM_MAJOR; | |
507 site_identity_details_ += | |
508 UTF8ToUTF16("\n\n") + | |
509 l10n_util::GetStringUTF16( | |
510 IDS_PAGE_INFO_SECURITY_TAB_DEPRECATED_SIGNATURE_ALGORITHM_MAJO
R); | |
511 break; | |
512 case security_state::NO_DEPRECATED_SHA1: | |
513 // Nothing to do. | |
514 break; | |
515 case security_state::UNKNOWN_SHA1: | |
516 // UNKNOWN_SHA1 should only appear when certificate info has not been | |
517 // initialized, in which case this if-statement should not be running | |
518 // because there is no other cert info. | |
519 NOTREACHED(); | |
520 } | 502 } |
521 } | 503 } |
522 } else { | 504 } else { |
523 // HTTP or HTTPS with errors (not warnings). | 505 // HTTP or HTTPS with errors (not warnings). |
524 site_identity_details_.assign(l10n_util::GetStringUTF16( | 506 site_identity_details_.assign(l10n_util::GetStringUTF16( |
525 IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY)); | 507 IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY)); |
526 if (!security_info.scheme_is_cryptographic || !security_info.certificate) | 508 if (!security_info.scheme_is_cryptographic || !security_info.certificate) |
527 site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT; | 509 site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT; |
528 else | 510 else |
529 site_identity_status_ = SITE_IDENTITY_STATUS_ERROR; | 511 site_identity_status_ = SITE_IDENTITY_STATUS_ERROR; |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 info.connection_status = site_connection_status_; | 740 info.connection_status = site_connection_status_; |
759 info.connection_status_description = | 741 info.connection_status_description = |
760 UTF16ToUTF8(site_connection_details_); | 742 UTF16ToUTF8(site_connection_details_); |
761 info.identity_status = site_identity_status_; | 743 info.identity_status = site_identity_status_; |
762 info.identity_status_description = | 744 info.identity_status_description = |
763 UTF16ToUTF8(site_identity_details_); | 745 UTF16ToUTF8(site_identity_details_); |
764 info.certificate = certificate_; | 746 info.certificate = certificate_; |
765 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; | 747 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; |
766 ui_->SetIdentityInfo(info); | 748 ui_->SetIdentityInfo(info); |
767 } | 749 } |
OLD | NEW |