#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/certificate_transparency/chrome_ct_policy_enforcer.h"
#include <memory>
#include <string>
#include <utility>
#include "base/build_time.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_clock.h"
#include "base/time/time.h"
#include "base/version.h"
#include "components/certificate_transparency/ct_known_logs.h"
#include "crypto/rsa_private_key.h"
#include "crypto/sha2.h"
#include "net/cert/ct_policy_status.h"
#include "net/cert/x509_certificate.h"
#include "net/cert/x509_util.h"
#include "net/log/net_log_with_source.h"
#include "net/test/cert_test_util.h"
#include "net/test/ct_test_util.h"
#include "net/test/test_data_directory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
CTPolicyCompliance;
SCTList;
SignedCertificateTimestamp;
NetLogWithSource;
X509Certificate;
namespace certificate_transparency {
namespace {
const char kTestLogID[] = …;
static_assert …;
}
class ChromeCTPolicyEnforcerTest : public ::testing::Test { … };
TEST_F(ChromeCTPolicyEnforcerTest, DoesNotConformToCTPolicyNotEnoughFreshSCTs) { … }
TEST_F(ChromeCTPolicyEnforcerTest,
ConformsToCTPolicyWithMixOfEmbeddedAndNonEmbedded) { … }
TEST_F(ChromeCTPolicyEnforcerTest, ConformsToCTPolicyWithNonEmbeddedSCTs) { … }
TEST_F(ChromeCTPolicyEnforcerTest, EnforcementDisabledByBinaryAge) { … }
TEST_F(ChromeCTPolicyEnforcerTest, ConformsToCTPolicyWithEmbeddedSCTs) { … }
TEST_F(ChromeCTPolicyEnforcerTest,
ConformsToCTPolicyWithPooledNonEmbeddedSCTs) { … }
TEST_F(ChromeCTPolicyEnforcerTest, ConformsToCTPolicyWithPooledEmbeddedSCTs) { … }
TEST_F(ChromeCTPolicyEnforcerTest, DoesNotConformToCTPolicyNotEnoughSCTs) { … }
TEST_F(ChromeCTPolicyEnforcerTest,
ConformsWithDisqualifiedLogBeforeDisqualificationDate) { … }
TEST_F(ChromeCTPolicyEnforcerTest,
DoesNotConformWithDisqualifiedLogAfterDisqualificationDate) { … }
TEST_F(ChromeCTPolicyEnforcerTest,
DoesNotConformWithIssuanceDateAfterDisqualificationDate) { … }
TEST_F(ChromeCTPolicyEnforcerTest, IsLogDisqualifiedTimestamp) { … }
TEST_F(ChromeCTPolicyEnforcerTest, IsLogDisqualifiedReturnsFalseOnUnknownLog) { … }
TEST_F(ChromeCTPolicyEnforcerTest,
ConformsWithCTPolicyFutureRetirementDateLogs) { … }
TEST_F(ChromeCTPolicyEnforcerTest,
DoesNotConformWithCTPolicyPastRetirementDateLogs) { … }
TEST_F(ChromeCTPolicyEnforcerTest, UpdatedSCTRequirements) { … }
TEST_F(ChromeCTPolicyEnforcerTest,
DoesNotConformToCTPolicyAllLogsSameOperator) { … }
TEST_F(ChromeCTPolicyEnforcerTest, ConformsToCTPolicyDifferentOperators) { … }
TEST_F(ChromeCTPolicyEnforcerTest, ConformsToPolicyDueToOperatorSwitch) { … }
TEST_F(ChromeCTPolicyEnforcerTest, DoesNotConformToPolicyDueToOperatorSwitch) { … }
TEST_F(ChromeCTPolicyEnforcerTest, MultipleOperatorSwitches) { … }
TEST_F(ChromeCTPolicyEnforcerTest, MultipleOperatorSwitchesBeforeSCTTimestamp) { … }
}