Home
last modified time | relevance | path

Searched refs:buff (Results 1 – 25 of 102) sorted by relevance

12345

/base/security/device_auth/common_lib/impl/src/
Duint8buff_utils.c22 int32_t InitUint8Buff(Uint8Buff *buff, uint32_t buffLen) in InitUint8Buff() argument
24 if (buff == NULL) { in InitUint8Buff()
30 buff->val = (uint8_t *)HcMalloc(buffLen, 0); in InitUint8Buff()
31 if (buff->val == NULL) { in InitUint8Buff()
34 buff->length = buffLen; in InitUint8Buff()
38 int32_t DeepCopyUint8Buff(const Uint8Buff *buff, Uint8Buff *newBuff) in DeepCopyUint8Buff() argument
40 if (buff == NULL || buff->val == NULL || newBuff == NULL) { in DeepCopyUint8Buff()
43 if (buff->length == 0) { in DeepCopyUint8Buff()
46 uint8_t *val = (uint8_t *)HcMalloc(buff->length, 0); in DeepCopyUint8Buff()
50 (void)memcpy_s(val, buff->length, buff->val, buff->length); in DeepCopyUint8Buff()
[all …]
/base/telephony/sms_mms/frameworks/native/mms/include/
Dmms_header.h59 bool DecodeMmsMsgType(uint8_t fieldId, MmsDecodeBuffer &buff, int32_t &len);
60 bool DecodeFieldAddressModelValue(uint8_t fieldId, MmsDecodeBuffer &buff, int32_t &len);
61 bool DecodeFieldOctetValue(uint8_t fieldId, MmsDecodeBuffer &buff, int32_t &len);
62 bool DecodeFieldLongValue(uint8_t fieldId, MmsDecodeBuffer &buff, int32_t &len);
63 bool DecodeFieldIntegerValue(uint8_t fieldId, MmsDecodeBuffer &buff, int32_t &len);
64 bool DecodeFieldTextStringValue(uint8_t fieldId, MmsDecodeBuffer &buff, int32_t &len);
65 bool DecodeFieldEncodedStringValue(uint8_t fieldId, MmsDecodeBuffer &buff, int32_t &len);
66 bool DecodeFromValue(uint8_t fieldId, MmsDecodeBuffer &buff, int32_t &len);
68 bool DecodeMmsContentType(uint8_t fieldId, MmsDecodeBuffer &buff, int32_t &len);
69 bool DecodeFieldDate(uint8_t fieldId, MmsDecodeBuffer &buff, int32_t &len);
[all …]
/base/security/device_security_level/services/common/
Ddslm_msg_serialize.c54 MessagePacket *ParseMessage(const MessageBuff *buff) in ParseMessage() argument
56 if (buff == NULL) { in ParseMessage()
61 if (!CheckMessage(buff->buff, buff->length)) { in ParseMessage()
66 JsonHandle handle = CreateJson((const char *)buff->buff); in ParseMessage()
109 void FreeMessageBuff(MessageBuff *buff) in FreeMessageBuff() argument
111 if (buff == NULL) { in FreeMessageBuff()
114 if (buff->buff != NULL) { in FreeMessageBuff()
115 FREE(buff->buff); in FreeMessageBuff()
116 buff->buff = NULL; in FreeMessageBuff()
118 FREE((void *)buff); in FreeMessageBuff()
/base/telephony/sms_mms/frameworks/native/mms/src/
Dmms_header.cpp507 bool MmsHeader::DecodeMmsMsgType(uint8_t fieldId, MmsDecodeBuffer &buff, int32_t &len) in DecodeMmsMsgType() argument
516 if (!buff.GetOneByte(oneByte)) { in DecodeMmsMsgType()
540 bool MmsHeader::DecodeFieldAddressModelValue(uint8_t fieldId, MmsDecodeBuffer &buff, int32_t &len) in DecodeFieldAddressModelValue() argument
549 encodeString.DecodeEncodeString(buff); in DecodeFieldAddressModelValue()
567 bool MmsHeader::DecodeFieldOctetValue(uint8_t fieldId, MmsDecodeBuffer &buff, int32_t &len) in DecodeFieldOctetValue() argument
575 if (!buff.GetOneByte(oneByte)) { in DecodeFieldOctetValue()
583 bool MmsHeader::DecodeFieldLongValue(uint8_t fieldId, MmsDecodeBuffer &buff, int32_t &len) in DecodeFieldLongValue() argument
592 if (!buff.DecodeLongInteger(value)) { in DecodeFieldLongValue()
626 bool MmsHeader::DecodeFieldTextStringValue(uint8_t fieldId, MmsDecodeBuffer &buff, int32_t &len) in DecodeFieldTextStringValue() argument
636 if (!buff.DecodeText(tempString, tempLen)) { in DecodeFieldTextStringValue()
[all …]
/base/security/huks/test/unittest/huks_standard_test/crypto_engine_test/src/
Dhks_crypto_hal_api_openssl.cpp155 uint8_t buff[1] = {0}; variable
160 key = { .size = 1, .data = buff };
164 message = { .size = 1, .data = buff };
168 cipherText = { .size = 1, .data = buff };
189 uint8_t buff[1] = {0}; variable
194 key = { .size = 1, .data = buff };
198 message = { .size = 1, .data = buff };
202 cipherText = { .size = 1, .data = buff };
219 uint8_t buff[HKS_KEY_BYTES(HKS_AES_KEY_SIZE_128)] = {0}; variable
220 HksBlob key = { .size = 1, .data = buff };
[all …]
Dhks_crypto_hal_api_mbedtls.cpp135 uint8_t buff[1] = {0}; variable
140 key = { .size = 1, .data = buff };
144 message = { .size = 1, .data = buff };
148 cipherText = { .size = 1, .data = buff };
169 uint8_t buff[1] = {0}; variable
174 key = { .size = 1, .data = buff };
178 message = { .size = 1, .data = buff };
182 cipherText = { .size = 1, .data = buff };
199 uint8_t buff[HKS_KEY_BYTES(HKS_AES_KEY_SIZE_128)] = {0}; variable
200 HksBlob key = { .size = 1, .data = buff };
[all …]
/base/security/device_security_level/test/dslm_unit_test/
Ddslm_baselib_utils_test.cpp74 uint8_t buff[MAX_ENTRY * sizeof(TlvCommon)] = {0}; variable
78 (void)memset_s(&buff[0], sizeof(buff), 0, sizeof(buff));
81 uint32_t ret = Deserialize(nullptr, sizeof(buff), &tlvs[0], MAX_ENTRY, &cnt);
89 uint8_t buff[(MAX_ENTRY + 2) * sizeof(TlvCommon)] = {0}; variable
95 TlvCommon *ptr = (TlvCommon *)buff + i;
100 uint32_t ret = Deserialize(buff, sizeof(buff), &tlvs[0], MAX_ENTRY, &cnt);
118 uint8_t buff[MAX_ENTRY * sizeof(TlvCommon)] = {0}; variable
122 (void)memset_s(&buff[0], sizeof(buff), 0, sizeof(buff));
126 TlvCommon *ptr = (TlvCommon *)buff + i;
131 uint32_t ret = Deserialize(buff, sizeof(buff), &tlvs[0], MAX_ENTRY, &cnt);
[all …]
/base/security/device_security_level/services/dslm/
Ddslm_inner_process.c62 MessageBuff *buff = NULL; in SendDeviceInfoRequest() local
63 int32_t ret = BuildDeviceSecInfoRequest(device->nonce, &buff); in SendDeviceInfoRequest()
68 SendMsgToDevice(device->transNum, &device->identity, buff->buff, buff->length); in SendDeviceInfoRequest()
70 SECURITY_LOG_DEBUG("buff is %s", (char *)buff->buff); in SendDeviceInfoRequest()
73 FreeMessageBuff(buff); in SendDeviceInfoRequest()
77 int32_t VerifyDeviceInfoResponse(DslmDeviceInfo *device, const MessageBuff *buff) in VerifyDeviceInfoResponse() argument
79 if (device == NULL || buff == NULL) { in VerifyDeviceInfoResponse()
90 ret = ParseDeviceSecInfoResponse(buff, &nonce, &version, &cred); in VerifyDeviceInfoResponse()
Ddslm_msg_utils.c132 out->buff = GenerateSecInfoRequestJson(challenge); in BuildDeviceSecInfoRequest()
133 if (out->buff == NULL) { in BuildDeviceSecInfoRequest()
137 out->length = strlen((char *)out->buff) + 1; in BuildDeviceSecInfoRequest()
144 if (msg == NULL || obj == NULL || msg->buff == NULL) { in ParseDeviceSecInfoRequest()
147 SECURITY_LOG_DEBUG("ParseDeviceSecInfoRequest msg is %s", (char *)msg->buff); in ParseDeviceSecInfoRequest()
149 JsonHandle handle = CreateJson((const char *)msg->buff); in ParseDeviceSecInfoRequest()
184 out->buff = GenerateSecInfoResponseJson(challenge, cred); in BuildDeviceSecInfoResponse()
185 if (out->buff == NULL) { in BuildDeviceSecInfoResponse()
189 out->length = strlen((char *)out->buff) + 1; in BuildDeviceSecInfoResponse()
201 if (msg->buff == NULL || *cred != NULL) { in ParseDeviceSecInfoResponse()
[all …]
/base/startup/appspawn/test/unittest/app_spawn_socket_test/
Dapp_spawn_socket_test.cpp172 std::unique_ptr<uint8_t[]> buff = std::make_unique<uint8_t[]>(10); variable
173 EXPECT_TRUE(buff);
176 EXPECT_EQ(-1, appSpawnSocket->ReadSocketMessage(socketFd, buff.get(), len));
196 std::unique_ptr<uint8_t[]> buff = nullptr; variable
199 EXPECT_EQ(-1, appSpawnSocket->ReadSocketMessage(socketFd, buff.get(), len));
220 std::unique_ptr<uint8_t[]> buff = std::make_unique<uint8_t[]>(10); variable
221 EXPECT_TRUE(buff);
224 EXPECT_EQ(-1, appSpawnSocket->ReadSocketMessage(socketFd, buff.get(), len));
245 std::unique_ptr<uint8_t[]> buff = std::make_unique<uint8_t[]>(10); variable
246 EXPECT_TRUE(buff);
[all …]
/base/security/device_auth/common_lib/interfaces/
Duint8buff_utils.h31 int32_t InitUint8Buff(Uint8Buff *buff, uint32_t buffLen);
32 int32_t DeepCopyUint8Buff(const Uint8Buff *buff, Uint8Buff *newBuff);
33 void FreeUint8Buff(Uint8Buff *buff);
34 void ClearFreeUint8Buff(Uint8Buff *buff);
35 bool IsUint8BuffValid(const Uint8Buff *buff, uint32_t maxLen);
/base/update/updater/services/package/pkg_manager/
Dpkg_utils.cpp203 uint32_t ReadLE32(const uint8_t *buff) in GetFileSize() argument
205 if (buff == nullptr) { in GetFileSize()
210 uint32_t value32 = buff[0]; in GetFileSize()
212 value32 += static_cast<uint32_t>(static_cast<uint32_t>(buff[1]) << offset); in GetFileSize()
214 value32 += static_cast<uint32_t>(static_cast<uint32_t>(buff[SECOND_BUFFER]) << offset); in GetFileSize()
216 value32 += static_cast<uint32_t>(static_cast<uint32_t>(buff[THIRD_BUFFER]) << offset); in GetFileSize()
220 uint64_t ReadLE64(const uint8_t *buff) in GetFileSize() argument
222 if (buff == nullptr) { in GetFileSize()
226 uint32_t low = ReadLE32(buff); in GetFileSize()
227 uint32_t high = ReadLE32(buff + sizeof(uint32_t)); in GetFileSize()
[all …]
/base/update/updater/test/unittest/package/
Dpkg_algo_unittest.cpp46 uint8_t buff[BUFFER_LEN] = {1}; in TestCrcDigest() local
47 PkgBuffer crcBuffer(buff, sizeof(buff)); in TestCrcDigest()
48 ret = algo->Update(crcBuffer, sizeof(buff)); in TestCrcDigest()
57 ret = algo->Calculate(crcResult, crcBuffer, sizeof(buff)); in TestCrcDigest()
69 uint8_t buff[BUFFER_LEN] = {1}; in TestHash256Digest() local
70 PkgBuffer buffer(buff, sizeof(buff)); in TestHash256Digest()
71 ret = algo->Update(buffer, sizeof(buff)); in TestHash256Digest()
77 ret = algo->Calculate(dig, buffer, sizeof(buff)); in TestHash256Digest()
88 uint8_t buff[BUFFER_LEN] = {1}; in TestHash384Digest() local
89 PkgBuffer buffer384(buff, sizeof(buff)); in TestHash384Digest()
[all …]
/base/startup/appspawn/test/unittest/client_socket_test/
Dclient_socket_test.cpp105 std::string buff = "hiworld"; variable
107 EXPECT_EQ(-1, clientSocket->WriteSocketMessage(buff.c_str(), buff.length()));
125 std::unique_ptr<uint8_t[]> buff = nullptr; variable
130 EXPECT_EQ(-1, clientSocket->WriteSocketMessage(buff.get(), len));
148 std::string buff = "hiworld"; variable
153 EXPECT_EQ(-1, clientSocket->WriteSocketMessage(buff.c_str(), len));
171 std::string buff = "hiworld"; variable
176 EXPECT_EQ(-1, clientSocket->WriteSocketMessage(buff.c_str(), len));
195 std::unique_ptr<uint8_t[]> buff = std::make_unique<uint8_t[]>(len); variable
197 EXPECT_EQ(-1, clientSocket->ReadSocketMessage(buff.get(), len));
[all …]
/base/security/selinux_adapter/test/unittest/paraperm_checker/
Dunit_test.cpp50 ParamContextsList *buff = nullptr; variable
51 buff = GetParamList();
52 ASSERT_NE(nullptr, buff);
55 DestroyParamList(&buff);
56 ASSERT_EQ(nullptr, buff);
/base/security/device_security_level/baselib/utils/src/
Dutils_tlv.c70 uint32_t Serialize(const TlvCommon *tlv, uint32_t tlvCount, uint8_t *buff, uint32_t maxBuffSize, ui… in Serialize() argument
72 if (tlv == NULL || buff == NULL || buffSize == NULL) { in Serialize()
76 uint8_t *curr = buff; in Serialize()
77 uint8_t *boundary = buff + maxBuffSize; in Serialize()
86 *buffSize = curr - buff; in Serialize()
90 uint32_t Deserialize(const uint8_t *buff, uint32_t buffSize, TlvCommon *tlv, uint32_t maxTlvCount, … in Deserialize() argument
92 if (buff == NULL || tlv == NULL || tlvCount == NULL) { in Deserialize()
96 uint8_t *msg = (uint8_t *)buff; in Deserialize()
97 const uint8_t *boundary = buff + buffSize; in Deserialize()
/base/security/selinux_adapter/interfaces/tools/param_check/
Dtest.cpp49 ParamContextsList *buff = nullptr; in TestLoadList() local
54 buff = GetParamList(); in TestLoadList()
55 if (buff == nullptr) { in TestLoadList()
66 ParamContextsList *head = buff; in TestLoadList()
67 while (buff != nullptr) { in TestLoadList()
68 if (security_check_context(buff->info.paraContext) < 0) { in TestLoadList()
69 …std::cout << "failed check context: " << buff->info.paraContext << " " << strlen(buff->info.paraCo… in TestLoadList()
71 buff = buff->next; in TestLoadList()
74 std::cout << "param: " << buff->info.paraName << ", contexts: " << buff->info.paraContext in TestLoadList()
75 << ", index: " << buff->info.index << std::endl; in TestLoadList()
[all …]
/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/src/
Dhks_openssl_dsa.c53 uint8_t *buff = (uint8_t *)HksMalloc(HKS_KEY_BYTES(keyMaterial->keySize)); in InitDsaStructKey() local
54 HKS_IF_NULL_RETURN(buff, HKS_ERROR_MALLOC_FAIL) in InitDsaStructKey()
59 HksFree(buff); in InitDsaStructKey()
62 …if (memcpy_s(buff, HKS_KEY_BYTES(keyMaterial->keySize), key->data + *offset, keyMaterial->xSize) !… in InitDsaStructKey()
63 HksFree(buff); in InitDsaStructKey()
66 x = BN_bin2bn(buff, keyMaterial->xSize, NULL); in InitDsaStructKey()
70 …if (memcpy_s(buff, HKS_KEY_BYTES(keyMaterial->keySize), key->data + *offset, keyMaterial->ySize) !… in InitDsaStructKey()
71 HksFree(buff); in InitDsaStructKey()
75 BIGNUM *y = BN_bin2bn(buff, keyMaterial->ySize, NULL); in InitDsaStructKey()
85 … (void)memset_s(buff, HKS_KEY_BYTES(keyMaterial->keySize), 0, HKS_KEY_BYTES(keyMaterial->keySize)); in InitDsaStructKey()
[all …]
/base/startup/init/test/fuzztest/loadfscryptpolicy_fuzzer/
Dloadfscryptpolicy_fuzzer.cpp23 char buff[1024] = {0}; in FuzzLoadFscryptPolicy() local
24 size_t len = sizeof(buff); in FuzzLoadFscryptPolicy()
25 if (!LoadFscryptPolicy(buff, len)) { in FuzzLoadFscryptPolicy()
/base/startup/init/services/param/adapter/
Dparam_dac.c147 char *buff = (char *)calloc(1, buffSize); in LoadParamLabels() local
148 while (fp != NULL && buff != NULL && fgets(buff, buffSize, fp) != NULL) { in LoadParamLabels()
149 buff[buffSize - 1] = '\0'; in LoadParamLabels()
150 int ret = SplitParamString(buff, NULL, 0, LoadOneParam_, NULL); in LoadParamLabels()
152 PARAM_LOGE("Failed to split string %s fileName %s", buff, fileName); in LoadParamLabels()
161 if (buff != NULL) { in LoadParamLabels()
162 free(buff); in LoadParamLabels()
292 char *buff = (char *)calloc(1, buffSize); in LoadGroupUser_() local
293 while (fp != NULL && buff != NULL && fgets(buff, buffSize, fp) != NULL) { in LoadGroupUser_()
294 buff[buffSize - 1] = '\0'; in LoadGroupUser_()
[all …]
/base/security/dlp_permission_service/frameworks/common/src/
Dpermission_policy.cpp33 static bool CheckAesParam(const uint8_t* buff, uint32_t len) in CheckAesParam() argument
35 if (buff == nullptr) { in CheckAesParam()
94 static void FreeUint8Buffer(uint8_t** buff, uint32_t& buffLen) in FreeUint8Buffer() argument
96 if (*buff != nullptr) { in FreeUint8Buffer()
97 memset_s(*buff, buffLen, 0, buffLen); in FreeUint8Buffer()
98 delete[] *buff; in FreeUint8Buffer()
99 *buff = nullptr; in FreeUint8Buffer()
277 void FreeCharBuffer(char* buff, uint32_t buffLen) in FreeCharBuffer() argument
279 if (buff != nullptr) { in FreeCharBuffer()
280 memset_s(buff, buffLen, 0, buffLen); in FreeCharBuffer()
[all …]
/base/security/device_security_level/services/include/
Ddslm_msg_serialize.h36 uint8_t *buff; member
46 MessagePacket *ParseMessage(const MessageBuff *buff);
52 void FreeMessageBuff(MessageBuff *buff);
/base/useriam/user_auth_framework/frameworks/native/client/src/
Dauth_message_impl.cpp24 auto buff = static_cast<AuthMessageImpl *>(msg.get()); in GetMsgBuffer() local
25 return buff ? buff->msg_ : empty; in GetMsgBuffer()
/base/hiviewdfx/hiview/utility/smart_parser/test/moduletest/common/
Dsmart_parser_module_test.cpp78 std::stringstream buff; variable
79 LogUtil::ReadFileBuff(trustStack, buff);
84 while (getline(buff, line) && num < trace.size()) {
118 std::stringstream buff; variable
119 LogUtil::ReadFileBuff(trustStack, buff);
124 while (getline(buff, line) && num < trace.size()) {
162 std::stringstream buff(content);
167 while (getline(buff, line) && num < trace.size()) {
190 std::stringstream buff; variable
191 LogUtil::ReadFileBuff(traceFile, buff);
[all …]
/base/update/sys_installer/services/module_update/util/src/
Dmodule_utils.cpp153 uint16_t ReadLE16(const uint8_t *buff) in ReadLE16() argument
155 if (buff == nullptr) { in ReadLE16()
159 uint16_t value16 = buff[0]; in ReadLE16()
160 value16 += static_cast<uint16_t>(buff[1] << BYTE_SIZE); in ReadLE16()
164 uint32_t ReadLE32(const uint8_t *buff) in ReadLE32() argument
166 if (buff == nullptr) { in ReadLE32()
170 uint16_t low = ReadLE16(buff); in ReadLE32()
171 uint16_t high = ReadLE16(buff + sizeof(uint16_t)); in ReadLE32()

12345