Home
last modified time | relevance | path

Searched refs:length (Results 1 – 25 of 646) sorted by relevance

12345678910>>...26

/base/compileruntime/js_api_module/xml/src/
Djs_xml.ts47 if (arguments.length === 1) {
50 …} else if (arguments.length === 2 && (typeof arguments[1] === 'string' && arguments[1].length !== …
60 if (errStr.length !== 0) {
65 …if (typeof name !== 'string' || name.length === 0 || typeof value !== 'string' || name.length === …
70 if (errStr.length !== 0) {
75 if (typeof name !== 'string' || name.length === 0) {
80 if (errStr.length !== 0) {
87 if (errStr.length !== 0) {
92 if (typeof name !== 'string' || name.length === 0) {
97 if (errStr.length !== 0) {
[all …]
/base/security/deviceauth/services/protocol/src/iso_protocol/
Diso_protocol_common.c31 params->randSelf.length = RAND_BYTE_LEN; in InitIsoBaseParams()
32 params->randSelf.val = (uint8_t *)HcMalloc(params->randSelf.length, 0); in InitIsoBaseParams()
38 params->randPeer.length = RAND_BYTE_LEN; in InitIsoBaseParams()
39 params->randPeer.val = (uint8_t *)HcMalloc(params->randPeer.length, 0); in InitIsoBaseParams()
46 params->sessionKey.length = ISO_SESSION_KEY_LEN; in InitIsoBaseParams()
47 params->sessionKey.val = (uint8_t *)HcMalloc(params->sessionKey.length, 0); in InitIsoBaseParams()
91 int length = params->randSelf.length + params->randPeer.length + params->authIdSelf.length + in IsoCalSelfToken() local
92 params->authIdPeer.length; in IsoCalSelfToken()
93 uint8_t *messagePeer = (uint8_t *)HcMalloc(length, 0); in IsoCalSelfToken()
99 if (memcpy_s(messagePeer, length, params->randPeer.val, params->randPeer.length) != EOK) { in IsoCalSelfToken()
[all …]
/base/security/deviceauth/frameworks/deviceauth_lite/source/base/
Dbase.h113 uint32_t length; member
118 uint32_t length; member
123 uint32_t length; member
128 uint32_t length; member
134 uint32_t length; member
140 uint32_t length; member
157 uint32_t length; member
162 uint32_t length; member
167 uint32_t length; member
172 uint32_t length; member
[all …]
/base/security/deviceauth/services/protocol/src/pake_protocol/pake_v1_protocol/
Dpake_v1_protocol_common.c67 params->salt.length = PAKE_SALT_LEN; in AllocDefaultParams()
68 params->salt.val = (uint8_t *)HcMalloc(params->salt.length, 0); in AllocDefaultParams()
74 params->challengeSelf.length = PAKE_CHALLENGE_LEN; in AllocDefaultParams()
75 params->challengeSelf.val = (uint8_t *)HcMalloc(params->challengeSelf.length, 0); in AllocDefaultParams()
81 params->challengePeer.length = PAKE_CHALLENGE_LEN; in AllocDefaultParams()
82 params->challengePeer.val = (uint8_t *)HcMalloc(params->challengePeer.length, 0); in AllocDefaultParams()
88 params->sessionKey.length = PAKE_SESSION_KEY_LEN; in AllocDefaultParams()
89 params->sessionKey.val = (uint8_t *)HcMalloc(params->sessionKey.length, 0); in AllocDefaultParams()
95 params->hmacKey.length = PAKE_HMAC_KEY_LEN; in AllocDefaultParams()
96 params->hmacKey.val = (uint8_t *)HcMalloc(params->hmacKey.length, 0); in AllocDefaultParams()
[all …]
/base/security/device_security_level/services/common/
Ddslm_crypto.c25 void GenerateRandom(RandomValue *rand, uint32_t length) in GenerateRandom() argument
30 rand->length = (length > RAMDOM_MAX_LEN) ? RAMDOM_MAX_LEN : length; in GenerateRandom()
32 RAND_bytes(&rand->value[0], rand->length); in GenerateRandom()
41 …if (srcData->data == NULL || sigData->data == NULL || pbkData->data == NULL || srcData->length == … in EcdsaVerify()
42 sigData->length == 0 || pbkData->length == 0) { in EcdsaVerify()
52 EVP_PKEY *pkey = d2i_PUBKEY(NULL, (const unsigned char **)&(publicKey), pbkData->length); in EcdsaVerify()
70 ret = EVP_DigestUpdate(ctx, srcData->data, srcData->length); in EcdsaVerify()
74 if (EVP_DigestVerifyFinal(ctx, sigData->data, sigData->length) <= 0) { in EcdsaVerify()
/base/usb/usb_manager/test/native/js_unittest/
DUsbDevicePipeJsunitEx.test.js33 if (usbPortList.length > 0) {
64 for (var k = 0; k < testParam.config.interfaces[j].endpoints.length; k++) {
92 if (testParam.config.interfaces[j].endpoints.length == 0) {
100 for (var j = 0; j < testParam.config.interfaces.length; j++) {
125 console.info('usb case gDeviceList.length: ' + gDeviceList.length);
126 for (var i = 0; i < gDeviceList.length; i++) {
235 if (gDeviceList.length == 0) {
241 if (gDeviceList[0].configs.length == 0) {
247 for (var j = 0; j < gDeviceList[0].configs.length; j++) {
248 if (gDeviceList[0].configs[j].interfaces.length == 0) {
[all …]
DUsbPortJsunit.test.js46 if (usbPortList.length == 0) {
51 expect(usbPortList.length > 0).assertTrue();
64 if (usbPortList.length == 0) {
70 expect(usbPortList.length > 0).assertTrue();
71 for (var i = 0; i < usbPortList.length; i++) {
88 if (usbPortList.length == 0) {
94 for (var i = 0; i < usbPortList.length; i++) {
117 if (usbPortList.length == 0) {
123 for (var i = 0; i < usbPortList.length; i++) {
/base/security/deviceauth/services/authenticators/src/account_unrelated/
Ddas_task_common.c173 serviceIdPlain.length = pkgName->length + serviceType->length; in CombineServiceId()
174 serviceIdPlain.val = (uint8_t *)HcMalloc(serviceIdPlain.length, 0); in CombineServiceId()
181 if (memcpy_s(serviceIdPlain.val, serviceIdPlain.length, pkgName->val, pkgName->length) != EOK) { in CombineServiceId()
186 if (memcpy_s(serviceIdPlain.val + pkgName->length, serviceIdPlain.length - pkgName->length, in CombineServiceId()
187 serviceType->val, serviceType->length) != EOK) { in CombineServiceId()
208 keyAliasBuff.length = serviceId->length + authId->length + keyType->length; in CombineKeyAlias()
209 keyAliasBuff.val = (uint8_t *)HcMalloc(keyAliasBuff.length, 0); in CombineKeyAlias()
215 uint32_t totalLen = keyAliasBuff.length; in CombineKeyAlias()
217 if (memcpy_s(keyAliasBuff.val, totalLen, serviceId->val, serviceId->length) != EOK) { in CombineKeyAlias()
222 usedLen = usedLen + serviceId->length; in CombineKeyAlias()
[all …]
/base/security/deviceauth/frameworks/deviceauth_lite/source/key_agreement/
Dsts_client.c87 random_value.random_value, random_value.length) != EOK) { in build_start_request_data()
90 sts_client->my_challenge.length = random_value.length; in build_start_request_data()
149 int len = sts_client->peer_public_key.length + sts_client->peer_id.length + in generate_sign_message()
150 sts_client->self_public_key.length + sts_client->self_id.length; in generate_sign_message()
158 …cpy_s(info + pos, len - pos, sts_client->peer_public_key.stpk, sts_client->peer_public_key.length); in generate_sign_message()
159 pos += sts_client->peer_public_key.length; in generate_sign_message()
160 (void)memcpy_s(info + pos, len - pos, sts_client->peer_id.auth_id, sts_client->peer_id.length); in generate_sign_message()
161 pos += sts_client->peer_id.length; in generate_sign_message()
162 …cpy_s(info + pos, len - pos, sts_client->self_public_key.stpk, sts_client->self_public_key.length); in generate_sign_message()
163 pos += sts_client->self_public_key.length; in generate_sign_message()
[all …]
Dsts_server.c190 if (salt.length == 0) { in parse_start_request_data()
194 …y_s(sts_server->salt.salt, sizeof(sts_server->salt.salt), salt.random_value, salt.length) != EOK) { in parse_start_request_data()
197 sts_server->salt.length = salt.length; in parse_start_request_data()
223 int32_t len = sts_server->self_public_key.length + sts_server->self_id.length + in generate_sts_response_sign()
224 sts_server->peer_public_key.length + sts_server->peer_id.length; in generate_sts_response_sign()
232 …py_s(info2 + pos, len - pos, sts_server->self_public_key.stpk, sts_server->self_public_key.length); in generate_sts_response_sign()
233 pos += sts_server->self_public_key.length; in generate_sts_response_sign()
234 (void)memcpy_s(info2 + pos, len - pos, sts_server->self_id.auth_id, sts_server->self_id.length); in generate_sts_response_sign()
235 pos += sts_server->self_id.length; in generate_sts_response_sign()
236 …py_s(info2 + pos, len - pos, sts_server->peer_public_key.stpk, sts_server->peer_public_key.length); in generate_sts_response_sign()
[all …]
/base/telephony/sms_mms/services/gsm/
Dgsm_sms_tpdu_codec.cpp94 int length = 0; in EncodeSubmit() local
109 length = GsmSmsParamCodec::EncodeAddress(&pSubmit->destAddress, &address); in EncodeSubmit()
110 ret = memcpy_s(&(pTpdu[offset]), length, address, length); in EncodeSubmit()
114 offset += length; in EncodeSubmit()
115 TELEPHONY_LOGI("TP-DA len:=%{public}d,TP-MR msgRef:=%{public}d", length, pSubmit->msgRef); in EncodeSubmit()
120 length = GsmSmsParamCodec::EncodeDCS(&pSubmit->dcs, &dcs); in EncodeSubmit()
121 ret = memcpy_s(&(pTpdu[offset]), length, dcs, length); in EncodeSubmit()
125 offset += length; in EncodeSubmit()
126 TELEPHONY_LOGI("TP-DCS length : =%{public}d", length); in EncodeSubmit()
129 length = GsmSmsParamCodec::EncodeTime(&pSubmit->validityPeriod, &vpTime); in EncodeSubmit()
[all …]
/base/security/deviceauth/deps_adapter/key_management_adapter/impl/src/small/
Dhuks_adapter.c35 CHECK_LEN_ZERO_RETURN_ERROR_CODE(inParams[i]->length, paramTags[i]); in BaseCheckParams()
77 CHECK_LEN_ZERO_RETURN_ERROR_CODE(message->length, "message->length"); in Sha256()
81 CHECK_LEN_EQUAL_RETURN(hash->length, SHA256_LEN, "hash->length"); in Sha256()
83 struct HksBlob srcBlob = { message->length, message->val }; in Sha256()
84 struct HksBlob hashBlob = { hash->length, hash->val }; in Sha256()
112 CHECK_LEN_ZERO_RETURN_ERROR_CODE(rand->length, "rand->length"); in GenerateRandom()
114 struct HksBlob randBlob = { rand->length, rand->val }; in GenerateRandom()
128 CHECK_LEN_ZERO_RETURN_ERROR_CODE(keyAlias->length, "keyAlias->length"); in CheckKeyExist()
130 struct HksBlob keyAliasBlob = { keyAlias->length, keyAlias->val }; in CheckKeyExist()
144 CHECK_LEN_ZERO_RETURN_ERROR_CODE(keyAlias->length, "keyAlias->length"); in DeleteKey()
[all …]
/base/security/deviceauth/deps_adapter/key_management_adapter/impl/src/standard/
Dhuks_adapter.c43 CHECK_LEN_ZERO_RETURN_ERROR_CODE(inParams[i]->length, paramTags[i]); in BaseCheckParams()
85 CHECK_LEN_ZERO_RETURN_ERROR_CODE(message->length, "message->length"); in Sha256()
89 CHECK_LEN_EQUAL_RETURN(hash->length, SHA256_LEN, "hash->length"); in Sha256()
91 struct HksBlob srcBlob = { message->length, message->val }; in Sha256()
92 struct HksBlob hashBlob = { hash->length, hash->val }; in Sha256()
120 CHECK_LEN_ZERO_RETURN_ERROR_CODE(rand->length, "rand->length"); in GenerateRandom()
122 struct HksBlob randBlob = { rand->length, rand->val }; in GenerateRandom()
136 CHECK_LEN_ZERO_RETURN_ERROR_CODE(keyAlias->length, "keyAlias->length"); in CheckKeyExist()
138 struct HksBlob keyAliasBlob = { keyAlias->length, keyAlias->val }; in CheckKeyExist()
152 CHECK_LEN_ZERO_RETURN_ERROR_CODE(keyAlias->length, "keyAlias->length"); in DeleteKey()
[all …]
/base/usb/usb_manager/services/native/src/
Dusb_descriptor_parser.cpp39 int32_t UsbDescriptorParser::ParseDeviceDescriptor(const uint8_t *buffer, uint32_t length, UsbDevic… in ParseDeviceDescriptor() argument
42 if (buffer == nullptr || length == 0) { in ParseDeviceDescriptor()
48 __func__, buffer, length, cursor); in ParseDeviceDescriptor()
50 if (length < deviceDescriptorSize) { in ParseDeviceDescriptor()
77 int32_t UsbDescriptorParser::ParseConfigDescriptor(const uint8_t *buffer, uint32_t length, uint32_t… in ParseConfigDescriptor() argument
80 if (buffer == nullptr || length == 0) { in ParseConfigDescriptor()
85 __func__, buffer, length, cursor); in ParseConfigDescriptor()
87 if (length < configDescriptorSize) { in ParseConfigDescriptor()
105 for (int32_t i = 0; (i < configDescriptor.bNumInterfaces) && (cursor < length); ++i) { in ParseConfigDescriptor()
108 …ParseInterfaceDescriptor(buffer + cursor + interfaceCursor, length - cursor - interfaceCursor, int… in ParseConfigDescriptor()
[all …]
/base/security/deviceauth/services/protocol/src/
Dprotocol_common.c27 (void)memset_s(key->val, key->length, 0, key->length); in FreeAndCleanKey()
30 key->length = 0; in FreeAndCleanKey()
40 (void)memset_s(param->val, param->length, 0, param->length); in InitSingleParam()
43 param->length = len; in InitSingleParam()
44 param->val = (uint8_t *)HcMalloc(param->length, 0); in InitSingleParam()
/base/security/deviceauth/deps_adapter/key_management_adapter/impl/src/mini/
Dhuks_adapter.c39 CHECK_LEN_ZERO_RETURN_ERROR_CODE(inParams[i]->length, paramTags[i]); in BaseCheckParams()
107 CHECK_LEN_ZERO_RETURN_ERROR_CODE(message->length, "message->length"); in Sha256()
111 CHECK_LEN_EQUAL_RETURN(hash->length, SHA256_LEN, "hash->length"); in Sha256()
113 struct HksBlob srcBlob = { message->length, message->val }; in Sha256()
114 struct HksBlob hashBlob = { hash->length, hash->val }; in Sha256()
142 CHECK_LEN_ZERO_RETURN_ERROR_CODE(rand->length, "rand->length"); in GenerateRandom()
144 struct HksBlob randBlob = { rand->length, rand->val }; in GenerateRandom()
158 CHECK_LEN_ZERO_RETURN_ERROR_CODE(keyAlias->length, "keyAlias->length"); in CheckKeyExist()
160 struct HksBlob keyAliasBlob = { keyAlias->length, keyAlias->val }; in CheckKeyExist()
174 CHECK_LEN_ZERO_RETURN_ERROR_CODE(keyAlias->length, "keyAlias->length"); in DeleteKey()
[all …]
/base/security/deviceauth/services/authenticators/src/account_unrelated/pake_task/standard_exchange_task/
Dstandard_exchange_message_util.c28 uint32_t exAuthInfoLen = nonce->length + cipher->length; in PackageNonceAndCipherToJson()
35 if (memcpy_s(exAuthInfoVal, exAuthInfoLen, nonce->val, nonce->length) != EOK) { in PackageNonceAndCipherToJson()
40 if (memcpy_s(exAuthInfoVal + nonce->length, exAuthInfoLen - nonce->length, in PackageNonceAndCipherToJson()
41 cipher->val, cipher->length) != EOK) { in PackageNonceAndCipherToJson()
74 if (memcpy_s(nonce->val, nonce->length, exAuthInfoVal, nonce->length) != EOK) { in ParseNonceAndCipherFromJson()
80 res = InitSingleParam(cipher, exAuthInfoLen - nonce->length); in ParseNonceAndCipherFromJson()
85 if (memcpy_s(cipher->val, cipher->length, exAuthInfoVal + nonce->length, in ParseNonceAndCipherFromJson()
86 exAuthInfoLen - nonce->length) != EOK) { in ParseNonceAndCipherFromJson()
119 params->baseParams.challengePeer.val, params->baseParams.challengePeer.length); in GetPeerChallenge()
Dcommon_standard_bind_exchange.c32 params->pubKeyPeer.length = PAKE_ED25519_KEY_PAIR_LEN; in InitStandardBindExchangeParams()
33 params->pubKeyPeer.val = (uint8_t *)HcMalloc(params->pubKeyPeer.length, 0); in InitStandardBindExchangeParams()
39 params->pubKeySelf.length = PAKE_ED25519_KEY_PAIR_LEN; in InitStandardBindExchangeParams()
40 params->pubKeySelf.val = (uint8_t *)HcMalloc(params->pubKeySelf.length, 0); in InitStandardBindExchangeParams()
46 params->nonce.length = STANDARD_BIND_EXCHANGE_NONCE_LEN; in InitStandardBindExchangeParams()
47 params->nonce.val = (uint8_t *)HcMalloc(params->nonce.length, 0); in InitStandardBindExchangeParams()
53 params->authInfo.length = 0; in InitStandardBindExchangeParams()
55 params->exInfoCipher.length = 0; in InitStandardBindExchangeParams()
117 pakeParams->baseParams.idSelf.length), res); in PackageAuthInfo()
119 exchangeParams->pubKeySelf.length), res); in PackageAuthInfo()
[all …]
/base/security/deviceauth/frameworks/deviceauth_lite/source/auth_info/
Dexchange_auth_info.c148 plain.size = auth_info.length + sign_result.length; in build_exchange_response_data()
156 (void)memcpy_s(plain.val, plain.size, auth_info.val, auth_info.length); in build_exchange_response_data()
157 plain.length = auth_info.length; in build_exchange_response_data()
159 …(void)memcpy_s(plain.val + plain.length, plain.size - plain.length, sign_result.signature, sign_re… in build_exchange_response_data()
160 plain.length += sign_result.length; in build_exchange_response_data()
182 if (service_id.length == 0) { in get_self_key_id()
191 if (alias.length == 0) { in get_self_key_id()
216 if (payload->length <= HC_SIGNATURE_LEN) { in get_field_from_request_payload()
217 LOGE("Peer public key signature info length is %d", payload->length); in get_field_from_request_payload()
222 auth_info->length -= HC_SIGNATURE_LEN; in get_field_from_request_payload()
[all …]
Dexchange_auth_info_client.c95 if (key->length < PAKE_SESSION_KEY_LENGTH) { in parse_exchange_response_data()
152 plain.size = auth_info.length + sign_result.length; in build_exchange_request()
159 if (memcpy_s(plain.val, plain.size, auth_info.val, auth_info.length) != EOK) { in build_exchange_request()
164 plain.length = auth_info.length; in build_exchange_request()
166 …if (memcpy_s(plain.val + plain.length, plain.size - plain.length, sign_result.signature, sign_resu… in build_exchange_request()
171 plain.length += sign_result.length; in build_exchange_request()
187 if (service_id.length == 0) { in get_self_key_id()
196 if (alias.length == 0) { in get_self_key_id()
222 if (payload->length <= HC_SIGNATURE_LEN) { in get_field_from_request_payload()
223 LOGE("Peer public key signature info length is %d", payload->length); in get_field_from_request_payload()
[all …]
Dadd_auth_info.c107 .length = sizeof(array) in build_add_response_data()
146 if ((auth_id->length == cache.auth_id.length) && in save_import_auth_info()
147 (memcmp(auth_id->auth_id, cache.auth_id.auth_id, auth_id->length) == 0)) { in save_import_auth_info()
166 if (service_id.length == 0) { in verify_import_auth_info()
187 if (data->length <= (HC_SIGNATURE_LEN * BYTE_TO_HEX_OPER_LENGTH)) { in import_signed_auth_info_hilink()
188 LOGE("Import public key signature info length is %u", data->length); in import_signed_auth_info_hilink()
192 uint32_t len = (data->length / BYTE_TO_HEX_OPER_LENGTH) + 1; in import_signed_auth_info_hilink()
199 if (hex_string_to_byte((char *)data->val, data->length, receive_data) != HC_OK) { in import_signed_auth_info_hilink()
210 sign_result.length = HC_SIGNATURE_LEN; in import_signed_auth_info_hilink()
213 message.length = (data->length / BYTE_TO_HEX_OPER_LENGTH) - HC_SIGNATURE_LEN; in import_signed_auth_info_hilink()
[all …]
/base/security/access_token/frameworks/common/src/
Ddata_validator.cpp24 return !bundleName.empty() && (bundleName.length() <= MAX_LENGTH); in IsBundleNameValid()
29 return label.length() <= MAX_LENGTH; in IsLabelValid()
34 return desc.length() <= MAX_LENGTH; in IsDescValid()
39 return !permissionName.empty() && (permissionName.length() <= MAX_LENGTH); in IsPermissionNameValid()
49 return !appIDDesc.empty() && (appIDDesc.length() <= MAX_APPIDDESC_LENGTH); in IsAppIDDescValid()
54 return !domain.empty() && (domain.length() <= MAX_LENGTH); in IsDomainValid()
64 return !processName.empty() && (processName.length() <= MAX_LENGTH); in IsProcessNameValid()
69 return !deviceId.empty() && (deviceId.length() <= MAX_LENGTH); in IsDeviceIdValid()
74 return !dcap.empty() && (dcap.length() <= MAX_DCAP_LENGTH); in IsDcapValid()
/base/compileruntime/js_util_module/container/stack/
Djs_stack.ts28 if (index < 0 || index >= obj.length) {
47 if (index >= 0 && index < obj.length && Number.isInteger(index)) {
55 let length = obj.length;
56 for (let i = 0; i < length; i++) {
67 if (index >= 0 && index < obj.length && Number.isInteger(index)) {
88 get length() { method in Stack
102 let result = this[this.length - 1];
110 return this[this.length - 1];
113 for (let i = 0; i < this.length; i++) {
125 for (let i = 0; i < this.length; i++) {
/base/update/ota_lite/frameworks/source/verify/
Dhota_verify.c39 void HotaHashCalc(const uint8 *buffer, uint32 length) in HotaHashCalc() argument
46 AppSha256Update(&g_sha256, buffer, length); in HotaHashCalc()
50 int32 HotaGetHash(uint8 *buffer, uint32 length) in HotaGetHash() argument
57 if (memset_s(buffer, length, 0, length) != EOK) { in HotaGetHash()
61 if (length >= HASH_LENGTH) { in HotaGetHash()
106 uint32 length = 0; in HotaSignVerifyByHash() local
112 uint8 *keyBuf = HotaGetPubKey(&length); in HotaSignVerifyByHash()
117 int ret = AppRsaDecodePublicKey(&rsa, keyBuf, length); in HotaSignVerifyByHash()
155 uint8 *HotaGetPubKey(uint32 *length) in HotaGetPubKey() argument
157 return HotaHalGetPubKey(length); in HotaGetPubKey()
/base/security/deviceauth/common_lib/impl/src/
Dhc_tlv_parser.c37 if (!ParcelReadUint16Revert(parcel, &tlv->length)) { in ParseTlvHead()
41 if (!ParcelReadUint16(parcel, &tlv->length)) { in ParseTlvHead()
45 if (tlv->length > MAX_TLV_LENGTH) { in ParseTlvHead()
56 if (GetParcelDataSize(parcel) < tlv->length) { in ParseTlvNode()
64 return ret + sizeof(tlv->tag) + sizeof(tlv->length); in ParseTlvNode()
75 tlv->length = bodyLen + sizeof(tlv->tag) + sizeof(tlv->length); in GetlenTlvNode()
76 return tlv->length; in GetlenTlvNode()
103 return sizeof(tlv->tag) + sizeof(tlv->length); in EncodeTlvNode()
109 tlv->length = (uint16_t)bodyLen; in EncodeTlvNode()
112 ParcelWriteUint16Revert(parcel, tlv->length); in EncodeTlvNode()
[all …]

12345678910>>...26