Chromium Code Reviews| 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 #ifndef COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_H_ | 5 #ifndef COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_H_ |
| 6 #define COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_H_ | 6 #define COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 // load. Content can be passive content that is displayed (such as | 87 // load. Content can be passive content that is displayed (such as |
| 88 // images) or active content that is run (such as scripts or iframes). | 88 // images) or active content that is run (such as scripts or iframes). |
| 89 enum ContentStatus { | 89 enum ContentStatus { |
| 90 CONTENT_STATUS_UNKNOWN, | 90 CONTENT_STATUS_UNKNOWN, |
| 91 CONTENT_STATUS_NONE, | 91 CONTENT_STATUS_NONE, |
| 92 CONTENT_STATUS_DISPLAYED, | 92 CONTENT_STATUS_DISPLAYED, |
| 93 CONTENT_STATUS_RAN, | 93 CONTENT_STATUS_RAN, |
| 94 CONTENT_STATUS_DISPLAYED_AND_RAN, | 94 CONTENT_STATUS_DISPLAYED_AND_RAN, |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 // Describes whether the page contains malicious resources such as | |
| 98 // malware or phishing attacks. | |
| 99 enum MaliciousContentStatus { | |
| 100 MALICIOUS_CONTENT_STATUS_NONE, | |
| 101 MALICIOUS_CONTENT_STATUS_MALWARE, | |
|
estark
2016/11/09 16:07:44
These different statuses will be used to distingui
Nathan Parker
2016/11/10 00:13:03
Acknowledged.
| |
| 102 MALICIOUS_CONTENT_STATUS_UNWANTED_SOFTWARE, | |
| 103 MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING, | |
| 104 }; | |
| 105 | |
| 97 // Describes the security status of a page or request. This is the | 106 // Describes the security status of a page or request. This is the |
| 98 // main data structure provided by this class. | 107 // main data structure provided by this class. |
| 99 struct SecurityInfo { | 108 struct SecurityInfo { |
| 100 SecurityInfo(); | 109 SecurityInfo(); |
| 101 ~SecurityInfo(); | 110 ~SecurityInfo(); |
| 102 SecurityLevel security_level; | 111 SecurityLevel security_level; |
| 103 // True if the page fails the browser's malware or phishing checks. | 112 // Describes the nature of the page's malicious content, if any. |
| 104 bool fails_malware_check; | 113 MaliciousContentStatus malicious_content_status; |
| 105 SHA1DeprecationStatus sha1_deprecation_status; | 114 SHA1DeprecationStatus sha1_deprecation_status; |
| 106 // |mixed_content_status| describes the presence of content that was | 115 // |mixed_content_status| describes the presence of content that was |
| 107 // loaded over a nonsecure (HTTP) connection. | 116 // loaded over a nonsecure (HTTP) connection. |
| 108 ContentStatus mixed_content_status; | 117 ContentStatus mixed_content_status; |
| 109 // |content_with_cert_errors_status| describes the presence of | 118 // |content_with_cert_errors_status| describes the presence of |
| 110 // content that was loaded over an HTTPS connection with | 119 // content that was loaded over an HTTPS connection with |
| 111 // certificate errors. | 120 // certificate errors. |
| 112 ContentStatus content_with_cert_errors_status; | 121 ContentStatus content_with_cert_errors_status; |
| 113 // The verification statuses of the signed certificate timestamps | 122 // The verification statuses of the signed certificate timestamps |
| 114 // for the connection. | 123 // for the connection. |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 144 | 153 |
| 145 // Contains the security state relevant to computing the SecurityInfo | 154 // Contains the security state relevant to computing the SecurityInfo |
| 146 // for a page. This is the input to GetSecurityInfo() provided by the | 155 // for a page. This is the input to GetSecurityInfo() provided by the |
| 147 // model's client. | 156 // model's client. |
| 148 struct VisibleSecurityState { | 157 struct VisibleSecurityState { |
| 149 VisibleSecurityState(); | 158 VisibleSecurityState(); |
| 150 ~VisibleSecurityState(); | 159 ~VisibleSecurityState(); |
| 151 bool operator==(const VisibleSecurityState& other) const; | 160 bool operator==(const VisibleSecurityState& other) const; |
| 152 GURL url; | 161 GURL url; |
| 153 | 162 |
| 154 // True if the page fails the browser's malware or phishing checks. | 163 MaliciousContentStatus malicious_content_status; |
| 155 bool fails_malware_check; | |
| 156 | 164 |
| 157 // CONNECTION SECURITY FIELDS | 165 // CONNECTION SECURITY FIELDS |
| 158 // Whether the connection security fields are initialized. | 166 // Whether the connection security fields are initialized. |
| 159 bool connection_info_initialized; | 167 bool connection_info_initialized; |
| 160 // The following fields contain information about the connection | 168 // The following fields contain information about the connection |
| 161 // used to load the page or request. | 169 // used to load the page or request. |
| 162 scoped_refptr<net::X509Certificate> certificate; | 170 scoped_refptr<net::X509Certificate> certificate; |
| 163 net::CertStatus cert_status; | 171 net::CertStatus cert_status; |
| 164 int connection_status; | 172 int connection_status; |
| 165 // The ID of the (EC)DH group used by the key exchange. The value is zero if | 173 // The ID of the (EC)DH group used by the key exchange. The value is zero if |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 201 | 209 |
| 202 private: | 210 private: |
| 203 SecurityStateModelClient* client_; | 211 SecurityStateModelClient* client_; |
| 204 | 212 |
| 205 DISALLOW_COPY_AND_ASSIGN(SecurityStateModel); | 213 DISALLOW_COPY_AND_ASSIGN(SecurityStateModel); |
| 206 }; | 214 }; |
| 207 | 215 |
| 208 } // namespace security_state | 216 } // namespace security_state |
| 209 | 217 |
| 210 #endif // COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_H_ | 218 #endif // COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_H_ |
| OLD | NEW |