| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_manager.h" | 5 #include "chrome/browser/ssl/ssl_manager.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/chrome_thread.h" | 9 #include "chrome/browser/chrome_thread.h" |
| 10 #include "chrome/browser/load_from_memory_cache_details.h" | 10 #include "chrome/browser/load_from_memory_cache_details.h" |
| 11 #include "chrome/browser/net/url_request_tracking.h" | 11 #include "chrome/browser/net/url_request_tracking.h" |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 } | 264 } |
| 265 | 265 |
| 266 Pickle pickle(state.data(), static_cast<int>(state.size())); | 266 Pickle pickle(state.data(), static_cast<int>(state.size())); |
| 267 void * iter = NULL; | 267 void * iter = NULL; |
| 268 return pickle.ReadInt(&iter, cert_id) && | 268 return pickle.ReadInt(&iter, cert_id) && |
| 269 pickle.ReadInt(&iter, cert_status) && | 269 pickle.ReadInt(&iter, cert_status) && |
| 270 pickle.ReadInt(&iter, security_bits); | 270 pickle.ReadInt(&iter, security_bits); |
| 271 } | 271 } |
| 272 | 272 |
| 273 // static | 273 // static |
| 274 bool SSLManager::GetEVCertNames(const net::X509Certificate& cert, | 274 std::wstring SSLManager::GetEVCertName(const net::X509Certificate& cert) { |
| 275 std::wstring* short_name, | |
| 276 std::wstring* ca_name) { | |
| 277 DCHECK(short_name || ca_name); | |
| 278 | |
| 279 // EV are required to have an organization name and country. | 275 // EV are required to have an organization name and country. |
| 280 if (cert.subject().organization_names.empty() || | 276 if (cert.subject().organization_names.empty() || |
| 281 cert.subject().country_name.empty()) { | 277 cert.subject().country_name.empty()) { |
| 282 NOTREACHED(); | 278 NOTREACHED(); |
| 283 return false; | 279 return std::wstring(); |
| 284 } | 280 } |
| 285 | 281 |
| 286 if (short_name) { | 282 return l10n_util::GetStringF(IDS_SECURE_CONNECTION_EV, |
| 287 *short_name = l10n_util::GetStringF( | 283 UTF8ToWide(cert.subject().organization_names[0]), |
| 288 IDS_SECURE_CONNECTION_EV, | 284 UTF8ToWide(cert.subject().country_name)); |
| 289 UTF8ToWide(cert.subject().organization_names[0]), | |
| 290 UTF8ToWide(cert.subject().country_name)); | |
| 291 } | |
| 292 | |
| 293 if (ca_name) { | |
| 294 // TODO(wtc): should we show the root CA's name instead? | |
| 295 *ca_name = l10n_util::GetStringF( | |
| 296 IDS_SECURE_CONNECTION_EV_CA, | |
| 297 UTF8ToWide(cert.issuer().organization_names[0])); | |
| 298 } | |
| 299 return true; | |
| 300 } | 285 } |
| OLD | NEW |