| 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 #include "net/ssl/ssl_info.h" | 5 #include "net/ssl/ssl_info.h" |
| 6 | 6 |
| 7 #include "base/pickle.h" |
| 7 #include "net/cert/cert_status_flags.h" | 8 #include "net/cert/cert_status_flags.h" |
| 9 #include "net/cert/signed_certificate_timestamp.h" |
| 8 #include "net/cert/x509_certificate.h" | 10 #include "net/cert/x509_certificate.h" |
| 9 | 11 |
| 10 namespace net { | 12 namespace net { |
| 11 | 13 |
| 14 SignedCertificateTimestampAndStatus::SignedCertificateTimestampAndStatus( |
| 15 const scoped_refptr<ct::SignedCertificateTimestamp>& sct, |
| 16 const net::SignedCertificateTimestampVerificationStatus status) |
| 17 : sct_(sct), status_(status) {} |
| 18 |
| 12 SSLInfo::SSLInfo() { | 19 SSLInfo::SSLInfo() { |
| 13 Reset(); | 20 Reset(); |
| 14 } | 21 } |
| 15 | 22 |
| 16 SSLInfo::SSLInfo(const SSLInfo& info) { | 23 SSLInfo::SSLInfo(const SSLInfo& info) { |
| 17 *this = info; | 24 *this = info; |
| 18 } | 25 } |
| 19 | 26 |
| 20 SSLInfo::~SSLInfo() { | 27 SSLInfo::~SSLInfo() { |
| 21 } | 28 } |
| 22 | 29 |
| 23 SSLInfo& SSLInfo::operator=(const SSLInfo& info) { | 30 SSLInfo& SSLInfo::operator=(const SSLInfo& info) { |
| 24 cert = info.cert; | 31 cert = info.cert; |
| 32 signed_certificate_timestamps = info.signed_certificate_timestamps; |
| 25 cert_status = info.cert_status; | 33 cert_status = info.cert_status; |
| 26 security_bits = info.security_bits; | 34 security_bits = info.security_bits; |
| 27 connection_status = info.connection_status; | 35 connection_status = info.connection_status; |
| 28 is_issued_by_known_root = info.is_issued_by_known_root; | 36 is_issued_by_known_root = info.is_issued_by_known_root; |
| 29 client_cert_sent = info.client_cert_sent; | 37 client_cert_sent = info.client_cert_sent; |
| 30 channel_id_sent = info.channel_id_sent; | 38 channel_id_sent = info.channel_id_sent; |
| 31 handshake_type = info.handshake_type; | 39 handshake_type = info.handshake_type; |
| 32 public_key_hashes = info.public_key_hashes; | 40 public_key_hashes = info.public_key_hashes; |
| 33 | 41 |
| 34 return *this; | 42 return *this; |
| 35 } | 43 } |
| 36 | 44 |
| 37 void SSLInfo::Reset() { | 45 void SSLInfo::Reset() { |
| 38 cert = NULL; | 46 cert = NULL; |
| 39 cert_status = 0; | 47 cert_status = 0; |
| 40 security_bits = -1; | 48 security_bits = -1; |
| 41 connection_status = 0; | 49 connection_status = 0; |
| 42 is_issued_by_known_root = false; | 50 is_issued_by_known_root = false; |
| 43 client_cert_sent = false; | 51 client_cert_sent = false; |
| 44 channel_id_sent = false; | 52 channel_id_sent = false; |
| 45 handshake_type = HANDSHAKE_UNKNOWN; | 53 handshake_type = HANDSHAKE_UNKNOWN; |
| 46 | 54 |
| 55 signed_certificate_timestamps.clear(); |
| 47 public_key_hashes.clear(); | 56 public_key_hashes.clear(); |
| 48 } | 57 } |
| 49 | 58 |
| 50 void SSLInfo::SetCertError(int error) { | 59 void SSLInfo::SetCertError(int error) { |
| 51 cert_status |= MapNetErrorToCertStatus(error); | 60 cert_status |= MapNetErrorToCertStatus(error); |
| 52 } | 61 } |
| 53 | 62 |
| 54 } // namespace net | 63 } // namespace net |
| OLD | NEW |