/base/hiviewdfx/hisysevent/test/moduletest/common/ |
D | hisysevent_wrote_result_check_test.cpp | 83 void WriteAndWatch(std::shared_ptr<Watcher> watcher, T& val) in WriteAndWatch() argument 92 val); in WriteAndWatch() 133 bool val = true; variable 134 auto watcher = std::make_shared<Watcher>([val] (std::shared_ptr<HiSysEventRecord> sysEvent) { in __anonbf3b641a0202() 140 return ret == static_cast<int>(val); in __anonbf3b641a0202() 142 WriteAndWatch(watcher, val); 154 int64_t val = -18888888882321; variable 155 auto watcher = std::make_shared<Watcher>([val] (std::shared_ptr<HiSysEventRecord> sysEvent) { in __anonbf3b641a0302() 161 return ret == val; in __anonbf3b641a0302() 163 WriteAndWatch(watcher, val); [all …]
|
/base/security/device_auth/common_lib/impl/src/ |
D | uint8buff_utils.c | 30 buff->val = (uint8_t *)HcMalloc(buffLen, 0); in InitUint8Buff() 31 if (buff->val == NULL) { in InitUint8Buff() 40 if (buff == NULL || buff->val == NULL || newBuff == NULL) { in DeepCopyUint8Buff() 46 uint8_t *val = (uint8_t *)HcMalloc(buff->length, 0); in DeepCopyUint8Buff() local 47 if (val == NULL) { in DeepCopyUint8Buff() 50 (void)memcpy_s(val, buff->length, buff->val, buff->length); in DeepCopyUint8Buff() 51 newBuff->val = val; in DeepCopyUint8Buff() 58 if (buff == NULL || buff->val == NULL || buff->length == 0) { in FreeUint8Buff() 61 HcFree(buff->val); in FreeUint8Buff() 62 buff->val = NULL; in FreeUint8Buff() [all …]
|
/base/security/device_auth/services/protocol/src/pake_protocol/pake_v2_protocol/ |
D | pake_v2_protocol_common.c | 41 HcFree(params->salt.val); in DestroyPakeV2BaseParams() 42 params->salt.val = NULL; in DestroyPakeV2BaseParams() 44 HcFree(params->challengeSelf.val); in DestroyPakeV2BaseParams() 45 params->challengeSelf.val = NULL; in DestroyPakeV2BaseParams() 47 HcFree(params->challengePeer.val); in DestroyPakeV2BaseParams() 48 params->challengePeer.val = NULL; in DestroyPakeV2BaseParams() 50 HcFree(params->epkSelf.val); in DestroyPakeV2BaseParams() 51 params->epkSelf.val = NULL; in DestroyPakeV2BaseParams() 53 HcFree(params->epkPeer.val); in DestroyPakeV2BaseParams() 54 params->epkPeer.val = NULL; in DestroyPakeV2BaseParams() [all …]
|
/base/security/device_auth/services/protocol/src/pake_protocol/pake_v1_protocol/ |
D | pake_v1_protocol_common.c | 37 HcFree(params->salt.val); in DestroyPakeV1BaseParams() 38 params->salt.val = NULL; in DestroyPakeV1BaseParams() 40 HcFree(params->challengeSelf.val); in DestroyPakeV1BaseParams() 41 params->challengeSelf.val = NULL; in DestroyPakeV1BaseParams() 43 HcFree(params->challengePeer.val); in DestroyPakeV1BaseParams() 44 params->challengePeer.val = NULL; in DestroyPakeV1BaseParams() 46 HcFree(params->epkSelf.val); in DestroyPakeV1BaseParams() 47 params->epkSelf.val = NULL; in DestroyPakeV1BaseParams() 49 HcFree(params->epkPeer.val); in DestroyPakeV1BaseParams() 50 params->epkPeer.val = NULL; in DestroyPakeV1BaseParams() [all …]
|
/base/security/device_auth/services/protocol/src/ |
D | protocol_common.c | 24 if (key == NULL || key->val == NULL) { in FreeAndCleanKey() 27 (void)memset_s(key->val, key->length, 0, key->length); in FreeAndCleanKey() 28 HcFree(key->val); in FreeAndCleanKey() 29 key->val = NULL; in FreeAndCleanKey() 39 if (param->val != NULL) { in InitSingleParam() 40 (void)memset_s(param->val, param->length, 0, param->length); in InitSingleParam() 41 HcFree(param->val); in InitSingleParam() 44 param->val = (uint8_t *)HcMalloc(param->length, 0); in InitSingleParam() 45 if (param->val == NULL) { in InitSingleParam()
|
/base/powermgr/battery_statistics/test/unittest/mock/source/ |
D | mock_parcel.cpp | 603 bool Parcel::WriteVector(const std::vector<T1> &val, bool (Parcel::*Write)(T2)) in WriteVector() argument 605 (void)val; in WriteVector() 609 bool Parcel::WriteBoolVector(const std::vector<bool> &val) in WriteBoolVector() argument 611 return WriteVector(val, &Parcel::WriteBool); in WriteBoolVector() 614 bool Parcel::WriteInt8Vector(const std::vector<int8_t> &val) in WriteInt8Vector() argument 616 return WriteVector(val, &Parcel::WriteInt8Unaligned); in WriteInt8Vector() 619 bool Parcel::WriteInt16Vector(const std::vector<int16_t> &val) in WriteInt16Vector() argument 621 return WriteVector(val, &Parcel::WriteInt16); in WriteInt16Vector() 624 bool Parcel::WriteInt32Vector(const std::vector<int32_t> &val) in WriteInt32Vector() argument 626 return WriteVector(val, &Parcel::WriteInt32); in WriteInt32Vector() [all …]
|
/base/powermgr/power_manager/test/unittest/mock/ |
D | mock_parcel.cpp | 606 bool Parcel::WriteVector(const std::vector<T1>& val, bool (Parcel::*Write)(T2)) in WriteVector() argument 608 (void)val; in WriteVector() 612 bool Parcel::WriteBoolVector(const std::vector<bool>& val) in WriteBoolVector() argument 614 return WriteVector(val, &Parcel::WriteBool); in WriteBoolVector() 617 bool Parcel::WriteInt8Vector(const std::vector<int8_t>& val) in WriteInt8Vector() argument 619 return WriteVector(val, &Parcel::WriteInt8Unaligned); in WriteInt8Vector() 622 bool Parcel::WriteInt16Vector(const std::vector<int16_t>& val) in WriteInt16Vector() argument 624 return WriteVector(val, &Parcel::WriteInt16); in WriteInt16Vector() 627 bool Parcel::WriteInt32Vector(const std::vector<int32_t>& val) in WriteInt32Vector() argument 629 return WriteVector(val, &Parcel::WriteInt32); in WriteInt32Vector() [all …]
|
/base/powermgr/thermal_manager/test/unittest/mock/src/ |
D | mock_parcel.cpp | 622 bool Parcel::WriteVector(const std::vector<T1>& val, bool (Parcel::*Write)(T2)) in WriteVector() argument 624 (void)val; in WriteVector() 632 bool Parcel::WriteBoolVector(const std::vector<bool>& val) in WriteBoolVector() argument 634 return WriteVector(val, &Parcel::WriteBool); in WriteBoolVector() 637 bool Parcel::WriteInt8Vector(const std::vector<int8_t>& val) in WriteInt8Vector() argument 639 return WriteVector(val, &Parcel::WriteInt8Unaligned); in WriteInt8Vector() 642 bool Parcel::WriteInt16Vector(const std::vector<int16_t>& val) in WriteInt16Vector() argument 644 return WriteVector(val, &Parcel::WriteInt16); in WriteInt16Vector() 647 bool Parcel::WriteInt32Vector(const std::vector<int32_t>& val) in WriteInt32Vector() argument 649 return WriteVector(val, &Parcel::WriteInt32); in WriteInt32Vector() [all …]
|
/base/powermgr/battery_manager/test/unittest/mock/source/ |
D | mock_parcel.cpp | 601 bool Parcel::WriteVector(const std::vector<T1>& val, bool (Parcel::*Write)(T2)) in WriteVector() argument 603 (void)val; in WriteVector() 607 bool Parcel::WriteBoolVector(const std::vector<bool>& val) in WriteBoolVector() argument 609 return WriteVector(val, &Parcel::WriteBool); in WriteBoolVector() 612 bool Parcel::WriteInt8Vector(const std::vector<int8_t>& val) in WriteInt8Vector() argument 614 return WriteVector(val, &Parcel::WriteInt8Unaligned); in WriteInt8Vector() 617 bool Parcel::WriteInt16Vector(const std::vector<int16_t>& val) in WriteInt16Vector() argument 619 return WriteVector(val, &Parcel::WriteInt16); in WriteInt16Vector() 622 bool Parcel::WriteInt32Vector(const std::vector<int32_t>& val) in WriteInt32Vector() argument 624 return WriteVector(val, &Parcel::WriteInt32); in WriteInt32Vector() [all …]
|
/base/powermgr/display_manager/test/unittest/mock/src/ |
D | mock_parcel.cpp | 606 bool Parcel::WriteVector(const std::vector<T1>& val, bool (Parcel::*Write)(T2)) in WriteVector() argument 608 (void)val; in WriteVector() 612 bool Parcel::WriteBoolVector(const std::vector<bool>& val) in WriteBoolVector() argument 614 return WriteVector(val, &Parcel::WriteBool); in WriteBoolVector() 617 bool Parcel::WriteInt8Vector(const std::vector<int8_t>& val) in WriteInt8Vector() argument 619 return WriteVector(val, &Parcel::WriteInt8Unaligned); in WriteInt8Vector() 622 bool Parcel::WriteInt16Vector(const std::vector<int16_t>& val) in WriteInt16Vector() argument 624 return WriteVector(val, &Parcel::WriteInt16); in WriteInt16Vector() 627 bool Parcel::WriteInt32Vector(const std::vector<int32_t>& val) in WriteInt32Vector() argument 629 return WriteVector(val, &Parcel::WriteInt32); in WriteInt32Vector() [all …]
|
/base/security/device_auth/frameworks/deviceauth_lite/source/key_agreement/ |
D | sec_clone_server.c | 98 if (handle->start_request_data.val != NULL) { in destroy_sec_clone_server() 99 FREE(handle->start_request_data.val); in destroy_sec_clone_server() 100 handle->start_request_data.val = NULL; in destroy_sec_clone_server() 103 if (handle->client_sec_data.val != NULL) { in destroy_sec_clone_server() 104 FREE(handle->client_sec_data.val); in destroy_sec_clone_server() 105 handle->client_sec_data.val = NULL; in destroy_sec_clone_server() 132 send_data->val = (uint8_t *)MALLOC(send_data_size); in send_sec_clone_start_response() 133 if (send_data->val == NULL) { in send_sec_clone_start_response() 143 FREE(send_data->val); in send_sec_clone_start_response() 144 send_data->val = NULL; in send_sec_clone_start_response() [all …]
|
/base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent/encode/include/ |
D | raw_data_encoder.h | 35 static bool StringValueEncoded(RawData& data, const std::string& val); 40 static bool UnsignedVarintEncoded(RawData& data, const EncodeType type, T val) in UnsignedVarintEncoded() argument 42 …uint8_t cpyVal = EncodedTag(static_cast<uint8_t>(type)) | ((val < TAG_BYTE_BOUND) ? 0 : TAG_BYTE_B… in UnsignedVarintEncoded() 43 static_cast<uint8_t>(val & TAG_BYTE_MASK); in UnsignedVarintEncoded() 47 val >>= TAG_BYTE_OFFSET; in UnsignedVarintEncoded() 48 while (val > 0) { in UnsignedVarintEncoded() 49 cpyVal = ((val < NON_TAG_BYTE_BOUND) ? 0 : NON_TAG_BYTE_BOUND) | in UnsignedVarintEncoded() 50 static_cast<uint8_t>(val & NON_TAG_BYTE_MASK); in UnsignedVarintEncoded() 54 val >>= NON_TAG_BYTE_OFFSET; in UnsignedVarintEncoded() 61 static bool SignedVarintEncoded(RawData& data, const EncodeType type, T val) in SignedVarintEncoded() argument [all …]
|
D | raw_data_builder.h | 83 RawDataBuilder& AppendValue(const std::string& key, T val) in AppendValue() argument 86 return AppendBaseInfoValue(key, val); in AppendValue() 90 return AppendValue(std::make_shared<StringEncodedParam>(key, val)); in AppendValue() 94 static_cast<double>(val))); in AppendValue() 100 static_cast<int64_t>(val))); in AppendValue() 105 static_cast<uint64_t>(val))); in AppendValue() 107 return AppendArrayValue(key, val); in AppendValue() 112 RawDataBuilder& UpdateType(const T val) in UpdateType() argument 118 return AppendType(static_cast<int>(val)); in UpdateType() 124 RawDataBuilder& UpdateUid(const T val) in UpdateUid() argument [all …]
|
/base/hiviewdfx/hiview/base/event_raw/include/encoded/ |
D | raw_data_encoder.h | 35 static bool StringValueEncoded(RawData& data, const std::string& val); 40 static bool UnsignedVarintEncoded(RawData& data, const EncodeType type, T val) in UnsignedVarintEncoded() argument 42 …uint8_t cpyVal = EncodedTag(static_cast<uint8_t>(type)) | ((val < TAG_BYTE_BOUND) ? 0 : TAG_BYTE_B… in UnsignedVarintEncoded() 43 static_cast<uint8_t>(val & TAG_BYTE_MASK); in UnsignedVarintEncoded() 47 val >>= TAG_BYTE_OFFSET; in UnsignedVarintEncoded() 48 while (val > 0) { in UnsignedVarintEncoded() 49 cpyVal = ((val < NON_TAG_BYTE_BOUND) ? 0 : NON_TAG_BYTE_BOUND) | in UnsignedVarintEncoded() 50 static_cast<uint8_t>(val & NON_TAG_BYTE_MASK); in UnsignedVarintEncoded() 54 val >>= NON_TAG_BYTE_OFFSET; in UnsignedVarintEncoded() 61 static bool SignedVarintEncoded(RawData& data, const EncodeType type, T val) in SignedVarintEncoded() argument [all …]
|
D | raw_data_builder.h | 86 RawDataBuilder& AppendValue(const std::string& key, T val) in AppendValue() argument 89 return AppendBaseInfoValue(key, val); in AppendValue() 93 return AppendValue(std::make_shared<StringEncodedParam>(key, val)); in AppendValue() 97 static_cast<double>(val))); in AppendValue() 103 static_cast<int64_t>(val))); in AppendValue() 108 static_cast<uint64_t>(val))); in AppendValue() 110 return AppendArrayValue(key, val); in AppendValue() 115 RawDataBuilder& UpdateType(const T val) in UpdateType() argument 121 return AppendType(static_cast<int>(val)); in UpdateType() 127 RawDataBuilder& UpdateUid(const T val) in UpdateUid() argument [all …]
|
/base/security/device_auth/services/authenticators/src/account_related/auth/pake_v2_auth_task/ |
D | pake_v2_auth_task_common.c | 64 .val = serverPkAlias, in VerifyPkSignPeer() 69 (const char *)params->devIdSelf.val, &serverPkAliasBuff, true); in VerifyPkSignPeer() 76 .val = params->pkInfoPeer.val, in VerifyPkSignPeer() 80 .val = params->pkInfoSignPeer.val, in VerifyPkSignPeer() 100 .val = priAliasVal, in GenerateEcdhSharedKey() 104 (const char *)params->devIdSelf.val, &aliasBuff, false); in GenerateEcdhSharedKey() 110 .key = aliasBuff.val, in GenerateEcdhSharedKey() 120 params->pakeParams.psk.val = (uint8_t *)HcMalloc(sharedKeyAliasLen, 0); in GenerateEcdhSharedKey() 121 if (params->pakeParams.psk.val == NULL) { in GenerateEcdhSharedKey() 127 …(void)memcpy_s(params->pakeParams.psk.val, sharedKeyAliasLen, SHARED_KEY_ALIAS, sharedKeyAliasLen); in GenerateEcdhSharedKey() [all …]
|
/base/hiviewdfx/hisysevent/interfaces/native/innerkits/hisysevent_manager/ |
D | hisysevent_record.cpp | 173 [this] (JsonValue val) { in GetParamValue() argument 174 return !(this->IsInt64ValueType(val)); in GetParamValue() 184 [this] (JsonValue val) { in GetParamValue() argument 185 return !(this->IsUInt64ValueType(val)); in GetParamValue() 195 [this] (JsonValue val) { in GetParamValue() argument 196 return !(this->IsDoubleValueType(val)); in GetParamValue() 206 [this] (JsonValue val) { in GetParamValue() argument 207 return !(this->IsStringValueType(val)); in GetParamValue() 217 [this] (JsonValue val) { in GetParamValue() argument 218 return !(this->IsArray(val, in GetParamValue() [all …]
|
/base/security/device_auth/services/authenticators/src/account_unrelated/pake_task/standard_exchange_task/ |
D | common_standard_bind_exchange.c | 33 params->pubKeyPeer.val = (uint8_t *)HcMalloc(params->pubKeyPeer.length, 0); in InitStandardBindExchangeParams() 34 if (params->pubKeyPeer.val == NULL) { in InitStandardBindExchangeParams() 40 params->pubKeySelf.val = (uint8_t *)HcMalloc(params->pubKeySelf.length, 0); in InitStandardBindExchangeParams() 41 if (params->pubKeySelf.val == NULL) { in InitStandardBindExchangeParams() 47 params->nonce.val = (uint8_t *)HcMalloc(params->nonce.length, 0); in InitStandardBindExchangeParams() 48 if (params->nonce.val == NULL) { in InitStandardBindExchangeParams() 54 params->authInfo.val = NULL; in InitStandardBindExchangeParams() 56 params->exInfoCipher.val = NULL; in InitStandardBindExchangeParams() 69 if (params->pubKeySelf.val != NULL) { in DestroyStandardBindExchangeParams() 70 HcFree(params->pubKeySelf.val); in DestroyStandardBindExchangeParams() [all …]
|
/base/security/device_auth/frameworks/deviceauth_lite/source/auth_info/ |
D | exchange_auth_info_client.c | 110 FREE(plain.val); in parse_exchange_response_data() 115 FREE(plain.val); in parse_exchange_response_data() 146 FREE(auth_info.val); in build_exchange_request() 153 plain.val = (uint8_t *)MALLOC(plain.size); in build_exchange_request() 154 if (plain.val == NULL) { in build_exchange_request() 155 FREE(auth_info.val); in build_exchange_request() 158 (void)memset_s(plain.val, plain.size, 0, plain.size); in build_exchange_request() 159 if (memcpy_s(plain.val, plain.size, auth_info.val, auth_info.length) != EOK) { in build_exchange_request() 160 FREE(auth_info.val); in build_exchange_request() 161 FREE(plain.val); in build_exchange_request() [all …]
|
D | exchange_auth_info.c | 101 FREE(plain.val); in parse_exchange_request_data() 107 FREE(plain.val); in parse_exchange_request_data() 108 plain.val = NULL; in parse_exchange_request_data() 143 FREE(auth_info.val); in build_exchange_response_data() 149 plain.val = (uint8_t *)MALLOC(plain.size); in build_exchange_response_data() 150 if (plain.val == NULL) { in build_exchange_response_data() 152 FREE(auth_info.val); in build_exchange_response_data() 155 (void)memset_s(plain.val, plain.size, 0, plain.size); in build_exchange_response_data() 156 (void)memcpy_s(plain.val, plain.size, auth_info.val, auth_info.length); in build_exchange_response_data() 158 FREE(auth_info.val); in build_exchange_response_data() [all …]
|
/base/security/device_auth/services/authenticators/src/account_unrelated/ |
D | das_task_common.c | 174 serviceIdPlain.val = (uint8_t *)HcMalloc(serviceIdPlain.length, 0); in CombineServiceId() 175 if (serviceIdPlain.val == NULL) { 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() 199 HcFree(serviceIdPlain.val); in CombineServiceId() 209 keyAliasBuff.val = (uint8_t *)HcMalloc(keyAliasBuff.length, 0); in CombineKeyAlias() 210 if (keyAliasBuff.val == NULL) { in CombineKeyAlias() 217 if (memcpy_s(keyAliasBuff.val, totalLen, serviceId->val, serviceId->length) != EOK) { in CombineKeyAlias() 224 …if (memcpy_s(keyAliasBuff.val + usedLen, totalLen - usedLen, keyType->val, keyType->length) != EOK… in CombineKeyAlias() [all …]
|
/base/security/device_auth/services/protocol/src/iso_protocol/ |
D | iso_protocol_common.c | 32 params->randSelf.val = (uint8_t *)HcMalloc(params->randSelf.length, 0); in InitIsoBaseParams() 33 if (params->randSelf.val == NULL) { in InitIsoBaseParams() 39 params->randPeer.val = (uint8_t *)HcMalloc(params->randPeer.length, 0); in InitIsoBaseParams() 40 if (params->randPeer.val == NULL) { in InitIsoBaseParams() 47 params->sessionKey.val = (uint8_t *)HcMalloc(params->sessionKey.length, 0); in InitIsoBaseParams() 48 if (params->sessionKey.val == NULL) { in InitIsoBaseParams() 75 HcFree(params->randSelf.val); in DestroyIsoBaseParams() 76 params->randSelf.val = NULL; in DestroyIsoBaseParams() 78 HcFree(params->randPeer.val); in DestroyIsoBaseParams() 79 params->randPeer.val = NULL; in DestroyIsoBaseParams() [all …]
|
/base/security/device_auth/services/authenticators/src/account_unrelated/pake_task/pake_v1_task/pake_v1_protocol_task/ |
D | pake_v1_protocol_task_common.c | 35 if (params->returnKey.val != NULL) { in DestroyDasPakeV1Params() 36 … (void)memset_s(params->returnKey.val, params->returnKey.length, 0, params->returnKey.length); in DestroyDasPakeV1Params() 37 HcFree(params->returnKey.val); in DestroyDasPakeV1Params() 38 params->returnKey.val = NULL; in DestroyDasPakeV1Params() 47 HcFree(params->nonce.val); in DestroyDasPakeV1Params() 48 params->nonce.val = NULL; in DestroyDasPakeV1Params() 54 params->returnKey.val = NULL; in AllocReturnKey() 103 if (hex->val[i] >= 'A' && hex->val[i] <= 'F') { in UpperToLowercase() 104 hex->val[i] += ASCII_CASE_DIFFERENCE_VALUE; in UpperToLowercase() 117 if (ByteToHexString(srcPsk->val, srcPsk->length, (char *)params->baseParams.psk.val, in ConvertPsk() [all …]
|
/base/hiviewdfx/hitrace/interfaces/js/kits/napi/src/ |
D | napi_hitrace_js.cpp | 73 napi_value val = nullptr; in Begin() local 74 NapiHitraceUtil::CreateHiTraceIdJsObject(env, traceId, val); in Begin() 78 return val; in Begin() 83 return val; in Begin() 90 return val; in Begin() 93 NapiHitraceUtil::CreateHiTraceIdJsObject(env, traceId, val); in Begin() 94 return val; in Begin() 121 napi_value val = nullptr; in GetId() local 122 NapiHitraceUtil::CreateHiTraceIdJsObject(env, traceId, val); in GetId() 123 return val; in GetId() [all …]
|
/base/hiviewdfx/hiview/base/event_raw/encoded/ |
D | raw_data_encoder.cpp | 32 bool RawDataEncoder::StringValueEncoded(RawData& data, const std::string& val) in StringValueEncoded() argument 34 HiLog::Debug(LABEL, "Length of encoded string is %{public}zu.", val.length()); in StringValueEncoded() 35 if (!UnsignedVarintEncoded(data, EncodeType::LENGTH_DELIMITED, val.length())) { in StringValueEncoded() 38 if (!data.Append(reinterpret_cast<uint8_t*>(const_cast<char*>(val.c_str())), in StringValueEncoded() 39 val.length())) { in StringValueEncoded()
|