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 int cert_errors = entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS; | 134 net::CertStatus cert_errors = |
| 135 entry->ssl().cert_status() & net::CERT_STATUS_ALL_ERRORS; |
135 if (cert_errors) { | 136 if (cert_errors) { |
136 if (cert_errors != net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION) | 137 if (cert_errors != net::CERT_STATUS_UNABLE_TO_CHECK_REVOCATION) |
137 entry->ssl().set_security_style(SECURITY_STYLE_AUTHENTICATION_BROKEN); | 138 entry->ssl().set_security_style(SECURITY_STYLE_AUTHENTICATION_BROKEN); |
138 return; | 139 return; |
139 } | 140 } |
140 | 141 |
141 SiteInstance* site_instance = entry->site_instance(); | 142 SiteInstance* site_instance = entry->site_instance(); |
142 // Note that |site_instance| can be NULL here because NavigationEntries don't | 143 // Note that |site_instance| can be NULL here because NavigationEntries don't |
143 // necessarily have site instances. Without a process, the entry can't | 144 // necessarily have site instances. Without a process, the entry can't |
144 // possibly have insecure content. See bug http://crbug.com/12423. | 145 // possibly have insecure content. See bug http://crbug.com/12423. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 208 |
208 entry->ssl().set_security_style(entry->url().SchemeIsSecure() ? | 209 entry->ssl().set_security_style(entry->url().SchemeIsSecure() ? |
209 SECURITY_STYLE_AUTHENTICATED : SECURITY_STYLE_UNAUTHENTICATED); | 210 SECURITY_STYLE_AUTHENTICATED : SECURITY_STYLE_UNAUTHENTICATED); |
210 } | 211 } |
211 | 212 |
212 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { | 213 void SSLPolicy::OriginRanInsecureContent(const std::string& origin, int pid) { |
213 GURL parsed_origin(origin); | 214 GURL parsed_origin(origin); |
214 if (parsed_origin.SchemeIsSecure()) | 215 if (parsed_origin.SchemeIsSecure()) |
215 backend_->HostRanInsecureContent(parsed_origin.host(), pid); | 216 backend_->HostRanInsecureContent(parsed_origin.host(), pid); |
216 } | 217 } |
OLD | NEW |