| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_COMMON_SSL_STATUS_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_SSL_STATUS_H_ |
| 6 #define CONTENT_PUBLIC_COMMON_SSL_STATUS_H_ | 6 #define CONTENT_PUBLIC_COMMON_SSL_STATUS_H_ |
| 7 | 7 |
| 8 #include "content/common/content_export.h" | 8 #include "content/common/content_export.h" |
| 9 #include "content/public/common/security_style.h" | 9 #include "content/public/common/security_style.h" |
| 10 #include "content/public/common/signed_certificate_timestamp_id_and_status.h" | |
| 11 #include "net/cert/cert_status_flags.h" | 10 #include "net/cert/cert_status_flags.h" |
| 12 | 11 |
| 13 namespace net { | 12 namespace net { |
| 14 class SSLInfo; | 13 class SSLInfo; |
| 15 } | 14 } |
| 16 | 15 |
| 17 namespace content { | 16 namespace content { |
| 18 | 17 |
| 19 // Collects the SSL information for this NavigationEntry. | 18 // Collects the SSL information for this NavigationEntry. |
| 20 struct CONTENT_EXPORT SSLStatus { | 19 struct CONTENT_EXPORT SSLStatus { |
| 21 // Flags used for the page security content status. | 20 // Flags used for the page security content status. |
| 22 enum ContentStatusFlags { | 21 enum ContentStatusFlags { |
| 23 // HTTP page, or HTTPS page with no insecure content. | 22 // HTTP page, or HTTPS page with no insecure content. |
| 24 NORMAL_CONTENT = 0, | 23 NORMAL_CONTENT = 0, |
| 25 | 24 |
| 26 // HTTPS page containing "displayed" HTTP resources (e.g. images, CSS). | 25 // HTTPS page containing "displayed" HTTP resources (e.g. images, CSS). |
| 27 DISPLAYED_INSECURE_CONTENT = 1 << 0, | 26 DISPLAYED_INSECURE_CONTENT = 1 << 0, |
| 28 | 27 |
| 29 // HTTPS page containing "executed" HTTP resources (i.e. script). | 28 // HTTPS page containing "executed" HTTP resources (i.e. script). |
| 30 // Also currently used for HTTPS page containing broken-HTTPS resources; | 29 // Also currently used for HTTPS page containing broken-HTTPS resources; |
| 31 // this is wrong and should be fixed (see comments in | 30 // this is wrong and should be fixed (see comments in |
| 32 // SSLPolicy::OnRequestStarted()). | 31 // SSLPolicy::OnRequestStarted()). |
| 33 RAN_INSECURE_CONTENT = 1 << 1, | 32 RAN_INSECURE_CONTENT = 1 << 1, |
| 34 }; | 33 }; |
| 35 | 34 |
| 36 SSLStatus(); | 35 SSLStatus(); |
| 37 SSLStatus(SecurityStyle security_style, | 36 SSLStatus(SecurityStyle security_style, |
| 38 int cert_id, | 37 int cert_id, |
| 39 const SignedCertificateTimestampIDStatusList& | |
| 40 signed_certificate_timestamp_ids, | |
| 41 const net::SSLInfo& ssl_info); | 38 const net::SSLInfo& ssl_info); |
| 42 SSLStatus(const SSLStatus& other); | 39 SSLStatus(const SSLStatus& other); |
| 43 ~SSLStatus(); | 40 ~SSLStatus(); |
| 44 | 41 |
| 45 bool Equals(const SSLStatus& status) const { | 42 bool Equals(const SSLStatus& status) const { |
| 46 return security_style == status.security_style && | 43 return security_style == status.security_style && |
| 47 cert_id == status.cert_id && cert_status == status.cert_status && | 44 cert_id == status.cert_id && cert_status == status.cert_status && |
| 48 security_bits == status.security_bits && | 45 security_bits == status.security_bits && |
| 49 key_exchange_info == status.key_exchange_info && | 46 key_exchange_info == status.key_exchange_info && |
| 50 connection_status == status.connection_status && | 47 connection_status == status.connection_status && |
| 51 content_status == status.content_status && | 48 content_status == status.content_status && |
| 52 signed_certificate_timestamp_ids == | 49 num_unknown_scts == status.num_unknown_scts && |
| 53 status.signed_certificate_timestamp_ids; | 50 num_invalid_scts == status.num_invalid_scts && |
| 51 num_valid_scts == status.num_valid_scts; |
| 54 } | 52 } |
| 55 | 53 |
| 56 content::SecurityStyle security_style; | 54 content::SecurityStyle security_style; |
| 57 // A cert_id value of 0 indicates that it is unset or invalid. | 55 // A cert_id value of 0 indicates that it is unset or invalid. |
| 58 int cert_id; | 56 int cert_id; |
| 59 net::CertStatus cert_status; | 57 net::CertStatus cert_status; |
| 60 int security_bits; | 58 int security_bits; |
| 61 int key_exchange_info; | 59 int key_exchange_info; |
| 62 int connection_status; | 60 int connection_status; |
| 63 // A combination of the ContentStatusFlags above. | 61 // A combination of the ContentStatusFlags above. |
| 64 int content_status; | 62 int content_status; |
| 65 SignedCertificateTimestampIDStatusList signed_certificate_timestamp_ids; | 63 // Signed Certificate Timestamps (SCTs) of Certificate Transparency (CT). |
| 64 int num_unknown_scts; |
| 65 int num_invalid_scts; |
| 66 int num_valid_scts; |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 } // namespace content | 69 } // namespace content |
| 69 | 70 |
| 70 #endif // CONTENT_PUBLIC_COMMON_SSL_STATUS_H_ | 71 #endif // CONTENT_PUBLIC_COMMON_SSL_STATUS_H_ |
| OLD | NEW |