OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/security_state/security_state_model.h" | 5 #include "components/security_state/security_state_model.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 visible_security_state.fails_malware_check; | 188 visible_security_state.fails_malware_check; |
189 if (security_info->fails_malware_check) { | 189 if (security_info->fails_malware_check) { |
190 security_info->security_level = GetSecurityLevelForRequest( | 190 security_info->security_level = GetSecurityLevelForRequest( |
191 visible_security_state, client, cert, | 191 visible_security_state, client, cert, |
192 SecurityStateModel::UNKNOWN_SHA1, | 192 SecurityStateModel::UNKNOWN_SHA1, |
193 SecurityStateModel::CONTENT_STATUS_UNKNOWN, | 193 SecurityStateModel::CONTENT_STATUS_UNKNOWN, |
194 SecurityStateModel::CONTENT_STATUS_UNKNOWN); | 194 SecurityStateModel::CONTENT_STATUS_UNKNOWN); |
195 } | 195 } |
196 return; | 196 return; |
197 } | 197 } |
198 security_info->cert_id = visible_security_state.cert_id; | 198 security_info->certificate = visible_security_state.certificate; |
199 security_info->sha1_deprecation_status = | 199 security_info->sha1_deprecation_status = |
200 GetSHA1DeprecationStatus(cert, visible_security_state); | 200 GetSHA1DeprecationStatus(cert, visible_security_state); |
201 security_info->mixed_content_status = | 201 security_info->mixed_content_status = |
202 GetContentStatus(visible_security_state.displayed_mixed_content, | 202 GetContentStatus(visible_security_state.displayed_mixed_content, |
203 visible_security_state.ran_mixed_content); | 203 visible_security_state.ran_mixed_content); |
204 security_info->content_with_cert_errors_status = GetContentStatus( | 204 security_info->content_with_cert_errors_status = GetContentStatus( |
205 visible_security_state.displayed_content_with_cert_errors, | 205 visible_security_state.displayed_content_with_cert_errors, |
206 visible_security_state.ran_content_with_cert_errors); | 206 visible_security_state.ran_content_with_cert_errors); |
207 security_info->security_bits = visible_security_state.security_bits; | 207 security_info->security_bits = visible_security_state.security_bits; |
208 security_info->connection_status = visible_security_state.connection_status; | 208 security_info->connection_status = visible_security_state.connection_status; |
(...skipping 26 matching lines...) Expand all Loading... |
235 SecurityStateModel::SECURITY_ERROR; | 235 SecurityStateModel::SECURITY_ERROR; |
236 | 236 |
237 SecurityStateModel::SecurityInfo::SecurityInfo() | 237 SecurityStateModel::SecurityInfo::SecurityInfo() |
238 : security_level(SecurityStateModel::NONE), | 238 : security_level(SecurityStateModel::NONE), |
239 fails_malware_check(false), | 239 fails_malware_check(false), |
240 sha1_deprecation_status(SecurityStateModel::NO_DEPRECATED_SHA1), | 240 sha1_deprecation_status(SecurityStateModel::NO_DEPRECATED_SHA1), |
241 mixed_content_status(SecurityStateModel::CONTENT_STATUS_NONE), | 241 mixed_content_status(SecurityStateModel::CONTENT_STATUS_NONE), |
242 content_with_cert_errors_status(SecurityStateModel::CONTENT_STATUS_NONE), | 242 content_with_cert_errors_status(SecurityStateModel::CONTENT_STATUS_NONE), |
243 scheme_is_cryptographic(false), | 243 scheme_is_cryptographic(false), |
244 cert_status(0), | 244 cert_status(0), |
245 cert_id(0), | |
246 security_bits(-1), | 245 security_bits(-1), |
247 connection_status(0), | 246 connection_status(0), |
248 obsolete_ssl_status(net::OBSOLETE_SSL_NONE), | 247 obsolete_ssl_status(net::OBSOLETE_SSL_NONE), |
249 pkp_bypassed(false) {} | 248 pkp_bypassed(false) {} |
250 | 249 |
251 SecurityStateModel::SecurityInfo::~SecurityInfo() {} | 250 SecurityStateModel::SecurityInfo::~SecurityInfo() {} |
252 | 251 |
253 SecurityStateModel::SecurityStateModel() {} | 252 SecurityStateModel::SecurityStateModel() {} |
254 | 253 |
255 SecurityStateModel::~SecurityStateModel() {} | 254 SecurityStateModel::~SecurityStateModel() {} |
(...skipping 25 matching lines...) Expand all Loading... |
281 } | 280 } |
282 | 281 |
283 void SecurityStateModel::SetClient(SecurityStateModelClient* client) { | 282 void SecurityStateModel::SetClient(SecurityStateModelClient* client) { |
284 client_ = client; | 283 client_ = client; |
285 } | 284 } |
286 | 285 |
287 SecurityStateModel::VisibleSecurityState::VisibleSecurityState() | 286 SecurityStateModel::VisibleSecurityState::VisibleSecurityState() |
288 : initial_security_level(SecurityStateModel::NONE), | 287 : initial_security_level(SecurityStateModel::NONE), |
289 fails_malware_check(false), | 288 fails_malware_check(false), |
290 connection_info_initialized(false), | 289 connection_info_initialized(false), |
291 cert_id(0), | |
292 cert_status(0), | 290 cert_status(0), |
293 connection_status(0), | 291 connection_status(0), |
294 security_bits(-1), | 292 security_bits(-1), |
295 displayed_mixed_content(false), | 293 displayed_mixed_content(false), |
296 ran_mixed_content(false), | 294 ran_mixed_content(false), |
297 displayed_content_with_cert_errors(false), | 295 displayed_content_with_cert_errors(false), |
298 ran_content_with_cert_errors(false), | 296 ran_content_with_cert_errors(false), |
299 pkp_bypassed(false) {} | 297 pkp_bypassed(false) {} |
300 | 298 |
301 SecurityStateModel::VisibleSecurityState::~VisibleSecurityState() {} | 299 SecurityStateModel::VisibleSecurityState::~VisibleSecurityState() {} |
302 | 300 |
303 bool SecurityStateModel::VisibleSecurityState::operator==( | 301 bool SecurityStateModel::VisibleSecurityState::operator==( |
304 const SecurityStateModel::VisibleSecurityState& other) const { | 302 const SecurityStateModel::VisibleSecurityState& other) const { |
305 return (url == other.url && | 303 return (url == other.url && |
306 initial_security_level == other.initial_security_level && | 304 initial_security_level == other.initial_security_level && |
307 fails_malware_check == other.fails_malware_check && | 305 fails_malware_check == other.fails_malware_check && |
308 cert_id == other.cert_id && cert_status == other.cert_status && | 306 !!certificate == !!other.certificate && |
| 307 (certificate ? certificate->Equals(other.certificate.get()) : true) && |
309 connection_status == other.connection_status && | 308 connection_status == other.connection_status && |
310 security_bits == other.security_bits && | 309 security_bits == other.security_bits && |
311 sct_verify_statuses == other.sct_verify_statuses && | 310 sct_verify_statuses == other.sct_verify_statuses && |
312 displayed_mixed_content == other.displayed_mixed_content && | 311 displayed_mixed_content == other.displayed_mixed_content && |
313 ran_mixed_content == other.ran_mixed_content && | 312 ran_mixed_content == other.ran_mixed_content && |
314 displayed_content_with_cert_errors == | 313 displayed_content_with_cert_errors == |
315 other.displayed_content_with_cert_errors && | 314 other.displayed_content_with_cert_errors && |
316 ran_content_with_cert_errors == other.ran_content_with_cert_errors && | 315 ran_content_with_cert_errors == other.ran_content_with_cert_errors && |
317 pkp_bypassed == other.pkp_bypassed); | 316 pkp_bypassed == other.pkp_bypassed); |
318 } | 317 } |
319 | 318 |
320 } // namespace security_state | 319 } // namespace security_state |
OLD | NEW |