chromium/third_party/openscreen/src/cast/common/certificate/cast_crl_unittest.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 "cast/common/certificate/cast_cert_validator.h"
#include "cast/common/certificate/date_time.h"
#include "cast/common/certificate/proto/test_suite.pb.h"
#include "cast/common/certificate/testing/test_helpers.h"
#include "cast/common/public/trust_store.h"
#include "gtest/gtest.h"
#include "platform/test/paths.h"
#include "util/osp_logging.h"
#include "util/read_file.h"

namespace openscreen::cast {

namespace {

// Indicates the expected result of test step's verification.
enum TestStepResult {};

// Verifies that the provided certificate chain is valid at the specified time
// and chains up to a trust anchor.
bool TestVerifyCertificate(TestStepResult expected_result,
                           const std::vector<std::string>& der_certs,
                           const DateTime& time,
                           TrustStore* cast_trust_store) {}

// Verifies that the provided Cast CRL is signed by a trusted issuer
// and that the CRL can be parsed successfully.
// The validity of the CRL is also checked at the specified time.
bool TestVerifyCRL(TestStepResult expected_result,
                   const std::string& crl_bundle,
                   const DateTime& time,
                   TrustStore* crl_trust_store) {}

// Verifies that the certificate chain provided is not revoked according to
// the provided Cast CRL at |cert_time|.
// The provided CRL is verified at |crl_time|.
// If |crl_required| is set, then a valid Cast CRL must be provided.
// Otherwise, a missing CRL is be ignored.
bool TestVerifyRevocation(Error::Code expected_result,
                          const std::vector<std::string>& der_certs,
                          const std::string& crl_bundle,
                          const DateTime& crl_time,
                          const DateTime& cert_time,
                          bool crl_required,
                          TrustStore* cast_trust_store,
                          TrustStore* crl_trust_store) {}

const std::string& GetSpecificTestDataPath() {}

bool RunTest(const proto::DeviceCertTest& test_case) {}

// Parses the provided test suite provided in wire-format proto.
// Each test contains the inputs and the expected output.
// To see the description of the test, execute the test.
// These tests are generated by a test generator in google3.
void RunTestSuite(const std::string& test_suite_file_name) {}

TEST(CastCertificateTest, TestSuite1) {}

}  // namespace
}  // namespace openscreen::cast