Home
last modified time | relevance | path

Searched refs:tlv (Results 1 - 21 of 21) sorted by relevance

/base/security/device_auth/common_lib/impl/src/
H A Dhc_tlv_parser.c21 HcBool ParseTlvHead(TlvBase *tlv, HcParcel *parcel) in ParseTlvHead() argument
24 if (!ParcelReadUint16Revert(parcel, &tlv->tag)) { in ParseTlvHead()
28 if (!ParcelReadUint16(parcel, &tlv->tag)) { in ParseTlvHead()
33 if (tlv->tag != tlv->checkTag) { in ParseTlvHead()
37 if (!ParcelReadUint16Revert(parcel, &tlv->length)) { in ParseTlvHead()
41 if (!ParcelReadUint16(parcel, &tlv->length)) { in ParseTlvHead()
45 if (tlv->length > MAX_TLV_LENGTH) { in ParseTlvHead()
51 int32_t ParseTlvNode(TlvBase *tlv, HcParcel *parcel, HcBool strict) in ParseTlvNode() argument
53 if (!ParseTlvHead(tlv, parce in ParseTlvNode()
69 GetlenTlvNode(TlvBase *tlv) GetlenTlvNode() argument
80 DeinitTlvNode(TlvBase *tlv) DeinitTlvNode() argument
87 EncodeTlvNode(TlvBase *tlv, HcParcel *parcel, HcBool isRoot) EncodeTlvNode() argument
126 GetEmptyStructNode(TlvBase *tlv, unsigned short tag) GetEmptyStructNode() argument
145 CheckStructNodeAllHasValue(TlvBase *tlv) CheckStructNodeAllHasValue() argument
164 SetStructNodeHasValue(TlvBase *tlv) SetStructNodeHasValue() argument
193 ParseTlvStruct(TlvBase *tlv, HcParcel *parcel, HcBool strict) ParseTlvStruct() argument
239 EncodeTlvStruct(TlvBase *tlv, HcParcel *parcel) EncodeTlvStruct() argument
262 GetLenTlvStruct(TlvBase *tlv) GetLenTlvStruct() argument
285 DeinitTlvStruct(TlvBase *tlv) DeinitTlvStruct() argument
332 ParseTlvBuffer(TlvBase *tlv, HcParcel *parcel, HcBool strict) ParseTlvBuffer() argument
343 GetlenTlvBuffer(TlvBase *tlv) GetlenTlvBuffer() argument
349 EncodeTlvBuffer(TlvBase *tlv, HcParcel *parcel) EncodeTlvBuffer() argument
364 DeinitTlvBuffer(TlvBase *tlv) DeinitTlvBuffer() argument
369 InitTlvBuffer(TlvBuffer *tlv, unsigned short checkTag) InitTlvBuffer() argument
380 ParseTlvString(TlvBase *tlv, HcParcel *parcel, HcBool strict) ParseTlvString() argument
392 GetlenTlvString(TlvBase *tlv) GetlenTlvString() argument
398 EncodeTlvString(TlvBase *tlv, HcParcel *parcel) EncodeTlvString() argument
413 DeinitTlvString(TlvBase *tlv) DeinitTlvString() argument
418 InitTlvString(TlvString *tlv, unsigned short checkTag) InitTlvString() argument
438 DeinitTlvFixMember(TlvBase* tlv) DeinitTlvFixMember() argument
[all...]
/base/security/device_auth/common_lib/interfaces/
H A Dhc_tlv_parser.h52 void Init##TlvS(TlvS *tlv, unsigned short checkTag) \
56 (void)memset_s(&tlv->base, sizeof(tlv->base), 0, sizeof(tlv->base)); \
57 tlv->base.checkTag = GetTag(checkTag, CheckTag);
60 Init##TlvMember(&tlv->TlvMemberName, CheckTag); \
61 tlv->TlvMemberName.base.option = 1; \
62 tlv->offset[index++] = offsetof(TlvStructType, TlvMemberName);
65 Init##TlvMember(&tlv->TlvMemberName, CheckTag); \
66 tlv
[all...]
/base/security/device_security_level/baselib/utils/src/
H A Dutils_tlv.c31 static uint8_t *ParseTlv(const uint8_t *buffer, TlvCommon *tlv, const uint8_t *boundary, uint32_t *retCode) in ParseTlv() argument
41 tlv->tag = ((TlvCommon *)buffer)->tag; in ParseTlv()
42 tlv->len = ((TlvCommon *)buffer)->len; in ParseTlv()
43 tlv->value = (uint8_t *)buffer + TLV_TLV_HEAD_LEN; in ParseTlv()
48 static uint8_t *AppendTlv(uint8_t *buffer, const TlvCommon *tlv, const uint8_t *boundary, uint32_t *retCode) in AppendTlv() argument
54 if (buffer + ((TlvCommon *)tlv)->len + TLV_TLV_HEAD_LEN > boundary) { in AppendTlv()
58 ((TlvCommon *)buffer)->tag = tlv->tag; in AppendTlv()
59 ((TlvCommon *)buffer)->len = tlv->len; in AppendTlv()
60 if (tlv->len != 0 && tlv in AppendTlv()
70 Serialize(const TlvCommon *tlv, uint32_t tlvCount, uint8_t *buff, uint32_t maxBuffSize, uint32_t *buffSize) Serialize() argument
90 Deserialize(const uint8_t *buff, uint32_t buffSize, TlvCommon *tlv, uint32_t maxTlvCount, uint32_t *tlvCount) Deserialize() argument
[all...]
/base/security/huks/services/huks_standard/huks_engine/main/device_cert_manager/src/
H A Ddcm_asn1.c28 static void BuildTlvHeader(struct HksAsn1Blob *header, const struct HksAsn1Blob *tlv) in BuildTlvHeader() argument
30 uint32_t len = tlv->size; in BuildTlvHeader()
32 HKS_ASN1_ENCODE_BYTE(hptr, tlv->type); in BuildTlvHeader()
35 if ((tlv->type == ASN_1_TAG_TYPE_BIT_STR) || ((tlv->type == ASN_1_TAG_TYPE_INT) && in BuildTlvHeader()
36 (tlv->data[0] > ASN_1_MAX_VAL_NO_EXTRA_LEN_BYTE))) { in BuildTlvHeader()
58 static int32_t Asn1InsertValue(struct HksBlob *buf, struct HksAsn1Obj *obj, const struct HksAsn1Blob *tlv) in Asn1InsertValue() argument
60 struct HksAsn1Blob value = *tlv; in Asn1InsertValue()
61 if ((tlv->type != ASN_1_TAG_TYPE_OCT_STR) && (tlv in Asn1InsertValue()
100 DcmAsn1InsertValue(struct HksBlob *buf, struct HksAsn1Obj *obj, const struct HksAsn1Blob *tlv) DcmAsn1InsertValue() argument
120 DcmAsn1WriteFinal(struct HksBlob *final, const struct HksAsn1Blob *tlv) DcmAsn1WriteFinal() argument
[all...]
/base/startup/appspawn/standard/
H A Dappspawn_msgmgr.c29 APPSPAWN_CHECK(type < TLV_MAX, return NULL, "Invalid tlv type %{public}u", type); in GetAppSpawnMsgInfo()
51 AppSpawnTlvExt *tlv = (AppSpawnTlvExt *)data; in GetAppSpawnMsgExtInfo() local
52 if (strcmp(tlv->tlvName, name) != 0) { in GetAppSpawnMsgExtInfo()
56 *len = tlv->dataLen; in GetAppSpawnMsgExtInfo()
65 APPSPAWN_CHECK(type == TLV_MSG_FLAGS || type == TLV_PERMISSION, return 0, "Invalid tlv %{public}u ", type); in CheckAppSpawnMsgFlag()
67 APPSPAWN_CHECK(msgFlags != NULL, return 0, "No tlv %{public}u in msg", type); in CheckAppSpawnMsgFlag()
88 return APPSPAWN_ARG_INVALID, "Invalid tlv %{public}u ", type); in SetAppSpawnMsgFlag()
90 APPSPAWN_CHECK(msgFlags != NULL, return APPSPAWN_ARG_INVALID, "No tlv %{public}d in msg", type); in SetAppSpawnMsgFlag()
184 return APPSPAWN_MSG_INVALID, "Invalid property tlv offset for %{public}s", message->msgHeader.processName); in CheckAppSpawnMsg()
193 APPSPAWN_LOGE("No must tlv bundl in CheckAppSpawnMsg()
209 CheckExtTlvInfo(const AppSpawnTlv *tlv, uint32_t remainLen) CheckExtTlvInfo() argument
222 CheckMsgTlv(const AppSpawnTlv *tlv, uint32_t remainLen) CheckMsgTlv() argument
265 AppSpawnTlv *tlv = (AppSpawnTlv *)(message->buffer + currLen); DecodeAppSpawnMsg() local
355 DumpMsgExtInfo(const AppSpawnTlv *tlv) DumpMsgExtInfo() argument
[all...]
/base/startup/appspawn/interfaces/innerkits/client/
H A Dappspawn_msg.c38 static inline int CheckMsg(const AppSpawnReqMsgNode *reqNode, const AppSpawnTlv *tlv, const char *name) in CheckMsg() argument
40 if ((reqNode->msg->msgLen + tlv->tlvLen) > MAX_MSG_TOTAL_LENGTH) { in CheckMsg()
45 if (tlv->tlvType != TLV_RENDER_TERMINATION_INFO) { in CheckMsg()
46 APPSPAWN_LOGE("Not support tlv %{public}s for message MSG_GET_RENDER_TERMINATION_STATUS", name); in CheckMsg()
152 AppSpawnTlvExt tlv = {}; in AddAppDataEx() local
154 tlv.tlvLen = APPSPAWN_ALIGN(data->dataLen + 1) + sizeof(AppSpawnTlvExt); in AddAppDataEx()
156 tlv.tlvLen = APPSPAWN_ALIGN(data->dataLen) + sizeof(AppSpawnTlvExt); in AddAppDataEx()
158 tlv.tlvType = TLV_MAX; in AddAppDataEx()
159 tlv.dataLen = data->dataLen; in AddAppDataEx()
160 tlv in AddAppDataEx()
199 AppSpawnTlv tlv; AddAppData() local
241 AppSpawnTlv *tlv = (AppSpawnTlv *)(block->buffer + block->currentIndex); SetFlagsTlv() local
[all...]
/base/security/device_security_level/baselib/utils/include/
H A Dutils_tlv.h37 uint32_t Serialize(const TlvCommon *tlv, uint32_t tlvCount, uint8_t *buff, uint32_t maxBuffSize, uint32_t *buffSize);
39 uint32_t Deserialize(const uint8_t *buff, uint32_t buffSize, TlvCommon *tlv, uint32_t maxTlvCount, uint32_t *tlvCount);
/base/startup/appspawn/test/unittest/
H A Dapp_spawn_test_helper.cpp501 ret = AppSpawnReqMsgAddExtInfo(reqHandle, "tlv-name-1", in CreateMsg()
503 APPSPAWN_CHECK(ret == 0, break, "Failed to ext tlv %{public}s", processName_.c_str()); in CreateMsg()
631 // add tlv in CreateSendMsg()
638 return -1, "Failed add tlv to msg %{public}s", processName_.c_str()); in CreateSendMsg()
648 static int inline AddOneTlv(uint8_t *buffer, uint32_t bufferLen, const AppSpawnTlv &tlv, const uint8_t *data) in AddOneTlv() argument
650 if (tlv.tlvLen > bufferLen) { in AddOneTlv()
653 int ret = memcpy_s(buffer, bufferLen, &tlv, sizeof(tlv)); in AddOneTlv()
655 ret = memcpy_s(buffer + sizeof(tlv), bufferLen - sizeof(tlv), dat in AddOneTlv()
676 AppSpawnTlv tlv = {}; AddBaseTlv() local
[all...]
H A Dapp_spawn_test_helper.h128 int AppSpawnReqMsgSetFlags(AppSpawnReqMsgHandle reqHandle, uint32_t tlv, uint32_t flags) in AppSpawnReqMsgSetFlags() argument
132 if (tlv == TLV_MSG_FLAGS) { in AppSpawnReqMsgSetFlags()
134 } else if (tlv == TLV_PERMISSION) { in AppSpawnReqMsgSetFlags()
/base/update/updater/services/package/pkg_package/
H A Dpkg_upgradefile.cpp35 #define TLV_CHECK_AND_RETURN(tlv, tlvType, len, fileLen) \
37 if (!((tlv)->length < (fileLen) && (tlv)->length >= (len) && (tlv)->type == (tlvType) && \
38 ((tlv)->length + sizeof(PkgTlv)) < (fileLen))) { \
39 PKG_LOGE("Invalid tlv type: %d length %u ", tlvType, ((tlv)->length)); \
187 // 时间tlv in CheckPackageHeader()
246 // 组件的tlv in SavePackage()
280 PKG_LOGE("Invalid tlv typ in ReadSignData()
644 PkgTlv tlv; ReadComponents() local
678 ParsePkgHeaderToTlv(const PkgBuffer &buffer, size_t &currLen, PkgTlv &tlv) ParsePkgHeaderToTlv() argument
722 PkgTlv tlv; ReadUpgradePkgHeader() local
[all...]
H A Dpkg_upgradefile.h163 void ParsePkgHeaderToTlv(const PkgBuffer &buffer, size_t &currLen, PkgTlv &tlv);
/base/security/huks/test/unittest/huks_standard_test/module_test/service_test/huks_engine/core/src/
H A Dhks_asn1_test.cpp69 struct HksAsn1Blob tlv = { .type = 0, .size = sizeof(tlvData), .data = tlvData }; in HWTEST_F() local
70 int32_t ret = DcmAsn1InsertValue(&buf, nullptr, &tlv); in HWTEST_F()
/base/startup/appspawn/modules/native_adapter/
H A Dnative_adapter.cpp57 AppSpawnTlvExt *tlv = (AppSpawnTlvExt *)data; in BuildFdInfoMap() local
58 if (strcmp(tlv->tlvName, MSG_EXT_NAME_APP_FD) != 0) { in BuildFdInfoMap()
/base/security/huks/services/huks_standard/huks_engine/main/device_cert_manager/include/
H A Ddcm_asn1.h100 int32_t DcmAsn1InsertValue(struct HksBlob *buf, struct HksAsn1Obj *obj, const struct HksAsn1Blob *tlv);
102 int32_t DcmAsn1WriteFinal(struct HksBlob *final, const struct HksAsn1Blob *tlv);
/base/startup/appspawn/test/unittest/app_spawn_standard_test/
H A Dapp_spawn_appmgr_test.cpp459 AppSpawnTlv tlv = {}; in AddRenderTerminationTlv() local
460 tlv.tlvType = TLV_RENDER_TERMINATION_INFO; in AddRenderTerminationTlv()
462 tlv.tlvLen = sizeof(AppSpawnTlv) + sizeof(pid); in AddRenderTerminationTlv()
464 int ret = memcpy_s(buffer, bufferLen, &tlv, sizeof(tlv)); in AddRenderTerminationTlv()
466 ret = memcpy_s(buffer + sizeof(tlv), bufferLen - sizeof(tlv), &pid, tlv.tlvLen - sizeof(tlv)); in AddRenderTerminationTlv()
468 currLen += tlv in AddRenderTerminationTlv()
669 AppSpawnTlvExt tlv = {}; AddTest001ExtTlv() local
[all...]
/base/telephony/core_service/services/sim/src/
H A Dusim_dialling_numbers_service.cpp284 std::shared_ptr<UsimDiallingNumberFile> file, std::shared_ptr<TagService> tlv, int parentTag) in StorePbrDetailInfo()
286 if (tlv == nullptr) { in StorePbrDetailInfo()
287 TELEPHONY_LOGI("StorePbrDetailInfo: tlv is nullptr!"); in StorePbrDetailInfo()
290 for (int count = 0; tlv->Next(); ++count) { in StorePbrDetailInfo()
291 const int tag = tlv->GetTagCode(); in StorePbrDetailInfo()
300 tlv->GetValue(data); in StorePbrDetailInfo()
283 StorePbrDetailInfo( std::shared_ptr<UsimDiallingNumberFile> file, std::shared_ptr<TagService> tlv, int parentTag) StorePbrDetailInfo() argument
H A Dsim_file.cpp529 unsigned char *tlv = data.get(); in ParsePnn() local
536 if (recordLen >= (tagAndLength + static_cast<int>(tlv[NETWORK_NAME_LENGTH])) && in ParsePnn()
537 tlv[NETWORK_NAME_IEI] == (unsigned char)LONG_NAME_FLAG) { in ParsePnn()
539 SIMUtils::Gsm7bitConvertToString(tlv + NETWORK_NAME_TEXT_STRING, tlv[NETWORK_NAME_LENGTH] - 1); in ParsePnn()
541 int shortNameOffset = tagAndLength + tlv[NETWORK_NAME_LENGTH]; in ParsePnn()
544 (shortNameOffset + tagAndLength + static_cast<int>(tlv[shortNameOffset + NETWORK_NAME_LENGTH])) && in ParsePnn()
545 tlv[shortNameOffset + NETWORK_NAME_IEI] == (unsigned char)SHORT_NAME_FLAG) { in ParsePnn()
547 tlv + (shortNameOffset + NETWORK_NAME_TEXT_STRING), tlv[shortNameOffse in ParsePnn()
[all...]
/base/telephony/core_service/services/sim/include/
H A Dusim_dialling_numbers_service.h86 std::shared_ptr<TagService> tlv, int parentTag);
/base/startup/appspawn/modules/ace_adapter/
H A Dace_adapter.cpp164 AppSpawnTlvExt *tlv = (AppSpawnTlvExt *)data; in BuildFdInfoMap() local
165 if (strcmp(tlv->tlvName, MSG_EXT_NAME_APP_FD) != 0) { in BuildFdInfoMap()
/base/startup/init/test/systest/
H A Dloopserver_systest.c460 printf("Invalid property tlv offset %s \n", message->msgHeader.buffer); in CheckMsg()
473 printf("No must tlv bundle: %u flags: %u token: %u domain %u %u \n", in CheckMsg()
514 TlvExt *tlv = (TlvExt *)data; in GetMsgExtInfo() local
515 if (strcmp(tlv->tlvName, name) != 0) { in GetMsgExtInfo()
519 *len = tlv->dataLen; in GetMsgExtInfo()
/base/startup/appspawn/modules/common/
H A Dappspawn_common.c103 "No tlv %{public}d in msg %{public}s", TLV_DOMAIN_INFO, GetProcessName(property)); in SetKeepCapabilities()
231 "No tlv %{public}d in msg %{public}s", TLV_DAC_INFO, GetProcessName(property)); in SetUidGid()
517 AppSpawnTlvExt *tlv = (AppSpawnTlvExt *)data; in SetFdEnv() local
518 if (strcmp(tlv->tlvName, MSG_EXT_NAME_APP_FD) != 0) { in SetFdEnv()

Completed in 16 milliseconds