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 "ios/chrome/browser/ui/omnibox/page_info_model.h" | 5 #include "ios/chrome/browser/ui/omnibox/page_info_model.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_SENTENCE_LINK, description, | 221 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_SENTENCE_LINK, description, |
| 222 l10n_util::GetStringUTF16( | 222 l10n_util::GetStringUTF16( |
| 223 ran_insecure_content | 223 ran_insecure_content |
| 224 ? IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_ERROR | 224 ? IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_ERROR |
| 225 : IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_WARNIN G))); | 225 : IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTED_INSECURE_CONTENT_WARNIN G))); |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 | 228 |
| 229 uint16_t cipher_suite = | 229 uint16_t cipher_suite = |
| 230 net::SSLConnectionStatusToCipherSuite(ssl.connection_status); | 230 net::SSLConnectionStatusToCipherSuite(ssl.connection_status); |
| 231 if (ssl.security_bits > 0 && cipher_suite) { | 231 if (ssl.security_bits > 0 && cipher_suite) { |
|
davidben
2017/01/11 23:56:24
I doubt any of this code is reachable on iOS to be
| |
| 232 int ssl_version = net::SSLConnectionStatusToVersion(ssl.connection_status); | 232 int ssl_version = net::SSLConnectionStatusToVersion(ssl.connection_status); |
| 233 const char* ssl_version_str; | 233 const char* ssl_version_str; |
| 234 net::SSLVersionToString(&ssl_version_str, ssl_version); | 234 net::SSLVersionToString(&ssl_version_str, ssl_version); |
| 235 description += base::ASCIIToUTF16("\n\n"); | 235 description += base::ASCIIToUTF16("\n\n"); |
| 236 description += | 236 description += |
| 237 l10n_util::GetStringFUTF16(IDS_PAGE_INFO_SECURITY_TAB_SSL_VERSION, | 237 l10n_util::GetStringFUTF16(IDS_PAGE_INFO_SECURITY_TAB_SSL_VERSION, |
| 238 base::ASCIIToUTF16(ssl_version_str)); | 238 base::ASCIIToUTF16(ssl_version_str)); |
| 239 | 239 |
| 240 bool no_renegotiation = | |
| 241 (ssl.connection_status & | |
| 242 net::SSL_CONNECTION_NO_RENEGOTIATION_EXTENSION) != 0; | |
| 243 const char *key_exchange, *cipher, *mac; | 240 const char *key_exchange, *cipher, *mac; |
| 244 bool is_aead; | 241 bool is_aead; |
| 245 bool is_tls13; | 242 bool is_tls13; |
| 246 net::SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, | 243 net::SSLCipherSuiteToStrings(&key_exchange, &cipher, &mac, &is_aead, |
| 247 &is_tls13, cipher_suite); | 244 &is_tls13, cipher_suite); |
| 248 | 245 |
| 249 description += base::ASCIIToUTF16("\n\n"); | 246 description += base::ASCIIToUTF16("\n\n"); |
| 250 if (is_aead) { | 247 if (is_aead) { |
| 251 description += l10n_util::GetStringFUTF16( | 248 description += l10n_util::GetStringFUTF16( |
| 252 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS_AEAD, | 249 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS_AEAD, |
| 253 base::ASCIIToUTF16(cipher), base::ASCIIToUTF16(key_exchange)); | 250 base::ASCIIToUTF16(cipher), base::ASCIIToUTF16(key_exchange)); |
| 254 } else { | 251 } else { |
| 255 description += l10n_util::GetStringFUTF16( | 252 description += l10n_util::GetStringFUTF16( |
| 256 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS, | 253 IDS_PAGE_INFO_SECURITY_TAB_ENCRYPTION_DETAILS, |
| 257 base::ASCIIToUTF16(cipher), base::ASCIIToUTF16(mac), | 254 base::ASCIIToUTF16(cipher), base::ASCIIToUTF16(mac), |
| 258 base::ASCIIToUTF16(key_exchange)); | 255 base::ASCIIToUTF16(key_exchange)); |
| 259 } | 256 } |
| 260 | |
| 261 if (no_renegotiation) { | |
| 262 description += base::ASCIIToUTF16("\n\n"); | |
| 263 description += l10n_util::GetStringUTF16( | |
| 264 IDS_PAGE_INFO_SECURITY_TAB_RENEGOTIATION_MESSAGE); | |
| 265 } | |
| 266 } | 257 } |
| 267 | 258 |
| 268 if (!description.empty()) { | 259 if (!description.empty()) { |
| 269 sections_.push_back(SectionInfo(icon_id, headline, description, | 260 sections_.push_back(SectionInfo(icon_id, headline, description, |
| 270 SECTION_INFO_CONNECTION, | 261 SECTION_INFO_CONNECTION, |
| 271 BUTTON_SHOW_SECURITY_HELP)); | 262 BUTTON_SHOW_SECURITY_HELP)); |
| 272 } | 263 } |
| 273 | 264 |
| 274 if (ssl.certificate) { | 265 if (ssl.certificate) { |
| 275 certificate_label_ = | 266 certificate_label_ = |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 303 case ICON_STATE_OFFLINE_PAGE: | 294 case ICON_STATE_OFFLINE_PAGE: |
| 304 return &rb.GetNativeImageNamed(IDR_IOS_OMNIBOX_OFFLINE); | 295 return &rb.GetNativeImageNamed(IDR_IOS_OMNIBOX_OFFLINE); |
| 305 } | 296 } |
| 306 } | 297 } |
| 307 | 298 |
| 308 base::string16 PageInfoModel::GetCertificateLabel() const { | 299 base::string16 PageInfoModel::GetCertificateLabel() const { |
| 309 return certificate_label_; | 300 return certificate_label_; |
| 310 } | 301 } |
| 311 | 302 |
| 312 PageInfoModel::PageInfoModel() : observer_(NULL) {} | 303 PageInfoModel::PageInfoModel() : observer_(NULL) {} |
| OLD | NEW |