chromium/third_party/openscreen/src/cast/common/certificate/cast_crl.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "cast/common/certificate/cast_crl.h"

#include <time.h>

#include <memory>

#include "cast/common/certificate/date_time.h"
#include "cast/common/public/parsed_certificate.h"
#include "cast/common/public/trust_store.h"
#include "platform/base/macros.h"
#include "util/crypto/sha2.h"
#include "util/osp_logging.h"
#include "util/span_util.h"

namespace openscreen::cast {
namespace {

enum CrlVersion {};

// Verifies the CRL is signed by a trusted CRL authority at the time the CRL
// was issued. Verifies the signature of |tbs_crl| is valid based on the
// certificate and signature in |crl|. The validity of |tbs_crl| is verified
// at |time|. The validity period of the CRL is adjusted to be the earliest
// of the issuer certificate chain's expiration and the CRL's expiration and
// the result is stored in |overall_not_after|.
bool VerifyCRL(const proto::Crl& crl,
               const proto::TbsCrl& tbs_crl,
               const DateTime& time,
               TrustStore* trust_store,
               DateTime* overall_not_after) {}

}  // namespace

CastCRL::CastCRL(const proto::TbsCrl& tbs_crl,
                 const DateTime& overall_not_after) {}

CastCRL::~CastCRL() {}

// Verifies the revocation status of the certificate chain, at the specified
// time.
bool CastCRL::CheckRevocation(
    const std::vector<const ParsedCertificate*>& trusted_chain,
    const DateTime& time) const {}

std::unique_ptr<CastCRL> ParseAndVerifyCRL(const std::string& crl_proto,
                                           const DateTime& time,
                                           TrustStore* trust_store) {}

}  // namespace openscreen::cast