#include "net/cert/ct_log_verifier.h"
#include <string.h>
#include <bit>
#include <string_view>
#include <vector>
#include "base/logging.h"
#include "base/notreached.h"
#include "crypto/openssl_util.h"
#include "crypto/sha2.h"
#include "net/cert/ct_log_verifier_util.h"
#include "net/cert/ct_serialization.h"
#include "net/cert/merkle_audit_proof.h"
#include "net/cert/merkle_consistency_proof.h"
#include "net/cert/signed_tree_head.h"
#include "third_party/boringssl/src/include/openssl/bytestring.h"
#include "third_party/boringssl/src/include/openssl/evp.h"
namespace net {
namespace {
const unsigned char kSHA256EmptyStringHash[ct::kSthRootHashLength] = …;
const EVP_MD* GetEvpAlg(ct::DigitallySigned::HashAlgorithm alg) { … }
}
scoped_refptr<const CTLogVerifier> CTLogVerifier::Create(
std::string_view public_key,
std::string description) { … }
CTLogVerifier::CTLogVerifier(std::string description)
: … { … }
bool CTLogVerifier::Verify(const ct::SignedEntryData& entry,
const ct::SignedCertificateTimestamp& sct) const { … }
bool CTLogVerifier::VerifySignedTreeHead(
const ct::SignedTreeHead& signed_tree_head) const { … }
bool CTLogVerifier::SignatureParametersMatch(
const ct::DigitallySigned& signature) const { … }
bool CTLogVerifier::VerifyConsistencyProof(
const ct::MerkleConsistencyProof& proof,
const std::string& old_tree_hash,
const std::string& new_tree_hash) const { … }
bool CTLogVerifier::VerifyAuditProof(const ct::MerkleAuditProof& proof,
const std::string& root_hash,
const std::string& leaf_hash) const { … }
CTLogVerifier::~CTLogVerifier() = default;
bool CTLogVerifier::Init(std::string_view public_key) { … }
bool CTLogVerifier::VerifySignature(std::string_view data_to_sign,
std::string_view signature) const { … }
}