| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "grit/theme_resources.h" | 9 #include "grit/theme_resources.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 // notify the request twice, it may no longer exist and |this| might have | 331 // notify the request twice, it may no longer exist and |this| might have |
| 332 // already have been deleted. | 332 // already have been deleted. |
| 333 DCHECK(!request_has_been_notified_); | 333 DCHECK(!request_has_been_notified_); |
| 334 | 334 |
| 335 if (!request_has_been_notified_) { | 335 if (!request_has_been_notified_) { |
| 336 URLRequest* request = resource_dispatcher_host_->GetURLRequest(request_id_); | 336 URLRequest* request = resource_dispatcher_host_->GetURLRequest(request_id_); |
| 337 if (request) { | 337 if (request) { |
| 338 // The request can be NULL if it was cancelled by the renderer (as the | 338 // The request can be NULL if it was cancelled by the renderer (as the |
| 339 // result of the user navigating to a new page from the location bar). | 339 // result of the user navigating to a new page from the location bar). |
| 340 DLOG(INFO) << "CompleteCancelRequest() url: " << request->url().spec(); | 340 DLOG(INFO) << "CompleteCancelRequest() url: " << request->url().spec(); |
| 341 request->CancelWithError(error); | 341 SSLManager::CertError* cert_error = AsCertError(); |
| 342 if (cert_error) |
| 343 request->SimulateSSLError(error, cert_error->ssl_info()); |
| 344 else |
| 345 request->SimulateError(error); |
| 342 } | 346 } |
| 343 request_has_been_notified_ = true; | 347 request_has_been_notified_ = true; |
| 344 | 348 |
| 345 // We're done with this object on the IO thread. | 349 // We're done with this object on the IO thread. |
| 346 Release(); | 350 Release(); |
| 347 } | 351 } |
| 348 } | 352 } |
| 349 | 353 |
| 350 void SSLManager::ErrorHandler::CompleteContinueRequest() { | 354 void SSLManager::ErrorHandler::CompleteContinueRequest() { |
| 351 DCHECK(MessageLoop::current() == io_loop_); | 355 DCHECK(MessageLoop::current() == io_loop_); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 entry->ssl().set_security_bits(ssl_security_bits); | 588 entry->ssl().set_security_bits(ssl_security_bits); |
| 585 changed = true; | 589 changed = true; |
| 586 } | 590 } |
| 587 | 591 |
| 588 ShowPendingMessages(); | 592 ShowPendingMessages(); |
| 589 } | 593 } |
| 590 | 594 |
| 591 // An HTTPS response may not have a certificate for some reason. When that | 595 // An HTTPS response may not have a certificate for some reason. When that |
| 592 // happens, use the unauthenticated (HTTP) rather than the authentication | 596 // happens, use the unauthenticated (HTTP) rather than the authentication |
| 593 // broken security style so that we can detect this error condition. | 597 // broken security style so that we can detect this error condition. |
| 594 if (net::IsCertStatusError(ssl_cert_status)) { | 598 if (net::IsCertStatusError(ssl_cert_status) && |
| 599 !details->is_content_filtered) { |
| 595 changed |= SetMaxSecurityStyle(SECURITY_STYLE_AUTHENTICATION_BROKEN); | 600 changed |= SetMaxSecurityStyle(SECURITY_STYLE_AUTHENTICATION_BROKEN); |
| 596 if (!details->is_main_frame && | 601 if (!details->is_main_frame && |
| 597 !details->entry->ssl().has_unsafe_content()) { | 602 !details->entry->ssl().has_unsafe_content()) { |
| 598 details->entry->ssl().set_has_unsafe_content(); | 603 details->entry->ssl().set_has_unsafe_content(); |
| 599 changed = true; | 604 changed = true; |
| 600 } | 605 } |
| 601 } else if (details->entry->url().SchemeIsSecure() && !ssl_cert_id) { | 606 } else if (details->entry->url().SchemeIsSecure() && !ssl_cert_id) { |
| 602 if (details->is_main_frame) { | 607 if (details->is_main_frame) { |
| 603 changed |= SetMaxSecurityStyle(SECURITY_STYLE_UNAUTHENTICATED); | 608 changed |= SetMaxSecurityStyle(SECURITY_STYLE_UNAUTHENTICATED); |
| 604 } else { | 609 } else { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 | 724 |
| 720 if (ca_name) { | 725 if (ca_name) { |
| 721 // TODO(wtc): should we show the root CA's name instead? | 726 // TODO(wtc): should we show the root CA's name instead? |
| 722 *ca_name = l10n_util::GetStringF( | 727 *ca_name = l10n_util::GetStringF( |
| 723 IDS_SECURE_CONNECTION_EV_CA, | 728 IDS_SECURE_CONNECTION_EV_CA, |
| 724 UTF8ToWide(cert.issuer().organization_names[0])); | 729 UTF8ToWide(cert.issuer().organization_names[0])); |
| 725 } | 730 } |
| 726 return true; | 731 return true; |
| 727 } | 732 } |
| 728 | 733 |
| OLD | NEW |