Home
last modified time | relevance | path

Searched refs:tlv (Results 1 – 12 of 12) sorted by relevance

/base/security/device_auth/common_lib/impl/src/
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, parcel)) { in ParseTlvNode()
56 if (GetParcelDataSize(parcel) < tlv->length) { in ParseTlvNode()
[all …]
/base/security/device_auth/common_lib/interfaces/
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->offset[index++] = offsetof(TlvStructType, TlvMemberName);
69 tlv->offsetCount = index; \
70 tlv->base.parse = ParseTlvStruct; \
[all …]
/base/security/device_security_level/baselib/utils/src/
Dutils_tlv.c31 static uint8_t *ParseTlv(const uint8_t *buffer, TlvCommon *tlv, const uint8_t *boundary, uint32_t *… 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 … 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->value != NULL) { in AppendTlv()
61 …y_s(buffer + TLV_TLV_HEAD_LEN, boundary - buffer - TLV_TLV_HEAD_LEN, tlv->value, tlv->len) != EOK)… in AppendTlv()
[all …]
/base/security/huks/services/huks_standard/huks_engine/main/device_cert_manager/src/
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 …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->type != ASN_1_TAG_TYPE_BIT_STR)) { in Asn1InsertValue()
86 obj->header.type = tlv->type; in Asn1InsertValue()
89 obj->value.type = tlv->type; in Asn1InsertValue()
[all …]
/base/security/device_security_level/baselib/utils/include/
Dutils_tlv.h37 uint32_t Serialize(const TlvCommon *tlv, uint32_t tlvCount, uint8_t *buff, uint32_t maxBuffSize, ui…
39 uint32_t Deserialize(const uint8_t *buff, uint32_t buffSize, TlvCommon *tlv, uint32_t maxTlvCount, …
/base/update/updater/services/package/pkg_package/
Dpkg_upgradefile.cpp34 #define TLV_CHECK_AND_RETURN(tlv, tlvType, len, fileLen) \ argument
36 if (!((tlv)->length < (fileLen) && (tlv)->length >= (len) && (tlv)->type == (tlvType) && \
37 ((tlv)->length + sizeof(PkgTlv)) < (fileLen))) { \
38 PKG_LOGE("Invalid tlv type: %d length %u ", tlvType, ((tlv)->length)); \
638 PkgTlv tlv; in ReadComponents() local
639 tlv.type = ReadLE16(buffer.buffer); in ReadComponents()
640 tlv.length = ReadLE16(buffer.buffer + sizeof(uint16_t)); in ReadComponents()
641 TLV_CHECK_AND_RETURN(&tlv, 5, sizeof(UpgradeCompInfo), fileLen); // component type is 5 in ReadComponents()
646 info.dataOffset = parsedLen + tlv.length + UPGRADE_RESERVE_LEN; in ReadComponents()
650 while (info.srcOffset < tlv.length) { in ReadComponents()
[all …]
Dpkg_upgradefile.h151 void ParsePkgHeaderToTlv(const PkgBuffer &buffer, size_t &currLen, PkgTlv &tlv);
/base/security/huks/services/huks_standard/huks_engine/main/device_cert_manager/include/
Ddcm_asn1.h100 …2_t DcmAsn1InsertValue(struct HksBlob *buf, struct HksAsn1Obj *obj, const struct HksAsn1Blob *tlv);
102 int32_t DcmAsn1WriteFinal(struct HksBlob *final, const struct HksAsn1Blob *tlv);
/base/security/huks/test/unittest/huks_standard_test/module_test/service_test/huks_engine/core/src/
Dhks_asn1_test.cpp71 struct HksAsn1Blob tlv = { .type = 0, .size = sizeof(tlvData), .data = tlvData }; variable
72 int32_t ret = DcmAsn1InsertValue(&buf, nullptr, &tlv);
/base/telephony/core_service/services/sim/src/
Dusim_dialling_numbers_service.cpp269 std::shared_ptr<UsimDiallingNumberFile> file, std::shared_ptr<TagService> tlv, int parentTag) in StorePbrDetailInfo() argument
271 for (int count = 0; tlv->Next(); ++count) { in StorePbrDetailInfo()
272 const int tag = tlv->GetTagCode(); in StorePbrDetailInfo()
281 tlv->GetValue(data); in StorePbrDetailInfo()
Dsim_file.cpp424 unsigned char *tlv = data.get(); in ParsePnn() local
428 if (recordLen >= (tagAndLength + static_cast<int>(tlv[NETWORK_NAME_LENGTH])) && in ParsePnn()
429 tlv[NETWORK_NAME_IEI] == (unsigned char)LONG_NAME_FLAG) { in ParsePnn()
431 … SIMUtils::Gsm7bitConvertToString(tlv + NETWORK_NAME_TEXT_STRING, tlv[NETWORK_NAME_LENGTH] - 1); in ParsePnn()
433 int shortNameOffset = tagAndLength + tlv[NETWORK_NAME_LENGTH]; in ParsePnn()
436 … static_cast<int>(tlv[shortNameOffset + NETWORK_NAME_LENGTH])) && in ParsePnn()
437 tlv[shortNameOffset + NETWORK_NAME_IEI] == (unsigned char)SHORT_NAME_FLAG) { in ParsePnn()
439 … SIMUtils::Gsm7bitConvertToString(tlv + (shortNameOffset + NETWORK_NAME_TEXT_STRING), in ParsePnn()
440 tlv[shortNameOffset + NETWORK_NAME_LENGTH] - 1); in ParsePnn()
/base/telephony/core_service/services/sim/include/
Dusim_dialling_numbers_service.h85 std::shared_ptr<TagService> tlv, int parentTag);