#include "components/web_package/signed_web_bundles/integrity_block_parser.h"
#include "base/containers/map_util.h"
#include "base/functional/bind.h"
#include "base/strings/to_string.h"
#include "base/types/expected.h"
#include "base/types/expected_macros.h"
#include "components/web_package/input_reader.h"
#include "components/web_package/mojom/web_bundle_parser.mojom.h"
#include "components/web_package/signed_web_bundles/attribute_map_parser.h"
#include "components/web_package/signed_web_bundles/constants.h"
#include "components/web_package/signed_web_bundles/integrity_block_attributes.h"
#include "components/web_package/signed_web_bundles/signature_entry_parser.h"
#include "components/web_package/signed_web_bundles/types.h"
namespace web_package {
namespace {
std::optional<base::span<const uint8_t>> ReadByteStringWithHeader(
InputReader& input) { … }
}
IntegrityBlockParser::IntegrityBlockParser(
mojom::BundleDataSource& data_source,
WebBundleParser::ParseIntegrityBlockCallback callback)
: … { … }
IntegrityBlockParser::~IntegrityBlockParser() { … }
void IntegrityBlockParser::StartParsing(
WebBundleParser::WebBundleSectionParser::ParsingCompleteCallback callback) { … }
void IntegrityBlockParser::ParseMagicBytesAndVersion(
const std::optional<BinaryData>& data) { … }
void IntegrityBlockParser::ReadAttributes() { … }
void IntegrityBlockParser::ParseAttributes(
AttributeMapParser::ParsingResult result) { … }
void IntegrityBlockParser::ReadAttributesBytes(
std::string web_bundle_id,
const std::optional<BinaryData>& data) { … }
void IntegrityBlockParser::ReadSignatureStack() { … }
void IntegrityBlockParser::ParseSignatureStack(
const std::optional<BinaryData>& data) { … }
void IntegrityBlockParser::ReadSignatureStackEntry() { … }
void IntegrityBlockParser::NextSignatureStackEntry(
base::expected<
std::pair<mojom::BundleIntegrityBlockSignatureStackEntryPtr, uint64_t>,
std::string> result) { … }
void IntegrityBlockParser::RunSuccessCallback() { … }
void IntegrityBlockParser::RunErrorCallback(
const std::string& message,
mojom::BundleParseErrorType error_type) { … }
}