Home
last modified time | relevance | path

Searched refs:len (Results 1 – 25 of 608) sorted by relevance

12345678910>>...25

/base/startup/init/interfaces/hals/utils/token/
Dhal_token.c20 __attribute__((weak)) static int OEMReadToken(char* token, unsigned int len) in OEMReadToken() argument
24 (void)(len); in OEMReadToken()
28 __attribute__((weak)) static int OEMWriteToken(const char* token, unsigned int len) in OEMWriteToken() argument
32 (void)(len); in OEMWriteToken()
36 __attribute__((weak)) static int OEMGetAcKey(char* acKey, unsigned int len) in OEMGetAcKey() argument
40 (void)(len); in OEMGetAcKey()
44 __attribute__((weak)) static int OEMGetProdId(char* productId, unsigned int len) in OEMGetProdId() argument
48 (void)(len); in OEMGetProdId()
52 __attribute__((weak)) static int OEMGetProdKey(char* productKey, unsigned int len) in OEMGetProdKey() argument
56 (void)(len); in OEMGetProdKey()
[all …]
/base/useriam/user_auth_framework/common/test/
Diam_fuzz_test.cpp34 void FillFuzzBuffer(Parcel &parcel, void *p, uint32_t len) in FillFuzzBuffer() argument
36 if (len == 0) { in FillFuzzBuffer()
40 auto buffer = parcel.ReadBuffer(len); in FillFuzzBuffer()
42 IAM_LOGE("ReadBuffer len %{public}u fail", len); in FillFuzzBuffer()
46 if (memcpy_s(p, len, buffer, len) != EOK) { in FillFuzzBuffer()
57 uint32_t len = parcel.ReadUint32() % MAX_DATA_LEN; in FillFuzzUint8Vector() local
58 uint32_t memLen = len * sizeof(uint8_t); in FillFuzzUint8Vector()
59 data.resize(len); in FillFuzzUint8Vector()
61 IAM_LOGI("fill vector len %{public}u ok", len); in FillFuzzUint8Vector()
66 uint32_t len = parcel.ReadUint32() % MAX_DATA_LEN; in FillFuzzInt8Vector() local
[all …]
/base/security/appverify/interfaces/innerkits/appverify_lite/src/
Dapp_common.c18 long long HapGetInt64(const unsigned char *buf, int len) in HapGetInt64() argument
24 if (len != sizeof(long long)) { in HapGetInt64()
27 while (len-- > 0) { in HapGetInt64()
28 value = (value << BYTE_BITS) | (*(buf + len)); in HapGetInt64()
33 int HapGetInt(const unsigned char *buf, int len) in HapGetInt() argument
35 unsigned int value = HapGetUnsignedInt(buf, len); in HapGetInt()
39 unsigned int HapGetUnsignedInt(const unsigned char *buf, int len) in HapGetUnsignedInt() argument
45 if (len != sizeof(int)) { in HapGetUnsignedInt()
48 while (len-- > 0) { in HapGetUnsignedInt()
49 value = (value << BYTE_BITS) | (*(buf + len)); in HapGetUnsignedInt()
[all …]
Dapp_centraldirectory.c37 if ((offset >= 0) && (hapBuffer->len - offset >= (int)(sizeof(value)))) { in HapPutByte()
43 void HapPutData(const HapBuf *hapBuffer, int offset, const unsigned char *data, int len) in HapPutData() argument
48 if ((data != NULL) && (offset >= 0) && len > 0 && ((hapBuffer->len - offset) >= len)) { in HapPutData()
49 …py_s(((unsigned char *)hapBuffer->buffer + offset), (hapBuffer->len - offset), data, len) != EOK) { in HapPutData()
64 if ((offset >= 0) && ((buffer->len - offset) >= (int)(sizeof(value)))) { in HapSetInt32()
65 HapPutInt32((unsigned char *)buffer->buffer + offset, buffer->len - offset, (int)(value)); in HapSetInt32()
70 bool CreateHapBuffer(HapBuf *hapBuffer, int len) in CreateHapBuffer() argument
72 if (hapBuffer == NULL || len <= 0) { in CreateHapBuffer()
76 hapBuffer->buffer = APPV_MALLOC(len); in CreateHapBuffer()
81 hapBuffer->len = len; in CreateHapBuffer()
[all …]
/base/startup/init/interfaces/innerkits/token/src/token_impl_hal/
Dtoken.c21 int ReadToken(char *token, unsigned int len) in ReadToken() argument
28 return HalReadToken(token, len); in ReadToken()
31 int WriteToken(const char *token, unsigned int len) in WriteToken() argument
38 return HalWriteToken(token, len); in WriteToken()
41 int GetAcKey(char *acKey, unsigned int len) in GetAcKey() argument
48 return HalGetAcKey(acKey, len); in GetAcKey()
51 int GetProdId(char *productId, unsigned int len) in GetProdId() argument
58 return HalGetProdId(productId, len); in GetProdId()
61 int GetProdKey(char *productKey, unsigned int len) in GetProdKey() argument
68 return HalGetProdKey(productKey, len); in GetProdKey()
/base/startup/syspara_lite/frameworks/token/src/token_impl_hal/
Dtoken.c21 int ReadToken(char *token, unsigned int len) in ReadToken() argument
28 return HalReadToken(token, len); in ReadToken()
31 int WriteToken(const char *token, unsigned int len) in WriteToken() argument
38 return HalWriteToken(token, len); in WriteToken()
41 int GetAcKey(char *acKey, unsigned int len) in GetAcKey() argument
48 return HalGetAcKey(acKey, len); in GetAcKey()
51 int GetProdId(char *productId, unsigned int len) in GetProdId() argument
58 return HalGetProdId(productId, len); in GetProdId()
61 int GetProdKey(char *productKey, unsigned int len) in GetProdKey() argument
68 return HalGetProdKey(productKey, len); in GetProdKey()
/base/hiviewdfx/hilog_lite/frameworks/mini/
Dhiview_output_log.c128 void OutputLog(const uint8 *data, uint32 len) in OutputLog() argument
136 if (g_hilogOutputProc(hiLogContent, len) == TRUE) { in OutputLog()
175 if (WriteToCache(&g_logCache, data, len) != (int32)len) { in OutputLog()
182 if (WriteToCache(&g_logCache, (uint8 *)data, len) != (int32)len) { in OutputLog()
204 WriteToCache(&g_logCache, (uint8 *)data, len); in OutputLog()
213 int32 len; in OutputLogRealtime() local
223 len = logContent.commonContent.valueNumber * sizeof(uint32); in OutputLogRealtime()
224 if (len > 0 && ReadFromCache(&g_logCache, (uint8 *)&(logContent.values), len) != len) { in OutputLogRealtime()
227 len = LogContentFmt(tempOutStr, sizeof(tempOutStr), (uint8 *)&logContent); in OutputLogRealtime()
228 if (len <= 0) { in OutputLogRealtime()
[all …]
/base/telephony/call_manager/services/telephony_interaction/src/
Dcall_status_callback_stub.cpp89 int32_t len = data.ReadInt32(); in OnUpdateCallReportInfo() local
90 if (len <= 0 || len >= MAX_LEN) { in OnUpdateCallReportInfo()
91 TELEPHONY_LOGE("Invalid parameter, len = %{public}d", len); in OnUpdateCallReportInfo()
94 if ((parcelPtr = reinterpret_cast<const CallReportInfo *>(data.ReadRawData(len))) == nullptr) { in OnUpdateCallReportInfo()
95 TELEPHONY_LOGE("reading raw data failed, length = %d", len); in OnUpdateCallReportInfo()
120 int32_t len = 0; in OnUpdateCallsReportInfo() local
123 len = data.ReadInt32(); in OnUpdateCallsReportInfo()
124 if (len <= 0 || len >= MAX_LEN) { in OnUpdateCallsReportInfo()
125 TELEPHONY_LOGE("invalid parameter, len = %d", len); in OnUpdateCallsReportInfo()
128 … if ((parcelPtr = reinterpret_cast<const CallReportInfo *>(data.ReadRawData(len))) == nullptr) { in OnUpdateCallsReportInfo()
[all …]
/base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent_manager/
Dhisysevent_record_c.cpp49 int GetParamValues(const HiSysEventRecord& record, const char* name, T** value, size_t& len) in GetParamValues() argument
62 len = dataVec.size(); in GetParamValues()
63 T* data = new(std::nothrow) T[len]; in GetParamValues()
64 for (size_t i = 0; i < len; i++) { in GetParamValues()
71 int GetParamValues(const HiSysEventRecord& record, const char* name, char*** value, size_t& len) in GetParamValues() argument
84 return OHOS::HiviewDFX::StringUtil::ConvertCStringVec(dataVec, value, len); in GetParamValues()
87 int GetParamNames(const HiSysEventRecord& record, char*** names, size_t& len) in GetParamNames() argument
98 return OHOS::HiviewDFX::StringUtil::ConvertCStringVec(dataVec, names, len); in GetParamNames()
121 …GetParamInt64Values(const HiSysEventRecord& record, const char* name, int64_t** value, size_t& len) in GetParamInt64Values() argument
123 return GetParamValues<int64_t>(record, name, value, len); in GetParamInt64Values()
[all …]
/base/global/i18n_lite/frameworks/i18n/src/
Dnumber_data.cpp30 int len = strlen(data.numFormat); in StyleData() local
31 numFormat = NewArrayAndCopy(data.numFormat, len); in StyleData()
34 int len = strlen(data.entireFormat); in StyleData() local
35 entireFormat = I18nNewCharString(data.entireFormat, len); in StyleData()
52 int len = strlen(data.numFormat); in operator =() local
53 numFormat = I18nNewCharString(data.numFormat, len); in operator =()
56 int len = strlen(data.entireFormat); in operator =() local
57 entireFormat = I18nNewCharString(data.entireFormat, len); in operator =()
97 void NumberData::ParsePattern(const char *pattern, const int len) in ParsePattern() argument
99 bool isDec = CalculateDecLength(pattern, len); in ParsePattern()
[all …]
Dstr_util.cpp45 char *NewArrayAndCopy(const char *source, const int len) in NewArrayAndCopy() argument
47 …if ((source == nullptr) || (len <= 0) || (len > g_i18nMaxMalloc)) { // 4096 is the max size that w… in NewArrayAndCopy()
50 char *out = reinterpret_cast<char *>(I18nMalloc(len + 1)); in NewArrayAndCopy()
54 errno_t rc = strcpy_s(out, len + 1, source); in NewArrayAndCopy()
59 out[len] = '\0'; in NewArrayAndCopy()
63 char *I18nNewCharString(const char *source, const int len) in I18nNewCharString() argument
65 …if ((source == nullptr) || (len <= 0) || len > g_i18nMaxMalloc) { // 4096 is the max size of alloc… in I18nNewCharString()
68 char *out = reinterpret_cast<char *>(I18nMalloc(len + 1)); in I18nNewCharString()
72 errno_t rc = memcpy_s(out, len + 1, source, len); in I18nNewCharString()
77 out[len] = '\0'; in I18nNewCharString()
[all …]
/base/startup/appspawn/interfaces/innerkits/client/
Dappspawn_socket.cpp64 int len = 0; in PackSocketAddr() local
66 len = snprintf_s(socketAddr_.sun_path, pathSize, (pathSize - 1), "%s", socketName_.c_str()); in PackSocketAddr()
68 len = snprintf_s(socketAddr_.sun_path, pathSize, (pathSize - 1), "%s%s", in PackSocketAddr()
71 APPSPAWN_CHECK(static_cast<int>(pathLen) == len, return -1, "Failed to copy socket path"); in PackSocketAddr()
97 int AppSpawnSocket::ReadSocketMessage(int socketFd, void *buf, int len) in ReadSocketMessage() argument
99 if (socketFd < 0 || len <= 0 || buf == nullptr) { in ReadSocketMessage()
100 APPSPAWN_LOGE("Invalid args: socket %d, len %d, buf might be nullptr", socketFd, len); in ReadSocketMessage()
104 APPSPAWN_CHECK(memset_s(buf, len, 0, len) == EOK, return -1, "Failed to memset read buf"); in ReadSocketMessage()
106 ssize_t rLen = TEMP_FAILURE_RETRY(read(socketFd, buf, len)); in ReadSocketMessage()
108 rLen = TEMP_FAILURE_RETRY(read(socketFd, buf, len)); in ReadSocketMessage()
[all …]
/base/startup/init/interfaces/innerkits/syspara/
Dparam_comm.c62 INIT_LOCAL_API int IsValidParamValue(const char *value, uint32_t len) in IsValidParamValue() argument
64 if ((value == NULL) || (strlen(value) + 1 > len)) { in IsValidParamValue()
70 INIT_LOCAL_API int GetParameter_(const char *key, const char *def, char *value, uint32_t len) in GetParameter_() argument
72 if ((key == NULL) || (value == NULL) || (len > (uint32_t)PARAM_BUFFER_MAX)) { in GetParameter_()
75 uint32_t size = len; in GetParameter_()
81 if (strlen(def) > len) { in GetParameter_()
84 ret = strcpy_s(value, len, def); in GetParameter_()
86 } else if (size > len) { in GetParameter_()
90 size = len; in GetParameter_()
101 uint32_t len = 0; in GetProperty() local
[all …]
/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/aes/src/
Dcipher_aes_openssl.c240 if ((params->aad.data == NULL) || (params->aad.len == 0) || (params->aad.len > MAX_AAD_LEN)) { in IsGcmParamsValid()
244 if ((params->iv.data == NULL) || (params->iv.len != GCM_IV_LEN)) { in IsGcmParamsValid()
248 if ((params->tag.data == NULL) || (params->tag.len == 0)) { in IsGcmParamsValid()
261 if ((params->aad.data == NULL) || (params->aad.len == 0) || (params->aad.len > MAX_AAD_LEN)) { in IsCcmParamsValid()
265 …if ((params->iv.data == NULL) || (params->iv.len < CCM_IV_MIN_LEN) || (params->iv.len > CCM_IV_MAX… in IsCcmParamsValid()
269 if ((params->tag.data == NULL) || (params->tag.len == 0)) { in IsCcmParamsValid()
283 data->aad = (uint8_t *)HcfMalloc(params->aad.len, 0); in InitAadAndTagFromGcmParams()
288 (void)memcpy_s(data->aad, params->aad.len, params->aad.data, params->aad.len); in InitAadAndTagFromGcmParams()
289 data->aadLen = params->aad.len; in InitAadAndTagFromGcmParams()
291 data->tagLen = params->tag.len; in InitAadAndTagFromGcmParams()
[all …]
/base/startup/syspara_lite/frameworks/token/src/token_impl_posix/
Dtoken.c40 int ReadToken(char *token, unsigned int len) in ReadToken() argument
54 ret = HalReadToken(token, len); in ReadToken()
60 int WriteToken(const char *token, unsigned int len) in WriteToken() argument
74 ret = HalWriteToken(token, len); in WriteToken()
80 int GetAcKey(char *acKey, unsigned int len) in GetAcKey() argument
91 return HalGetAcKey(acKey, len); in GetAcKey()
94 int GetProdId(char *productId, unsigned int len) in GetProdId() argument
101 return HalGetProdId(productId, len); in GetProdId()
104 int GetProdKey(char *productKey, unsigned int len) in GetProdKey() argument
116 return HalGetProdKey(productKey, len); in GetProdKey()
/base/startup/init/interfaces/innerkits/token/src/token_impl_posix/
Dtoken.c40 int ReadToken(char *token, unsigned int len) in ReadToken() argument
54 ret = HalReadToken(token, len); in ReadToken()
60 int WriteToken(const char *token, unsigned int len) in WriteToken() argument
74 ret = HalWriteToken(token, len); in WriteToken()
80 int GetAcKey(char *acKey, unsigned int len) in GetAcKey() argument
91 return HalGetAcKey(acKey, len); in GetAcKey()
94 int GetProdId(char *productId, unsigned int len) in GetProdId() argument
101 return HalGetProdId(productId, len); in GetProdId()
104 int GetProdKey(char *productKey, unsigned int len) in GetProdKey() argument
116 return HalGetProdKey(productKey, len); in GetProdKey()
/base/security/device_auth/deps_adapter/key_management_adapter/interfaces/
Dhuks_adapter.h28 #define CHECK_LEN_ZERO_RETURN_ERROR_CODE(len, paramTag) \ argument
30 if ((len) == 0) { \
44 #define CHECK_LEN_LOWER_RETURN(len, min, paramTag) \ argument
46 if ((len) < (min)) { \
52 #define CHECK_LEN_HIGHER_RETURN(len, max, paramTag) \ argument
54 if ((len) > (max)) { \
60 #define CHECK_LEN_EQUAL_RETURN(len, value, paramTag) \ argument
62 if ((len) != (value)) { \
/base/security/access_token/services/tokensyncmanager/test/mock/src/
Dsoft_bus_session_mock.cpp101 int SendBytes(int sessionId, const void *data, unsigned int len) in SendBytes() argument
103 ACCESSTOKEN_LOG_DEBUG(LABEL, "len: %{public}d", len); in SendBytes()
107 DecompressMock(reinterpret_cast<const unsigned char *>(data), len); in SendBytes()
112 int GetPeerSessionName(int sessionId, char *sessionName, unsigned int len) in GetPeerSessionName() argument
123 if (len < x.length()) { in GetPeerSessionName()
135 int GetPeerDeviceId(int sessionId, char *devId, unsigned int len) in GetPeerDeviceId() argument
142 if (len < x.length()) { in GetPeerDeviceId()
157 uLong len = 1048576; in DecompressMock() local
158 unsigned char *buf = static_cast<unsigned char *>(malloc(len + 1)); in DecompressMock()
163 (void)memset_s(buf, len + 1, 0, len + 1); in DecompressMock()
[all …]
/base/security/device_security_level/services/dslm/
Ddslm_credential.c79 int32_t GetSupportedCredTypes(CredType *list, uint32_t len) in GetSupportedCredTypes() argument
81 if (list == NULL || len == 0) { in GetSupportedCredTypes()
85 uint32_t outLen = len; in GetSupportedCredTypes()
86 if (len > cb->credTypeCnt) { in GetSupportedCredTypes()
95 DslmCredBuff *CreateDslmCred(CredType type, uint32_t len, uint8_t *value) in CreateDslmCred() argument
97 if (value == NULL || len == 0 || len > MAX_CRED_LEN) { in CreateDslmCred()
105 uint8_t *outValue = (uint8_t *)MALLOC(len); in CreateDslmCred()
110 (void)memset_s(outValue, len, 0, len); in CreateDslmCred()
111 if (memcpy_s(outValue, len, value, len) != EOK) { in CreateDslmCred()
118 outBuff->credLen = len; in CreateDslmCred()
/base/hiviewdfx/hisysevent/frameworks/native/util/
Dstring_util.cpp22 int CopyCString(char* dst, const std::string& src, size_t len) in CopyCString() argument
24 if (src.length() > len) { in CopyCString()
30 int CreateCString(char** dst, const std::string& src, size_t len) in CreateCString() argument
32 if (src.length() > len) { in CreateCString()
44 int ConvertCString(const std::string& str, char** sp, size_t len) in ConvertCString() argument
46 if (str.length() > len) { in ConvertCString()
58 int ConvertCStringVec(const std::vector<std::string>& vec, char*** strs, size_t& len) in ConvertCStringVec() argument
63 len = vec.size(); in ConvertCStringVec()
64 char** data = new(std::nothrow) char* [len]{0}; in ConvertCStringVec()
65 for (size_t i = 0; i < len; i++) { in ConvertCStringVec()
/base/global/resource_management_lite/frameworks/resmgr_lite/src/
Dres_locale.cpp41 RState ResLocale::SetLanguage(const char *language, size_t len) in SetLanguage() argument
43 if (len == 0) { in SetLanguage()
48 char *temp = new(std::nothrow) char[len + 1]; in SetLanguage()
55 while (i < len) { in SetLanguage()
59 *(temp + len) = '\0'; in SetLanguage()
63 RState ResLocale::SetRegion(const char *region, size_t len) in SetRegion() argument
65 if (len == 0) { in SetRegion()
70 char *temp = new(std::nothrow) char[len + 1]; in SetRegion()
77 while (i < len) { in SetRegion()
81 *(temp + len) = '\0'; in SetRegion()
[all …]
/base/startup/appspawn/test/unittest/app_spawn_socket_test/
Dapp_spawn_socket_test.cpp182 int32_t len = 10; variable
184 EXPECT_EQ(-1, appSpawnSocket->ReadSocketMessage(socketFd, buff.get(), len));
205 int32_t len = 10; variable
207 EXPECT_EQ(-1, appSpawnSocket->ReadSocketMessage(socketFd, buff.get(), len));
230 int32_t len = 0; variable
232 EXPECT_EQ(-1, appSpawnSocket->ReadSocketMessage(socketFd, buff.get(), len));
255 int32_t len = -1; variable
257 EXPECT_EQ(-1, appSpawnSocket->ReadSocketMessage(socketFd, buff.get(), len));
278 int32_t len = content.length(); variable
279 EXPECT_TRUE(len);
[all …]
/base/startup/syspara_lite/interfaces/kits/
Dtoken.h35 int ReadToken(char *token, unsigned int len);
43 int WriteToken(const char *token, unsigned int len);
51 int GetAcKey(char *acKey, unsigned int len);
59 int GetProdId(char *productId, unsigned int len);
67 int GetProdKey(char *productKey, unsigned int len);
/base/startup/init/interfaces/innerkits/include/token/
Dtoken.h35 int ReadToken(char *token, unsigned int len);
43 int WriteToken(const char *token, unsigned int len);
51 int GetAcKey(char *acKey, unsigned int len);
59 int GetProdId(char *productId, unsigned int len);
67 int GetProdKey(char *productKey, unsigned int len);
/base/update/updater/services/applypatch/
Draw_writer.cpp23 bool RawWriter::Write(const uint8_t *addr, size_t len, [[maybe_unused]] const void *context) in Write() argument
30 if (len == 0) { in Write()
42 if (WriteInternal(fd_, addr, len) < 0) { in Write()
48 int RawWriter::WriteInternal(int fd, const uint8_t *data, size_t len) in WriteInternal() argument
51 size_t rest = len; in WriteInternal()
62 … LOG(ERROR) << "RawWriter: failed to write data of len " << len << " : " << strerror(errno); in WriteInternal()
68 offset_ += static_cast<off64_t>(len); in WriteInternal()

12345678910>>...25