OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/ssl/ssl_policy.h" | 5 #include "content/browser/ssl/ssl_policy.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // CAs issue certificates for intranet hosts to everyone. Therefore, we | 124 // CAs issue certificates for intranet hosts to everyone. Therefore, we |
125 // mark intranet hosts as being non-unique. | 125 // mark intranet hosts as being non-unique. |
126 if (IsIntranetHost(entry->url().host())) { | 126 if (IsIntranetHost(entry->url().host())) { |
127 entry->ssl().set_cert_status(entry->ssl().cert_status() | | 127 entry->ssl().set_cert_status(entry->ssl().cert_status() | |
128 net::CERT_STATUS_NON_UNIQUE_NAME); | 128 net::CERT_STATUS_NON_UNIQUE_NAME); |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
132 // If CERT_STATUS_UNABLE_TO_CHECK_REVOCATION is the only certificate error, | 132 // If CERT_STATUS_UNABLE_TO_CHECK_REVOCATION is the only certificate error, |
133 // don't lower the security style to SECURITY_STYLE_AUTHENTICATION_BROKEN. | 133 // don't lower the security style to SECURITY_STYLE_AUTHENTICATION_BROKEN. |
134 net::CertStatus cert_errors = | 134 int cert_errors = entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS; |
135 entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS; | |
136 if (cert_errors) { | 135 if (cert_errors) { |
137 if (cert_errors != net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION) | 136 if (cert_errors != net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION) |
138 entry->ssl().set_security_style(SECURITY_STYLE_AUTHENTICATION_BROKEN); | 137 entry->ssl().set_security_style(SECURITY_STYLE_AUTHENTICATION_BROKEN); |
139 return; | 138 return; |
140 } | 139 } |
141 | 140 |
142 SiteInstance* site_instance = entry->site_instance(); | 141 SiteInstance* site_instance = entry->site_instance(); |
143 // Note that |site_instance| can be NULL here because NavigationEntries don't | 142 // Note that |site_instance| can be NULL here because NavigationEntries don't |
144 // necessarily have site instances. Without a process, the entry can't | 143 // necessarily have site instances. Without a process, the entry can't |
145 // possibly have insecure content. See bug http://crbug.com/12423. | 144 // possibly have insecure content. See bug http://crbug.com/12423. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 207 |
209 entry->ssl().set_security_style(entry->url().SchemeIsSecure() ? | 208 entry->ssl().set_security_style(entry->url().SchemeIsSecure() ? |
210 SECURITY_STYLE_AUTHENTICATED : SECURITY_STYLE_UNAUTHENTICATED); | 209 SECURITY_STYLE_AUTHENTICATED : SECURITY_STYLE_UNAUTHENTICATED); |
211 } | 210 } |
212 | 211 |
213 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { | 212 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { |
214 GURL parsed_origin(origin); | 213 GURL parsed_origin(origin); |
215 if (parsed_origin.SchemeIsSecure()) | 214 if (parsed_origin.SchemeIsSecure()) |
216 backend_->HostRanInsecureContent(parsed_origin.host(), pid); | 215 backend_->HostRanInsecureContent(parsed_origin.host(), pid); |
217 } | 216 } |
OLD | NEW |