1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/public/browser/ssl_status.h"
6
7 #include "net/cert/sct_status_flags.h"
8 #include "net/ssl/ssl_info.h"
9
10 namespace content {
11
SSLStatus()12 SSLStatus::SSLStatus()
13 : initialized(false),
14 cert_status(0),
15 key_exchange_group(0),
16 peer_signature_algorithm(0),
17 connection_status(0),
18 content_status(NORMAL_CONTENT),
19 pkp_bypassed(false),
20 ct_policy_compliance(net::ct::CTPolicyCompliance::
21 CT_POLICY_COMPLIANCE_DETAILS_NOT_AVAILABLE) {}
22
SSLStatus(const net::SSLInfo & ssl_info)23 SSLStatus::SSLStatus(const net::SSLInfo& ssl_info)
24 : initialized(true),
25 certificate(ssl_info.cert),
26 cert_status(ssl_info.cert_status),
27 public_key_hashes(ssl_info.public_key_hashes),
28 key_exchange_group(ssl_info.key_exchange_group),
29 peer_signature_algorithm(ssl_info.peer_signature_algorithm),
30 connection_status(ssl_info.connection_status),
31 content_status(NORMAL_CONTENT),
32 pkp_bypassed(ssl_info.pkp_bypassed),
33 ct_policy_compliance(ssl_info.ct_policy_compliance) {}
34
SSLStatus(const SSLStatus & other)35 SSLStatus::SSLStatus(const SSLStatus& other)
36 : initialized(other.initialized),
37 certificate(other.certificate),
38 cert_status(other.cert_status),
39 public_key_hashes(other.public_key_hashes),
40 key_exchange_group(other.key_exchange_group),
41 peer_signature_algorithm(other.peer_signature_algorithm),
42 connection_status(other.connection_status),
43 content_status(other.content_status),
44 pkp_bypassed(other.pkp_bypassed),
45 ct_policy_compliance(other.ct_policy_compliance),
46 user_data(other.user_data ? other.user_data->Clone() : nullptr) {}
47
operator =(SSLStatus other)48 SSLStatus& SSLStatus::operator=(SSLStatus other) {
49 initialized = other.initialized;
50 certificate = other.certificate;
51 cert_status = other.cert_status;
52 public_key_hashes = other.public_key_hashes;
53 key_exchange_group = other.key_exchange_group;
54 peer_signature_algorithm = other.peer_signature_algorithm;
55 connection_status = other.connection_status;
56 content_status = other.content_status;
57 pkp_bypassed = other.pkp_bypassed;
58 ct_policy_compliance = other.ct_policy_compliance;
59 user_data = other.user_data ? other.user_data->Clone() : nullptr;
60 return *this;
61 }
62
~SSLStatus()63 SSLStatus::~SSLStatus() {}
64
65 } // namespace content
66