| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/cert/cert_verify_result.h" | 5 #include "net/cert/cert_verify_result.h" |
| 6 | 6 |
| 7 #include <tuple> |
| 8 |
| 7 #include "net/cert/x509_certificate.h" | 9 #include "net/cert/x509_certificate.h" |
| 8 | 10 |
| 9 namespace net { | 11 namespace net { |
| 10 | 12 |
| 11 CertVerifyResult::CertVerifyResult() { | 13 CertVerifyResult::CertVerifyResult() { |
| 12 Reset(); | 14 Reset(); |
| 13 } | 15 } |
| 14 | 16 |
| 15 CertVerifyResult::CertVerifyResult(const CertVerifyResult& other) = default; | 17 CertVerifyResult::CertVerifyResult(const CertVerifyResult& other) = default; |
| 16 | 18 |
| 17 CertVerifyResult::~CertVerifyResult() { | 19 CertVerifyResult::~CertVerifyResult() { |
| 18 } | 20 } |
| 19 | 21 |
| 20 void CertVerifyResult::Reset() { | 22 void CertVerifyResult::Reset() { |
| 21 verified_cert = NULL; | 23 verified_cert = NULL; |
| 22 cert_status = 0; | 24 cert_status = 0; |
| 23 has_md2 = false; | 25 has_md2 = false; |
| 24 has_md4 = false; | 26 has_md4 = false; |
| 25 has_md5 = false; | 27 has_md5 = false; |
| 26 has_sha1 = false; | 28 has_sha1 = false; |
| 27 has_sha1_leaf = false; | 29 has_sha1_leaf = false; |
| 28 is_issued_by_known_root = false; | 30 is_issued_by_known_root = false; |
| 29 is_issued_by_additional_trust_anchor = false; | 31 is_issued_by_additional_trust_anchor = false; |
| 30 common_name_fallback_used = false; | 32 common_name_fallback_used = false; |
| 31 | 33 |
| 32 public_key_hashes.clear(); | 34 public_key_hashes.clear(); |
| 33 } | 35 } |
| 34 | 36 |
| 37 bool CertVerifyResult::operator==(const CertVerifyResult& other) const { |
| 38 return verified_cert->Equals(other.verified_cert.get()) && |
| 39 std::tie(cert_status, has_md2, has_md4, has_md5, has_sha1, |
| 40 has_sha1_leaf, public_key_hashes, is_issued_by_known_root, |
| 41 is_issued_by_additional_trust_anchor, |
| 42 common_name_fallback_used) == |
| 43 std::tie(other.cert_status, other.has_md2, other.has_md4, |
| 44 other.has_md5, other.has_sha1, other.has_sha1_leaf, |
| 45 other.public_key_hashes, other.is_issued_by_known_root, |
| 46 other.is_issued_by_additional_trust_anchor, |
| 47 other.common_name_fallback_used); |
| 48 } |
| 49 |
| 35 } // namespace net | 50 } // namespace net |
| OLD | NEW |