#include "net/test/revocation_builder.h"
#include <string_view>
#include "base/containers/span.h"
#include "base/functional/callback.h"
#include "base/hash/sha1.h"
#include "base/strings/string_util.h"
#include "base/test/bind.h"
#include "net/cert/asn1_util.h"
#include "net/cert/time_conversions.h"
#include "net/cert/x509_util.h"
#include "net/test/cert_builder.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/boringssl/src/include/openssl/bytestring.h"
#include "third_party/boringssl/src/include/openssl/mem.h"
#include "third_party/boringssl/src/pki/input.h"
namespace net {
namespace {
std::string Sha1() { … }
bool CBBAddBytes(CBB* cbb, std::string_view bytes) { … }
bool CBBAddBytes(CBB* cbb, base::span<const uint8_t> data) { … }
bool CBBAddGeneralizedTime(CBB* cbb, const base::Time& time) { … }
std::string FinishCBB(CBB* cbb) { … }
std::string PKeyToSPK(const EVP_PKEY* pkey) { … }
std::string EncodeOCSPResponse(
bssl::OCSPResponse::ResponseStatus response_status,
bssl::der::Input response_type,
std::string response) { … }
bool AddOCSPSingleResponse(CBB* responses_cbb,
const OCSPBuilderSingleResponse& response,
const std::string& issuer_name_hash,
const std::string& issuer_key_hash) { … }
}
std::string BuildOCSPResponseError(
bssl::OCSPResponse::ResponseStatus response_status) { … }
std::string BuildOCSPResponse(
const std::string& responder_subject,
EVP_PKEY* responder_key,
base::Time produced_at,
const std::vector<OCSPBuilderSingleResponse>& responses) { … }
std::string BuildOCSPResponseWithResponseData(
EVP_PKEY* responder_key,
const std::string& tbs_response_data,
std::optional<bssl::SignatureAlgorithm> signature_algorithm) { … }
std::string BuildCrlWithSigner(
const std::string& crl_issuer_subject,
EVP_PKEY* crl_issuer_key,
const std::vector<uint64_t>& revoked_serials,
const std::string& signature_algorithm_tlv,
base::OnceCallback<bool(std::string, CBB*)> signer) { … }
std::string BuildCrl(
const std::string& crl_issuer_subject,
EVP_PKEY* crl_issuer_key,
const std::vector<uint64_t>& revoked_serials,
std::optional<bssl::SignatureAlgorithm> signature_algorithm) { … }
std::string BuildCrlWithAlgorithmTlvAndDigest(
const std::string& crl_issuer_subject,
EVP_PKEY* crl_issuer_key,
const std::vector<uint64_t>& revoked_serials,
const std::string& signature_algorithm_tlv,
const EVP_MD* digest) { … }
}