Roll src/third_party/WebKit eac3800:0237a66 (svn 202606:202607)
[chromium-blink-merge.git] / net / ssl / ssl_info.cc
blobd3aae9d8f54e77708ffc78e65f3b38a813bebc3c
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
3 // found in the LICENSE file.
5 #include "net/ssl/ssl_info.h"
7 #include "base/pickle.h"
8 #include "net/cert/cert_status_flags.h"
9 #include "net/cert/signed_certificate_timestamp.h"
10 #include "net/cert/x509_certificate.h"
12 namespace net {
14 SSLInfo::SSLInfo() {
15 Reset();
18 SSLInfo::SSLInfo(const SSLInfo& info) {
19 *this = info;
22 SSLInfo::~SSLInfo() {
25 SSLInfo& SSLInfo::operator=(const SSLInfo& info) {
26 cert = info.cert;
27 unverified_cert = info.unverified_cert;
28 cert_status = info.cert_status;
29 security_bits = info.security_bits;
30 key_exchange_info = info.key_exchange_info;
31 connection_status = info.connection_status;
32 is_issued_by_known_root = info.is_issued_by_known_root;
33 client_cert_sent = info.client_cert_sent;
34 channel_id_sent = info.channel_id_sent;
35 handshake_type = info.handshake_type;
36 public_key_hashes = info.public_key_hashes;
37 signed_certificate_timestamps = info.signed_certificate_timestamps;
38 pinning_failure_log = info.pinning_failure_log;
40 return *this;
43 void SSLInfo::Reset() {
44 cert = NULL;
45 unverified_cert = NULL;
46 cert_status = 0;
47 security_bits = -1;
48 key_exchange_info = 0;
49 connection_status = 0;
50 is_issued_by_known_root = false;
51 client_cert_sent = false;
52 channel_id_sent = false;
53 handshake_type = HANDSHAKE_UNKNOWN;
54 public_key_hashes.clear();
55 signed_certificate_timestamps.clear();
56 pinning_failure_log.clear();
59 void SSLInfo::SetCertError(int error) {
60 cert_status |= MapNetErrorToCertStatus(error);
63 } // namespace net