/test/xts/hats/useriam/common/src/ |
D | iam_hat_test.cpp | 35 void FillTestBuffer(Parcel &parcel, void *p, uint32_t len) in FillTestBuffer() argument 37 if (len == 0) { in FillTestBuffer() 41 auto buffer = parcel.ReadBuffer(len); in FillTestBuffer() 43 cout << "ReadBuffer len " << len << " fail!" << endl; in FillTestBuffer() 47 if (memcpy_s(p, len, buffer, len) != EOK) { in FillTestBuffer() 58 uint32_t len = parcel.ReadUint32() % MAX_DATA_LEN; in FillTestUint8Vector() local 59 uint32_t memLen = len * sizeof(uint8_t); in FillTestUint8Vector() 60 data.resize(len); in FillTestUint8Vector() 62 cout << "fill vector len " << len << "ok" << endl; in FillTestUint8Vector() 67 uint32_t len = parcel.ReadUint32() % MAX_DATA_LEN; in FillTestInt8Vector() local [all …]
|
/test/xts/device_attest_lite/services/core/network/ |
D | attest_coap.c | 42 buf->len = HEADER_LEN; in CoapCreateHead() 43 pkt->len = HEADER_LEN; in CoapCreateHead() 69 if (pkt == NULL || token == NULL || ((token->len != 0) && token->buffer == NULL) || in CoapAddToken() 70 buf == NULL || buf->rwBuffer == NULL || (buf->len != HEADER_LEN)) { in CoapAddToken() 75 if (token->len > MAX_TOK_LEN) { in CoapAddToken() 80 if ((buf->len + token->len) > buf->size) { in CoapAddToken() 85 pkt->tok.len = token->len; in CoapAddToken() 86 pkt->hdr.tkl = pkt->tok.len & 0x0F; in CoapAddToken() 87 pkt->tok.buffer = (const uint8_t*)&buf->rwBuffer[buf->len]; in CoapAddToken() 88 if (token->len) { in CoapAddToken() [all …]
|
/test/xts/device_attest/services/oem_adapter/src/ |
D | device_attest_oem_adapter.c | 23 static int ReadTokenWithFlag(char* path, char* fileName, char* result, unsigned int len) in ReadTokenWithFlag() argument 45 …tic int WriteTokenWithFlag(char* path, char* fileName, const char* tokenWithFlag, unsigned int len) in WriteTokenWithFlag() argument 78 int32_t OEMReadToken(char *token, uint32_t len) in OEMReadToken() argument 80 if (token == NULL || len == 0) { in OEMReadToken() 92 (void)memcpy_s(token, len, tokenWithFlagA, len); in OEMReadToken() 96 (void)memcpy_s(token, len, tokenWithFlagB, len); in OEMReadToken() 103 (void)memcpy_s(token, len, tokenWithFlagA, len); in OEMReadToken() 106 (void)memcpy_s(token, len, tokenWithFlagB, len); in OEMReadToken() 112 int32_t OEMWriteToken(const char *token, uint32_t len) in OEMWriteToken() argument 114 if (token == NULL || len == 0) { in OEMWriteToken() [all …]
|
/test/xts/acts/kernel_lite/mem_posix/src/ |
D | MremapApiTest.cpp | 69 size_t len = PAGE_SIZE; variable 70 size_t expandSize = len * 2; 75 char *mem = (char *)mmap(nullptr, len, prot, flags, -1, 0); 79 mem = (char *)mremap(mem, len, expandSize, 0); 87 mem[len - 1] = testChar + 3; 89 mem[len + 0] = testChar; 93 LOG("mem[len - 1] = 0x%02x", mem[len - 1]); 94 LOG("mem[len + 0] = 0x%02x", mem[len + 0]); 111 size_t len = PAGE_SIZE * 2; variable 112 size_t shrinkSize = len / 2; [all …]
|
D | MemApiTest.cpp | 120 size_t k, len, mlen, rlen; variable 144 len = mlen <= rlen ? mlen : rlen; 147 for (k = 0; k < len; k++) { 177 size_t len = GetRandom(0x200000); variable 179 mem = (char *)realloc(nullptr, len); 184 mem = (char *)realloc(nullptr, len); 205 size_t len = 4096; variable 208 void *mem = malloc(len); 231 size_t k, len, nmemb = 32; variable 234 len = GetRandom(64 * 1024); [all …]
|
D | MmapApiTest.cpp | 45 size_t len = PAGE_SIZE; variable 51 char *mem = (char *)mmap(nullptr, len, prot, flags, -1, 0); 54 for (size_t i = 0; i < len; i++) { 74 EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; 85 size_t len = PAGE_SIZE; variable 90 char *mem = (char *)mmap(nullptr, len, prot, flags, -1, 0); 108 EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; 119 size_t len = PAGE_SIZE; variable 124 char *mem = (char *)mmap(nullptr, len, prot, flags, -1, 0); 137 EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; [all …]
|
D | MprotectApiTest.cpp | 44 size_t len = PAGE_SIZE; variable 50 char *mem = (char *)mmap(nullptr, len, prot, flags, -1, 0); 53 EXPECT_TRUE(mprotect(mem, len, mprot) == 0) << "ERROR: mprotect() != 0"; 66 EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; 77 size_t len = PAGE_SIZE; variable 83 char *mem = (char *)mmap(nullptr, len, prot, flags, -1, 0); 86 EXPECT_TRUE(mprotect(mem, len, mprot) == 0) << "ERROR: mprotect() != 0"; 99 EXPECT_TRUE(munmap(mem, len) == 0) << "ERROR: munmap() != 0"; 110 size_t len = PAGE_SIZE; variable 115 char *mem = (char *)mmap(nullptr, len, prot, flags, -1, 0); [all …]
|
/test/xts/acts/applications/kitframework_ipcamera/ |
D | kitfwk_oem_api_test.cpp | 152 uint32_t len = strlen(TEST_AUTH_STATUS); variable 153 char* statusRead = (char*)malloc(len + 1); 160 int ret = OEMWriteAuthStatus(TEST_AUTH_STATUS, len); 164 ret = OEMReadAuthStatus(statusRead, len); 167 statusRead[len] = 0; 173 ASSERT_EQ(len, newLen) << "Failed: length not match!" << "\n"; 177 int ret = OEMReadAuthStatus(statusRead, len); 180 statusRead[len] = 0; 185 ASSERT_EQ(len, newLen) << "Failed: length not match!" << "\n"; 201 uint32_t len = strlen(TEST_TICKET); variable [all …]
|
/test/xts/acts/applications/kitframework/ |
D | kitfwk_oem_api_test.c | 159 uint32_t len = strlen(TEST_AUTH_STATUS); variable 160 char* statusRead = malloc(len + 1); 167 int ret = OEMWriteAuthStatus(TEST_AUTH_STATUS, len); 171 ret = OEMReadAuthStatus(statusRead, len); 174 statusRead[len] = 0; 180 TEST_ASSERT_EQUAL_INT_MESSAGE(len, newLen, "Failed: length not match!"); 184 int ret = OEMReadAuthStatus(statusRead, len); 187 statusRead[len] = 0; 192 TEST_ASSERT_EQUAL_INT_MESSAGE(len, newLen, "Failed: length not match!"); 209 uint32_t len = strlen(TEST_TICKET); variable [all …]
|
/test/xts/acts/startup/startup_standard/deviceinfo/src/main/js/test/ |
D | DeviceInfoJsUnit.test.js | 850 let len = deviceTypeInfo.length 852 console.info('the value of the device type characters:' + len); 853 expect(len).assertLess(MAX_CHARACTERS_NUM_ONE) 870 let len = manufactureInfo.length 871 console.info('the value of the manufacture characters is :' + len); 872 expect(len).assertLess(MAX_CHARACTERS_NUM_ONE); 896 let len = brandInfo.length 897 console.info('the value of the external product family name characters is :' + len); 898 expect(len).assertLess(MAX_CHARACTERS_NUM_ONE); 922 let len = marketNameInfo.length [all …]
|
/test/xts/device_attest/services/devattest_ability/test/tdd/gtest/src/ |
D | attest_tdd_mock_hal.c | 30 int32_t AttestGetManufacturekey(uint8_t manufacturekey[], uint32_t len) in AttestGetManufacturekey() argument 33 (char*)manufacturekey, len); in AttestGetManufacturekey() 36 int32_t AttestGetProductId(uint8_t productId[], uint32_t len) in AttestGetProductId() argument 38 return memcpy_s(productId, len, ATTEST_MOCK_HAL_PRO_ID, ATTEST_MOCK_HAL_PRO_ID_LEN); in AttestGetProductId() 41 int32_t AttestGetProductKey(uint8_t productKey[], uint32_t len) in AttestGetProductKey() argument 43 return memcpy_s(productKey, len, ATTEST_MOCK_HAL_PRO_KEY, strlen(ATTEST_MOCK_HAL_PRO_KEY)); in AttestGetProductKey() 77 int32_t WriteTicketToDevice(const char* ticket, uint8_t len) in WriteTicketToDevice() argument 80 (void)len; in WriteTicketToDevice() 90 int32_t AttestWriteAuthStatus(const char* data, uint32_t len) in AttestWriteAuthStatus() argument 93 (void)len; in AttestWriteAuthStatus() [all …]
|
/test/xts/tools/lite/checksum/src/ |
D | checksum_file.c | 58 unsigned int len = 8; in GetChecksumResult() local 72 if (mesgd->dataLen < totalLen - len) { in GetChecksumResult() 73 for (; dataLen < totalLen - len; dataLen++) { in GetChecksumResult() 78 if (mesgd->dataLen >= totalLen - len) { in GetChecksumResult() 84 err = memset_s(mesgd->data, sizeof(mesgd->data), 0, totalLen - len); in GetChecksumResult() 90 mesgd->bitLen += mesgd->dataLen * len; in GetChecksumResult() 93 for (i = 1; i <= len; i++) { in GetChecksumResult() 94 mesgd->data[totalLen - i] = mesgd->bitLen >> ((i - 1) * len); in GetChecksumResult() 101 for (j = 0; j < len; j++) { in GetChecksumResult() 102 hash[i + groupNum * j] = (mesgd->hash[j] >> (num - i * len)) & bitNum; in GetChecksumResult() [all …]
|
/test/xts/device_attest_lite/services/core/adapter/ |
D | attest_adapter.c | 34 int32_t AttestWriteAuthStatus(const char* data, uint32_t len) in AttestWriteAuthStatus() argument 36 return OEMWriteAuthStatus(data, len); in AttestWriteAuthStatus() 46 int32_t AttestGetAuthStatusFileSize(uint32_t* len) in AttestGetAuthStatusFileSize() argument 48 return OEMGetAuthStatusFileSize(len); in AttestGetAuthStatusFileSize() 68 int32_t AttestGetParameter(const char *key, const char *def, char *value, uint32_t len) in AttestGetParameter() argument 70 return OsGetParameter(key, def, value, len); in AttestGetParameter() 73 int32_t AttestWriteAuthResultCode(const char* data, uint32_t len) in AttestWriteAuthResultCode() argument 75 return OEMWriteAuthResultCode(data, len); in AttestWriteAuthResultCode()
|
/test/xts/device_attest/test/fuzztest/devattestcorenetwork_fuzzer/ |
D | devattest_core_network_fuzz.c | 42 static int32_t StringToInt32(const char *value, int32_t len, int32_t *intPara) in StringToInt32() argument 44 if (value == NULL || len <= 0 || intPara == NULL) { in StringToInt32() 49 for (int i = 0; i < len; i++) { in StringToInt32() 81 int32_t len = 0; in ParseHttpsRespIntPara() local 82 while ((httpValueAddr + len) != NULL) { in ParseHttpsRespIntPara() 83 if (isdigit(httpValueAddr[len])) { in ParseHttpsRespIntPara() 84 len++; in ParseHttpsRespIntPara() 85 if (len > ATTEST_MAX_INT32_BIT) { in ParseHttpsRespIntPara() 86 len = -1; in ParseHttpsRespIntPara() 93 if (len <= 0) { in ParseHttpsRespIntPara() [all …]
|
/test/xts/acts/security_lite/huks/common/ |
D | hks_test_file_operator.c | 99 static uint32_t FileRead(const char *fileName, uint32_t offset, uint8_t *buf, uint32_t len) in FileRead() argument 121 uint32_t size = fread(buf, 1, len, fp); in FileRead() 146 static int32_t FileWrite(const char *fileName, uint32_t offset, const uint8_t *buf, uint32_t len) in FileWrite() argument 171 uint32_t size = fwrite(buf, 1, len, fp); in FileWrite() 172 if (size != len) { in FileWrite() 187 static uint32_t FileRead(const char *fileName, uint32_t offset, uint8_t *buf, uint32_t len) in FileRead() argument 201 if (len > fileSize) { in FileRead() 202 … HKS_TEST_LOG_E("read data over file size!\n, file size = %d\n, buf len = %d\n", fileSize, len); in FileRead() 212 ret = UtilsFileRead(fd, (char *)(buf), len); in FileRead() 219 return len; in FileRead() [all …]
|
/test/xts/acts/appexecfwk_lite/appexecfwk_hal/src/ |
D | bundle_mgr_test.c | 60 size_t len = strlen(name); variable 61 abilityInfo.bundleName = (char *)(AdapterMalloc(len + 1)); 63 errno_t err = strncpy_s(abilityInfo.bundleName, len + 1, name, len); 83 size_t len = strlen(name); variable 84 abilityInfo.bundleName = (char *)(AdapterMalloc(len + 1)); 86 errno_t err = strncpy_s(abilityInfo.bundleName, len + 1, name, len); 106 size_t len = strlen(name); variable 107 bundleInfo.bundleName = (char *)(AdapterMalloc(len + 1)); 109 errno_t err = strncpy_s(bundleInfo.bundleName, len + 1, name, len); 129 size_t len = strlen(name); variable [all …]
|
/test/xts/device_attest/services/core/adapter/ |
D | attest_adapter.c | 45 int32_t AttestWriteAuthStatus(const char* data, uint32_t len) in AttestWriteAuthStatus() argument 47 return OEMWriteAuthStatus(data, len); in AttestWriteAuthStatus() 57 int32_t AttestGetAuthStatusFileSize(uint32_t* len) in AttestGetAuthStatusFileSize() argument 59 return OEMGetAuthStatusFileSize(len); in AttestGetAuthStatusFileSize() 79 int32_t AttestGetParameter(const char *key, const char *def, char *value, uint32_t len) in AttestGetParameter() argument 81 return OsGetParameter(key, def, value, len); in AttestGetParameter() 104 int32_t AttestWriteAuthResultCode(const char* data, uint32_t len) in AttestWriteAuthResultCode() argument 106 return OEMWriteAuthResultCode(data, len); in AttestWriteAuthResultCode()
|
/test/xts/acts/distributed_schedule_lite/system_ability_manager_posix/src/ |
D | TaskpoolSharedTaskTest.cpp | 313 Request request = {.msgId = 0, .len = 0, .data = nullptr, .msgValue = 0}; 315 request.len = (uint32_t)(strlen(body) + 1); 316 request.data = malloc(request.len); 320 errno_t error = strcpy_s((char *)request.data, request.len, body); 337 Request request2 = {.msgId = 0, .len = 0, .data = nullptr, .msgValue = 0}; 339 request2.len = (uint32_t)(strlen(body2) + 1); 340 request2.data = malloc(request2.len); 344 error = strcpy_s((char *)request2.data, request2.len, body2); 369 Request request = {.msgId = 0, .len = 0, .data = nullptr, .msgValue = 0}; 371 request.len = (uint32_t)(strlen(body) + 1); [all …]
|
D | SendRequestTest.cpp | 180 if (request->len > 0) { in FEATURE_OnMessage() 181 requestLen = request->len; in FEATURE_OnMessage() 203 .len = 0, in FEATURE_OnMessage() 384 .len = 0, 388 request.len = strlen(body) + 1; 389 request.data = malloc(request.len); 393 errno_t error = strcpy_s((char *)request.data, request.len, body); 424 .len = 0, 428 request.len = (uint32_t)(strlen(body) + 1); 429 request.data = malloc(request.len); [all …]
|
D | TaskpoolSpecifiedTaskTest.cpp | 282 Request request = {.msgId = 0, .len = 0, .data = nullptr, .msgValue = 0}; 284 request.len = (uint32_t)(strlen(body) + 1); 285 request.data = malloc(request.len); 289 errno_t error = strcpy_s((char *)request.data, request.len, body); 306 Request request2 = {.msgId = 0, .len = 0, .data = nullptr, .msgValue = 0}; 308 request2.len = (uint32_t)(strlen(body2) + 1); 309 request2.data = malloc(request2.len); 313 error = strcpy_s((char *)request2.data, request2.len, body2); 338 Request request = {.msgId = 0, .len = 0, .data = nullptr, .msgValue = 0}; 340 request.len = (uint32_t)(strlen(body) + 1); [all …]
|
/test/xts/device_attest_lite/test/tdd/gtest/ |
D | attest_tdd_mock_hal.c | 49 int32_t AttestGetManufacturekey(uint8_t manufacturekey[], uint32_t len) in AttestGetManufacturekey() argument 51 return OsGetAcKeyStub((char*)manufacturekey, len); in AttestGetManufacturekey() 55 int32_t AttestGetProductId(uint8_t productId[], uint32_t len) in AttestGetProductId() argument 57 if ((productId == NULL) || (len == 0)) { in AttestGetProductId() 62 if (len < productIdLen) { in AttestGetProductId() 66 int ret = memcpy_s(productId, len, productIdBuf, productIdLen); in AttestGetProductId() 71 int32_t AttestGetProductKey(uint8_t productKey[], uint32_t len) in AttestGetProductKey() argument 73 return OsGetProdKeyStub((char*)productKey, len); in AttestGetProductKey()
|
/test/xts/device_attest/services/core/include/adapter/ |
D | attest_adapter.h | 50 int32_t AttestWriteAuthStatus(const char* data, uint32_t len); 54 int32_t AttestGetAuthStatusFileSize(uint32_t* len); 60 int32_t AttestGetManufacturekey(uint8_t manufacturekey[], uint32_t len); 62 int32_t AttestGetProductId(uint8_t productId[], uint32_t len); 68 int32_t AttestGetProductKey(uint8_t productKey[], uint32_t len); 72 int32_t AttestGetParameter(const char *key, const char *def, char *value, uint32_t len); 82 int32_t AttestWriteAuthResultCode(const char* data, uint32_t len);
|
/test/xts/device_attest_lite/services/core/include/adapter/ |
D | attest_adapter.h | 50 int32_t AttestWriteAuthStatus(const char* data, uint32_t len); 54 int32_t AttestGetAuthStatusFileSize(uint32_t* len); 60 int32_t AttestGetManufacturekey(uint8_t manufacturekey[], uint32_t len); 62 int32_t AttestGetProductId(uint8_t productId[], uint32_t len); 68 int32_t AttestGetProductKey(uint8_t productKey[], uint32_t len); 72 int32_t AttestGetParameter(const char *key, const char *def, char *value, uint32_t len); 78 int32_t AttestWriteAuthResultCode(const char* data, uint32_t len);
|
/test/xts/device_attest_lite/services/core/include/network/ |
D | attest_coap.h | 60 size_t len; member 64 uint8_t len : 4; member 72 size_t len; member 78 size_t len; member 83 size_t len; /* needed buffer length if serializing to a buffer */ member 93 size_t len; /* len indicates the size of filled data */ member 105 char* buff, uint32_t* len);
|
/test/xts/device_attest_lite/framework/small/src/client/ |
D | attest_framework_client_proxy.c | 51 size_t len = 0; in ReadAttestResultTicket() local 52 char *ticket = (char *)ReadString(reply, &len); in ReadAttestResultTicket() 57 len = strlen(ticket) + 1; in ReadAttestResultTicket() 58 if (len > MAX_TICKET_SIZE) { in ReadAttestResultTicket() 62 char* backTicket = (char *)malloc(len); in ReadAttestResultTicket() 67 (void)memset_s(backTicket, len, 0, len); in ReadAttestResultTicket() 68 if (memcpy_s(backTicket, len, ticket, len) != 0) { in ReadAttestResultTicket() 91 size_t len = 0; in ReadAttestResultInfo() local 92 int32_t *softwareResultDetail = ReadInt32Vector(reply, &len); in ReadAttestResultInfo() 94 if (softwareResultDetail == NULL || (len != (size / sizeof(int32_t)))) { in ReadAttestResultInfo() [all …]
|