| 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_BROWSER_SSL_STATUS_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_SSL_STATUS_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_SSL_STATUS_H_ | 6 #define CONTENT_PUBLIC_BROWSER_SSL_STATUS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/public/common/security_style.h" | |
| 14 #include "net/cert/cert_status_flags.h" | 13 #include "net/cert/cert_status_flags.h" |
| 15 #include "net/cert/sct_status_flags.h" | 14 #include "net/cert/sct_status_flags.h" |
| 16 #include "net/cert/x509_certificate.h" | 15 #include "net/cert/x509_certificate.h" |
| 17 | 16 |
| 18 namespace net { | 17 namespace net { |
| 19 class SSLInfo; | 18 class SSLInfo; |
| 20 } | 19 } |
| 21 | 20 |
| 22 namespace content { | 21 namespace content { |
| 23 | 22 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 49 DISPLAYED_PASSWORD_FIELD_ON_HTTP = 1 << 4, | 48 DISPLAYED_PASSWORD_FIELD_ON_HTTP = 1 << 4, |
| 50 | 49 |
| 51 // HTTP page containing a credit card input. Embedders may use this to | 50 // HTTP page containing a credit card input. Embedders may use this to |
| 52 // adjust UI on nonsecure pages that collect sensitive data. | 51 // adjust UI on nonsecure pages that collect sensitive data. |
| 53 // TODO: integrate credit card detection to set this flag. | 52 // TODO: integrate credit card detection to set this flag. |
| 54 // https://crbug.com/647560 | 53 // https://crbug.com/647560 |
| 55 DISPLAYED_CREDIT_CARD_FIELD_ON_HTTP = 1 << 5, | 54 DISPLAYED_CREDIT_CARD_FIELD_ON_HTTP = 1 << 5, |
| 56 }; | 55 }; |
| 57 | 56 |
| 58 SSLStatus(); | 57 SSLStatus(); |
| 59 SSLStatus(SecurityStyle security_style, | 58 SSLStatus(scoped_refptr<net::X509Certificate> certificate, |
| 60 scoped_refptr<net::X509Certificate> certificate, | |
| 61 const net::SSLInfo& ssl_info); | 59 const net::SSLInfo& ssl_info); |
| 62 SSLStatus(const SSLStatus& other); | 60 SSLStatus(const SSLStatus& other); |
| 63 ~SSLStatus(); | 61 ~SSLStatus(); |
| 64 | 62 |
| 65 bool Equals(const SSLStatus& status) const { | 63 bool Equals(const SSLStatus& status) const { |
| 66 return security_style == status.security_style && | 64 return initialized == status.initialized && |
| 67 !!certificate == !!status.certificate && | 65 !!certificate == !!status.certificate && |
| 68 (certificate ? certificate->Equals(status.certificate.get()) : | 66 (certificate ? certificate->Equals(status.certificate.get()) |
| 69 true) && | 67 : true) && |
| 70 cert_status == status.cert_status && | 68 cert_status == status.cert_status && |
| 71 security_bits == status.security_bits && | 69 security_bits == status.security_bits && |
| 72 key_exchange_group == status.key_exchange_group && | 70 key_exchange_group == status.key_exchange_group && |
| 73 connection_status == status.connection_status && | 71 connection_status == status.connection_status && |
| 74 content_status == status.content_status && | 72 content_status == status.content_status && |
| 75 sct_statuses == status.sct_statuses && | 73 sct_statuses == status.sct_statuses && |
| 76 pkp_bypassed == status.pkp_bypassed; | 74 pkp_bypassed == status.pkp_bypassed; |
| 77 } | 75 } |
| 78 | 76 |
| 79 content::SecurityStyle security_style; | 77 bool initialized; |
| 80 scoped_refptr<net::X509Certificate> certificate; | 78 scoped_refptr<net::X509Certificate> certificate; |
| 81 net::CertStatus cert_status; | 79 net::CertStatus cert_status; |
| 82 int security_bits; | 80 int security_bits; |
| 83 uint16_t key_exchange_group; | 81 uint16_t key_exchange_group; |
| 84 int connection_status; | 82 int connection_status; |
| 85 // A combination of the ContentStatusFlags above. | 83 // A combination of the ContentStatusFlags above. |
| 86 int content_status; | 84 int content_status; |
| 87 // The validation statuses of the Signed Certificate Timestamps (SCTs) | 85 // The validation statuses of the Signed Certificate Timestamps (SCTs) |
| 88 // of Certificate Transparency (CT) that were served with the | 86 // of Certificate Transparency (CT) that were served with the |
| 89 // main resource. | 87 // main resource. |
| 90 std::vector<net::ct::SCTVerifyStatus> sct_statuses; | 88 std::vector<net::ct::SCTVerifyStatus> sct_statuses; |
| 91 // True if PKP was bypassed due to a local trust anchor. | 89 // True if PKP was bypassed due to a local trust anchor. |
| 92 bool pkp_bypassed; | 90 bool pkp_bypassed; |
| 93 }; | 91 }; |
| 94 | 92 |
| 95 } // namespace content | 93 } // namespace content |
| 96 | 94 |
| 97 #endif // CONTENT_PUBLIC_BROWSER_SSL_STATUS_H_ | 95 #endif // CONTENT_PUBLIC_BROWSER_SSL_STATUS_H_ |
| OLD | NEW |