Move ASOP factory extraction tool to its own directory

Moved some source to common folder.
Added uploading script which is also shared by CE CDM partners.
Added README.

Test: m wv_factory_extraction_tool
Bug: 414642286
Change-Id: I565027b75528ab28f9f1eb8d9086c0213de992d0
This commit is contained in:
conglin
2025-06-10 18:20:43 +00:00
parent 1f77085571
commit 7496c1c84c
14 changed files with 555 additions and 7 deletions

View File

@@ -0,0 +1,49 @@
// Copyright 2023 Google LLC. All Rights Reserved. This file and proprietary
// source code may only be used and distributed under the Widevine License
// Agreement.
#ifndef BCC_PARSER_H_
#define BCC_PARSER_H_
#include <cppbor.h>
#include <stddef.h>
#include <stdint.h>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
namespace widevine {
// BccParser processes a Provisioning 4.0 device root of trust. It extracts
// relevant pieces of information and outputs to std::string.
// Relevant documents:
// Android definition: go/remote-provisioning-hal#bcc.
// Google Dice Profile: go/dice-profile
class BccParser {
public:
explicit BccParser() {}
virtual ~BccParser() = default;
BccParser(const BccParser&) = delete;
BccParser& operator=(const BccParser&) = delete;
// Parse and verify a client generated root of trust. This message is part of
// an attestation model conforming to the Google Open Dice Profile. This
// message is received from a client device to attest it is a valid Widevine
// device.
virtual std::string Parse(const std::vector<uint8_t>& bcc);
private:
// Process and print CoseKey PubKeyEd25519 / PubKeyECDSA256.
bool ProcessDevicePublicKeyInfo(std::stringstream& ss,
const cppbor::Map& public_key_info_map);
// Process and print the DiceChainEntryPayload, which contains subject public
// key.
bool ProcessDiceChainEntryPayload(std::stringstream& ss,
std::string& payload);
};
} // namespace widevine
#endif // BCC_PARSER_H_