| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| 11 #include "content/public/common/security_style.h" | 11 #include "content/public/common/security_style.h" |
| 12 #include "net/cert/cert_status_flags.h" | 12 #include "net/cert/cert_status_flags.h" |
| 13 #include "net/cert/sct_status_flags.h" | 13 #include "net/cert/sct_status_flags.h" |
| 14 #include "net/cert/x509_certificate.h" |
| 14 | 15 |
| 15 namespace net { | 16 namespace net { |
| 16 class SSLInfo; | 17 class SSLInfo; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace content { | 20 namespace content { |
| 20 | 21 |
| 21 // Collects the SSL information for this NavigationEntry. | 22 // Collects the SSL information for this NavigationEntry. |
| 22 struct CONTENT_EXPORT SSLStatus { | 23 struct CONTENT_EXPORT SSLStatus { |
| 23 // Flags used for the page security content status. | 24 // Flags used for the page security content status. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 35 // CSS) loaded with certificate errors. | 36 // CSS) loaded with certificate errors. |
| 36 DISPLAYED_CONTENT_WITH_CERT_ERRORS = 1 << 2, | 37 DISPLAYED_CONTENT_WITH_CERT_ERRORS = 1 << 2, |
| 37 | 38 |
| 38 // HTTPS page containing "executed" HTTPS resources (i.e. script) | 39 // HTTPS page containing "executed" HTTPS resources (i.e. script) |
| 39 // loaded with certificate errors. | 40 // loaded with certificate errors. |
| 40 RAN_CONTENT_WITH_CERT_ERRORS = 1 << 3, | 41 RAN_CONTENT_WITH_CERT_ERRORS = 1 << 3, |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 SSLStatus(); | 44 SSLStatus(); |
| 44 SSLStatus(SecurityStyle security_style, | 45 SSLStatus(SecurityStyle security_style, |
| 45 int cert_id, | 46 scoped_refptr<net::X509Certificate> certificate, |
| 46 const net::SSLInfo& ssl_info); | 47 const net::SSLInfo& ssl_info); |
| 47 SSLStatus(const SSLStatus& other); | 48 SSLStatus(const SSLStatus& other); |
| 48 ~SSLStatus(); | 49 ~SSLStatus(); |
| 49 | 50 |
| 50 bool Equals(const SSLStatus& status) const { | 51 bool Equals(const SSLStatus& status) const { |
| 51 return security_style == status.security_style && | 52 return security_style == status.security_style && |
| 52 cert_id == status.cert_id && cert_status == status.cert_status && | 53 !!certificate == !!status.certificate && |
| 54 (certificate ? certificate->Equals(status.certificate.get()) : |
| 55 true) && |
| 56 cert_status == status.cert_status && |
| 53 security_bits == status.security_bits && | 57 security_bits == status.security_bits && |
| 54 key_exchange_info == status.key_exchange_info && | 58 key_exchange_info == status.key_exchange_info && |
| 55 connection_status == status.connection_status && | 59 connection_status == status.connection_status && |
| 56 content_status == status.content_status && | 60 content_status == status.content_status && |
| 57 sct_statuses == status.sct_statuses && | 61 sct_statuses == status.sct_statuses && |
| 58 pkp_bypassed == status.pkp_bypassed; | 62 pkp_bypassed == status.pkp_bypassed; |
| 59 } | 63 } |
| 60 | 64 |
| 61 content::SecurityStyle security_style; | 65 content::SecurityStyle security_style; |
| 62 // A cert_id value of 0 indicates that it is unset or invalid. | 66 scoped_refptr<net::X509Certificate> certificate; |
| 63 int cert_id; | |
| 64 net::CertStatus cert_status; | 67 net::CertStatus cert_status; |
| 65 int security_bits; | 68 int security_bits; |
| 66 int key_exchange_info; | 69 int key_exchange_info; |
| 67 int connection_status; | 70 int connection_status; |
| 68 // A combination of the ContentStatusFlags above. | 71 // A combination of the ContentStatusFlags above. |
| 69 int content_status; | 72 int content_status; |
| 70 // The validation statuses of the Signed Certificate Timestamps (SCTs) | 73 // The validation statuses of the Signed Certificate Timestamps (SCTs) |
| 71 // of Certificate Transparency (CT) that were served with the | 74 // of Certificate Transparency (CT) that were served with the |
| 72 // main resource. | 75 // main resource. |
| 73 std::vector<net::ct::SCTVerifyStatus> sct_statuses; | 76 std::vector<net::ct::SCTVerifyStatus> sct_statuses; |
| 74 // True if PKP was bypassed due to a local trust anchor. | 77 // True if PKP was bypassed due to a local trust anchor. |
| 75 bool pkp_bypassed; | 78 bool pkp_bypassed; |
| 76 }; | 79 }; |
| 77 | 80 |
| 78 } // namespace content | 81 } // namespace content |
| 79 | 82 |
| 80 #endif // CONTENT_PUBLIC_COMMON_SSL_STATUS_H_ | 83 #endif // CONTENT_PUBLIC_COMMON_SSL_STATUS_H_ |
| OLD | NEW |