Home
last modified time | relevance | path

Searched refs:cppbor (Results 1 – 25 of 26) sorted by relevance

12

/system/keymaster/contexts/
Dpure_soft_remote_provisioning_context.cpp74 std::unique_ptr<cppbor::Map>
76 auto result = std::make_unique<cppbor::Map>(cppbor::Map()); in CreateDeviceInfo()
79 result->add(cppbor::Tstr("brand"), cppbor::Tstr("Google")); in CreateDeviceInfo()
80 result->add(cppbor::Tstr("manufacturer"), cppbor::Tstr("Google")); in CreateDeviceInfo()
81 result->add(cppbor::Tstr("product"), cppbor::Tstr("Fake Product")); in CreateDeviceInfo()
82 result->add(cppbor::Tstr("model"), cppbor::Tstr("Fake Model")); in CreateDeviceInfo()
83 result->add(cppbor::Tstr("device"), cppbor::Tstr("Fake Device")); in CreateDeviceInfo()
85 result->add(cppbor::Tstr("bootloader_state"), cppbor::Tstr(*bootloader_state_)); in CreateDeviceInfo()
88 result->add(cppbor::Tstr("vb_state"), cppbor::Tstr(*verified_boot_state_)); in CreateDeviceInfo()
91 result->add(cppbor::Tstr("vbmeta_digest"), cppbor::Bstr(*vbmeta_digest_)); in CreateDeviceInfo()
[all …]
/system/security/identity/
DCredentialData.cpp79 cppbor::Map map; in saveToDisk()
87 cppbor::Array sacpArray; in saveToDisk()
89 cppbor::Array array; in saveToDisk()
101 cppbor::Map encryptedBlobsMap; in saveToDisk()
103 cppbor::Array encryptedChunkArray; in saveToDisk()
107 cppbor::Array entryDataArray; in saveToDisk()
109 cppbor::Array idsArray; in saveToDisk()
122 cppbor::Array authKeyDatasArray; in saveToDisk()
124 cppbor::Array array; in saveToDisk()
143 optional<SecureAccessControlProfile> parseSacp(const cppbor::Item& item) { in parseSacp()
[all …]
DWritableCredential.cpp121 cppbor::Array acpArray; in calcExpectedProofOfProvisioningSize()
123 cppbor::Map map; in calcExpectedProofOfProvisioningSize()
126 map.add("readerCertificate", cppbor::Bstr(profile.readerCertificate)); in calcExpectedProofOfProvisioningSize()
135 cppbor::Map dataMap; in calcExpectedProofOfProvisioningSize()
137 cppbor::Array entriesArray; in calcExpectedProofOfProvisioningSize()
141 auto [itemForValue, _, _2] = cppbor::parse(eParcel.value); in calcExpectedProofOfProvisioningSize()
145 cppbor::Map entryMap; in calcExpectedProofOfProvisioningSize()
148 cppbor::Array acpIdsArray; in calcExpectedProofOfProvisioningSize()
158 cppbor::Array array; in calcExpectedProofOfProvisioningSize()
DCredential.cpp860 auto [item, _ /* newPos */, message] = cppbor::parse(credentialData); in extractDocType()
865 const cppbor::Array* array = item->asArray(); in extractDocType()
870 const cppbor::Tstr* tstr = ((*array)[0])->asTstr(); in extractDocType()
/system/keymaster/cppcose/
Dcppcose.cpp239 auto macStructure = cppbor::Array() in generateCoseMac0Mac()
241 .add(cppbor::Map().add(ALGORITHM, HMAC_256).canonicalize().encode()) in generateCoseMac0Mac()
254 ErrMsgOr<cppbor::Array> constructCoseMac0(HmacSha256Function macFunction, in constructCoseMac0()
259 return cppbor::Array() in constructCoseMac0()
260 .add(cppbor::Map().add(ALGORITHM, HMAC_256).canonicalize().encode()) in constructCoseMac0()
261 .add(cppbor::Map() /* unprotected */) in constructCoseMac0()
266 ErrMsgOr<bytevec /* payload */> verifyAndParseCoseMac0(const cppbor::Item* macItem, in verifyAndParseCoseMac0()
281 auto [protectedMap, _, errMsg] = cppbor::parse(protectedParms); in verifyAndParseCoseMac0()
306 bytevec signatureInput = cppbor::Array() in createECDSACoseSign1Signature()
320 bytevec signatureInput = cppbor::Array() in createCoseSign1Signature()
[all …]
/system/keymaster/android_keymaster/
Dremote_provisioning_utils.cpp73 cppbor::parse(endpointEncryptionCertChain.begin(), endpointEncryptionCertChain.end()); in validateAndExtractEekPubAndId()
80 const cppbor::Array* certArr = item->asArray(); in validateAndExtractEekPubAndId()
131 StatusOr<cppbor::Array /* pubkeys */>
134 auto pubKeysToMac = cppbor::Array(); in validateAndExtractPubkeys()
137 cppbor::parse(keysToSign[i].begin(), keysToSign[i].end()); in validateAndExtractPubkeys()
153 auto [protectedMap, __, errMsg] = cppbor::parse(protectedParms); in validateAndExtractPubkeys()
196 cppbor::Array buildCertReqRecipients(const std::vector<uint8_t>& pubkey, in buildCertReqRecipients()
198 return cppbor::Array() // Array of recipients in buildCertReqRecipients()
199 .add(cppbor::Array() // Recipient in buildCertReqRecipients()
200 .add(cppbor::Map() // Protected in buildCertReqRecipients()
[all …]
Dandroid_keymaster.cpp409 cppbor::Map cose_public_key_map = cppbor::Map() in GenerateRkpKey()
416 cose_public_key_map.add(CoseKey::TEST_KEY, cppbor::Null()); in GenerateRkpKey()
480 std::unique_ptr<cppbor::Map> device_info_map = in GenerateCsr()
487 cppbor::Array() /* AAD */ in GenerateCsr()
1043 cppbor::SemanticTag(kRoTVersion1, cppbor::Array( // in GetRootOfTrust()
1057 cppbor::SemanticTag(cppcose::kCoseMac0SemanticTag, *std::move(maced_root_of_trust)) in GetRootOfTrust()
/system/keymaster/include/keymaster/cppcose/
Dcppcose.h152 auto [parsedKey, _, errMsg] = cppbor::parse(coseKey); in parse()
155 return CoseKey(static_cast<cppbor::Map*>(parsedKey.release())); in parse()
262 const cppbor::Map& getMap() const { return *key_; } in getMap()
263 cppbor::Map&& moveMap() { return std::move(*key_); } in moveMap()
276 explicit CoseKey(cppbor::Map* parsedKey) : key_(parsedKey) {} in CoseKey()
279 std::unique_ptr<cppbor::Map> key_;
288 ErrMsgOr<cppbor::Array> constructCoseMac0(HmacSha256Function macFunction,
290 ErrMsgOr<bytevec /* payload */> verifyAndParseCoseMac0(const cppbor::Item* macItem,
295 ErrMsgOr<cppbor::Array> constructCoseSign1(const bytevec& key, const bytevec& payload,
297 ErrMsgOr<cppbor::Array> constructCoseSign1(const bytevec& key, cppbor::Map extraProtectedFields,
[all …]
/system/keymaster/include/keymaster/contexts/
Dpure_soft_remote_provisioning_context.h41 std::unique_ptr<cppbor::Map> CreateDeviceInfo(uint32_t csrVersion) const override;
49 cppcose::ErrMsgOr<cppbor::Array> BuildCsr(const std::vector<uint8_t>& challenge,
50 cppbor::Array keysToSign) const override;
62 std::pair<std::vector<uint8_t>, cppbor::Array> GenerateBcc(bool testMode) const;
78 mutable cppbor::Array bcc_;
/system/keymaster/include/keymaster/
Dremote_provisioning_context.h37 virtual std::unique_ptr<cppbor::Map> CreateDeviceInfo(uint32_t csrVersion) const = 0;
47 virtual cppcose::ErrMsgOr<cppbor::Array> BuildCsr(const std::vector<uint8_t>& challenge,
48 cppbor::Array keysToSign) const = 0;
Dremote_provisioning_utils.h72 StatusOr<cppbor::Array /* pubkeys */>
76 cppbor::Array buildCertReqRecipients(const std::vector<uint8_t>& pubkey,
/system/libcppbor/
Drules.mk22 $(LOCAL_DIR)/src/cppbor.cpp \
25 MODULE_EXPORT_INCLUDES += $(LOCAL_DIR)/include/cppbor/
DAndroid.bp50 "src/cppbor.cpp",
54 "include/cppbor",
75 "src/cppbor.cpp",
79 "include/cppbor",
DREADME.md70 cppbor::Uint val(0);
78 ``` using cppbor::Map;
79 using cppbor::Array;
101 using cppbor::Map;
102 using cppbor::Array;
155 using namespace cppbor; // For example brevity
/system/keymaster/km_openssl/
Dattestation_record.cpp68 static cppbor::Bstr blob_to_bstr(const keymaster_blob_t& blob) { in blob_to_bstr()
69 return cppbor::Bstr(std::pair(blob.data, blob.data_length)); in blob_to_bstr()
72 static keymaster_error_t bstr_to_blob(const cppbor::Bstr* bstr, keymaster_blob_t* blob) { in bstr_to_blob()
136 std::unordered_map<EatClaim, cppbor::Array>* fields_map) { in add_repeating_enum()
141 fields_map->insert({key, cppbor::Array().add(value)}); in add_repeating_enum()
146 insert_unknown_tag(const keymaster_key_param_t& param, cppbor::Map* dest_map, in insert_unknown_tag()
147 std::unordered_map<EatClaim, cppbor::Array>* fields_map) { in insert_unknown_tag()
192 keymaster_error_t imei_to_ueid(const keymaster_blob_t& imei_blob, cppbor::Bstr* out) { in imei_to_ueid()
204 *out = cppbor::Bstr(std::pair(ueid, sizeof(ueid))); in imei_to_ueid()
208 keymaster_error_t ueid_to_imei_blob(const cppbor::Bstr* ueid, keymaster_blob_t* out) { in ueid_to_imei_blob()
[all …]
/system/keymaster/tests/
Dattestation_record_test.cpp341 auto [top_level_item, next_pos, error] = cppbor::parse(eat.data(), eat.size()); in TEST()
343 const cppbor::Map* eat_map = top_level_item->asMap(); in TEST()
349 const cppbor::Int* root_key = eat_key->asInt(); in TEST()
351 const cppbor::Map* submods_map = eat_value->asMap(); in TEST()
355 const cppbor::Map* submod_map = submod_value->asMap(); in TEST()
360 const cppbor::Int* key_int = key_item->asInt(); in TEST()
/system/security/provisioner/
Drkp_factory_extraction_lib.cpp53 using namespace cppbor;
208 auto [parsedCsr, _, csrErrMsg] = cppbor::parse(csr); in composeCertificateRequestV3()
226 CborResult<cppbor::Array> getCsrV3(std::string_view componentName, in getCsrV3()
240 auto result = verifyFactoryCsr(/*keysToSign=*/cppbor::Array(), csr, irpc, challenge); in getCsrV3()
Drkp_factory_extraction_lib.h47 CborResult<cppbor::Array>
Drkp_factory_extraction_tool.cpp38 using namespace cppbor;
Drkp_factory_extraction_lib_test.cpp44 using namespace ::cppbor;
47 namespace cppbor { namespace
/system/libcppbor/include/cppbor/
Dcppbor_parse.h21 namespace cppbor {
Dcppbor.h45 namespace cppbor {
258 return ::cppbor::encodeHeader(type(), addlInfo, pos, end); in encodeHeader()
265 ::cppbor::encodeHeader(type(), addlInfo, encodeCallback); in encodeHeader()
/system/libcppbor/src/
Dcppbor.cpp35 namespace cppbor { namespace
568 pos = ::cppbor::encodeHeader(kMajorType, mValue, pos, end); in encode()
576 ::cppbor::encodeHeader(kMajorType, mValue, encodeCallback); in encode()
Dcppbor_parse.cpp32 namespace cppbor { namespace
/system/keymaster/include/keymaster/km_openssl/
Dattestation_record.h385 EatSecurityLevel security_level, cppbor::Map* submod);
398 keymaster_error_t parse_eat_submod(const cppbor::Map* submod_values,

12