summaryrefslogtreecommitdiff
path: root/chromium/net/cert/ct_verify_result.cc
blob: 5587b67ed78ad1e19dc8d291f5561624ebded2b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "net/cert/ct_verify_result.h"

#include "net/cert/ct_policy_status.h"

namespace net {

namespace ct {

CTVerifyResult::CTVerifyResult()
    : ct_policies_applied(false),
      cert_policy_compliance(
          ct::CertPolicyCompliance::CERT_POLICY_NOT_ENOUGH_SCTS),
      ev_policy_compliance(ct::EVPolicyCompliance::EV_POLICY_DOES_NOT_APPLY) {}

CTVerifyResult::CTVerifyResult(const CTVerifyResult& other) = default;

CTVerifyResult::~CTVerifyResult() {}

SCTList SCTsMatchingStatus(
    const SignedCertificateTimestampAndStatusList& sct_and_status_list,
    SCTVerifyStatus match_status) {
  SCTList result;
  for (const auto& sct_and_status : sct_and_status_list)
    if (sct_and_status.status == match_status)
      result.push_back(sct_and_status.sct);

  return result;
}

}  // namespace ct

}  // namespace net