#include "net/test/ct_test_util.h"
#include <stdint.h>
#include <string.h>
#include <string_view>
#include <vector>
#include "base/base64.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "net/base/hex_utils.h"
#include "net/cert/ct_serialization.h"
#include "net/cert/merkle_tree_leaf.h"
#include "net/cert/signed_tree_head.h"
#include "net/cert/x509_certificate.h"
namespace net::ct {
namespace {
const char kDefaultDerCert[] = …;
const char kDefaultIssuerKeyHash[] = …;
const char kDefaultDerTbsCert[] = …;
const char kDefaultExtensions[] = …;
const char kTestDigitallySigned[] = …;
const char kTestSignedCertificateTimestamp[] = …;
const char kEcP256PublicKey[] = …;
const char kTestKeyId[] = …;
const int64_t kTestTimestamp = …1396877277237);
const char kTestSCTSignatureData[] = …;
const char kTestSCTPrecertSignatureData[] = …;
const char kFakeOCSPResponse[] = …
;
const char kFakeOCSPResponseCert[] = …;
const char kFakeOCSPResponseIssuerCert[] = …;
const char kFakeOCSPExtensionValue[] = …;
const char kSampleSTHSHA256RootHash[] = …;
const char kSampleSTHTreeHeadSignature[] = …;
size_t kSampleSTHTreeSize = …;
}
void GetX509CertSignedEntry(SignedEntryData* entry) { … }
void GetX509CertTreeLeaf(MerkleTreeLeaf* tree_leaf) { … }
std::string GetDerEncodedX509Cert() { … }
void GetPrecertSignedEntry(SignedEntryData* entry) { … }
void GetPrecertTreeLeaf(MerkleTreeLeaf* tree_leaf) { … }
std::string GetTestDigitallySigned() { … }
std::string GetTestSignedCertificateTimestamp() { … }
std::string GetTestPublicKey() { … }
std::string GetTestPublicKeyId() { … }
void GetX509CertSCT(scoped_refptr<SignedCertificateTimestamp>* sct_ref) { … }
void GetPrecertSCT(scoped_refptr<SignedCertificateTimestamp>* sct_ref) { … }
std::string GetDefaultIssuerKeyHash() { … }
std::string GetDerEncodedFakeOCSPResponse() { … }
std::string GetFakeOCSPExtensionValue() { … }
std::string GetDerEncodedFakeOCSPResponseCert() { … }
std::string GetDerEncodedFakeOCSPResponseIssuerCert() { … }
bool GetSampleSignedTreeHead(SignedTreeHead* sth) { … }
bool GetSampleEmptySignedTreeHead(SignedTreeHead* sth) { … }
bool GetBadEmptySignedTreeHead(SignedTreeHead* sth) { … }
std::string GetSampleSTHSHA256RootHash() { … }
std::string GetSampleSTHTreeHeadSignature() { … }
bool GetSampleSTHTreeHeadDecodedSignature(DigitallySigned* signature) { … }
std::string GetSampleSTHAsJson() { … }
std::string CreateSignedTreeHeadJsonString(size_t tree_size,
int64_t timestamp,
std::string sha256_root_hash,
std::string tree_head_signature) { … }
std::string CreateConsistencyProofJsonString(
const std::vector<std::string>& raw_nodes) { … }
std::string GetSCTListForTesting() { … }
std::string GetSCTListWithInvalidSCT() { … }
bool CheckForSingleVerifiedSCTInResult(
const SignedCertificateTimestampAndStatusList& scts,
const std::string& log_description) { … }
bool CheckForSCTOrigin(const SignedCertificateTimestampAndStatusList& scts,
ct::SignedCertificateTimestamp::Origin origin) { … }
}