Home
last modified time | relevance | path

Searched refs:secret (Results 1 - 24 of 24) sorted by relevance

/base/security/asset/test/unittest/inner_kits_rust/src/
H A Dupdate.rs22 let secret = function!().as_bytes(); in update_same_secret()
23 add_default_asset(alias, secret).unwrap(); in update_same_secret()
29 update.insert_attr(Tag::Secret, secret.to_owned()); in update_same_secret()
39 let secret = function!().as_bytes(); in update_different_secret()
40 add_default_asset(alias, secret).unwrap(); in update_different_secret()
62 let secret = function!().as_bytes(); in update_attr_normal()
63 add_default_asset(alias, secret).unwrap(); in update_attr_normal()
H A Dadd.rs90 let secret = "中文"; in add_chinese_secret()
93 attrs.insert_attr(Tag::Secret, secret.as_bytes().to_owned()); in add_chinese_secret()
100 assert_eq!(secret, String::from_utf8(bytes.to_owned()).unwrap()); in add_chinese_secret()
/base/security/device_auth/services/protocol/src/pake_protocol/pake_protocol_dl_common_mock/
H A Dpake_protocol_dl_common_mock.c28 int32_t GenerateDlPakeParams(PakeBaseParams *params, const Uint8Buff *secret) in GenerateDlPakeParams() argument
31 (void)secret; in GenerateDlPakeParams()
/base/security/device_auth/services/protocol/src/pake_protocol/pake_protocol_ec_common_mock/
H A Dpake_protocol_ec_common_mock.c28 int32_t GenerateEcPakeParams(PakeBaseParams *params, Uint8Buff *secret) in GenerateEcPakeParams() argument
31 (void)secret; in GenerateEcPakeParams()
/base/security/asset/services/core_service/src/operations/
H A Doperation_query.rs44 let secret = db_data.get_bytes_attr(&column::SECRET)?; in upgrade_version()
46 let cipher = Crypto::encrypt(&secret_key, secret, &common::build_aad(db_data)?)?; in upgrade_version()
63 let secret = db_data.get_bytes_attr(&column::SECRET)?; in decrypt_secret()
65 let secret = Crypto::decrypt(&secret_key, secret, &common::build_aad(db_data)?)?; in decrypt_secret()
66 db_data.insert(column::SECRET, Value::Bytes(secret)); in decrypt_secret()
75 let secret = db_data.get_bytes_attr(&column::SECRET)?; in exec_crypto()
80 let secret = crypto.exec_crypt(secret, &common::build_aad(db_data)?, auth_token)?; in exec_crypto()
81 db_data.insert(column::SECRET, Value::Bytes(secret)); in exec_crypto()
[all...]
H A Doperation_update.rs31 let secret = db_data.get_bytes_attr(&column::SECRET)?; in encrypt()
32 let cipher = Crypto::encrypt(&secret_key, secret, &common::build_aad(db_data)?)?; in encrypt()
H A Doperation_add.rs39 let secret = db_data.get_bytes_attr(&column::SECRET)?; in encrypt_secret()
40 let cipher = Crypto::encrypt(&secret_key, secret, &common::build_aad(db_data)?)?; in encrypt_secret()
/base/security/asset/test/unittest/kits_ndk/src/
H A Dasset_add_test.cpp96 * @tc.desc: Add empty alias and secret, expect ASSET_INVALID_ARGUMENT
103 Asset_Blob secret = { .size = 0, .data = reinterpret_cast<uint8_t*>(const_cast<char*>(__func__)) }; in HWTEST_F() local
106 { .tag = ASSET_TAG_SECRET, .value.blob = secret }, in HWTEST_F()
114 * @tc.desc: Add alias and secret with wrong blob-u32/blob-boolean data type, expect ASSET_INVALID_ARGUMENT
130 * @tc.desc: Add alias and secret with wrong u32-boolean data type, expect ASSET_INVALID_ARGUMENT
137 Asset_Blob secret = { .size = 0, .data = reinterpret_cast<uint8_t*>(const_cast<char*>(__func__)) }; in HWTEST_F() local
140 { .tag = ASSET_TAG_SECRET, .value.blob = secret }, in HWTEST_F()
149 * @tc.desc: Add alias and secret with wrong bool-blob data type, expect ASSET_INVALID_ARGUMENT
156 Asset_Blob secret = { .size = 0, .data = reinterpret_cast<uint8_t*>(const_cast<char*>(__func__)) }; in HWTEST_F() local
159 { .tag = ASSET_TAG_SECRET, .value.blob = secret }, in HWTEST_F()
[all...]
/base/security/device_auth/services/protocol/src/pake_protocol/pake_v1_protocol/
H A Dpake_v1_protocol_common.c180 Uint8Buff secret = { secretVal, PAKE_SECRET_LEN }; in GeneratePakeParams() local
199 res = params->loader->computeHkdf(&keyParams, &(params->salt), &keyInfo, &secret); in GeneratePakeParams()
201 PRINT_DEBUG_MSG(secret.val, secret.length, "secretValue"); in GeneratePakeParams()
203 LOGE("Derive secret from psk failed, res: %x.", res); in GeneratePakeParams()
209 res = GenerateEcPakeParams(params, &secret); in GeneratePakeParams()
211 res = GenerateDlPakeParams(params, &secret); in GeneratePakeParams()
220 (void)memset_s(secret.val, secret.length, 0, secret in GeneratePakeParams()
[all...]
/base/account/os_account/services/accountmgr/include/account_iam/
H A Dinner_account_iam_manager.h60 void HandleFileKeyException(int32_t userId, const std::vector<uint8_t> &secret,
64 ErrCode ActivateUserKey(int32_t userId, const std::vector<uint8_t> &token, const std::vector<uint8_t> &secret);
66 ErrCode UnlockUserScreen(int32_t userId, const std::vector<uint8_t> &token, const std::vector<uint8_t> &secret);
94 int32_t userId, const std::vector<uint8_t> &token, const std::vector<uint8_t> &secret);
96 int32_t userId, const std::vector<uint8_t> &token, const std::vector<uint8_t> &secret);
/base/security/device_auth/services/protocol/inc/pake_protocol/pake_protocol_dl_common/
H A Dpake_protocol_dl_common.h28 int32_t GenerateDlPakeParams(PakeBaseParams *params, const Uint8Buff *secret);
/base/security/device_auth/services/protocol/inc/pake_protocol/pake_protocol_ec_common/
H A Dpake_protocol_ec_common.h28 int32_t GenerateEcPakeParams(PakeBaseParams *params, Uint8Buff *secret);
/base/security/device_auth/services/session_manager/src/session/v2/auth_sub_session/protocol_lib/
H A Dec_speke_protocol.c206 static int32_t CalSecret(EcSpekeParams *params, Uint8Buff *secret) in CalSecret() argument
210 int32_t res = GetLoaderInstance()->computeHkdf(&keyParams, &(params->salt), &keyInfo, secret); in CalSecret()
212 LOGE("Derive secret from psk failed, res: %x.", res); in CalSecret()
215 PRINT_DEBUG_MSG(secret->val, secret->length, "secretValue"); in CalSecret()
220 static int32_t EcSpekeCalBase(EcSpekeParams *params, Uint8Buff *secret) in EcSpekeCalBase() argument
239 res = GetLoaderInstance()->hashToPoint(secret, algo, &params->base); in EcSpekeCalBase()
241 LOGE("HashToPoint from secret to base failed, res: %x", res); in EcSpekeCalBase()
677 Uint8Buff secret = { secretVal, EC_SPEKE_SECRET_LEN }; in EcSpekeServerStartRspProcEvent() local
678 res = CalSecret(&impl->params, &secret); in EcSpekeServerStartRspProcEvent()
754 Uint8Buff secret = { secretVal, EC_SPEKE_SECRET_LEN }; EcSpekeClientFinishReqProcEvent() local
[all...]
H A Ddl_speke_protocol.c256 static int32_t CalSecret(DlSpekeParams *params, Uint8Buff *secret) in CalSecret() argument
260 int32_t res = GetLoaderInstance()->computeHkdf(&keyParams, &(params->salt), &keyInfo, secret); in CalSecret()
262 LOGE("Derive secret from psk failed, res: %x.", res); in CalSecret()
287 static int32_t DlSpekeCalBase(DlSpekeParams *params, Uint8Buff *secret) in DlSpekeCalBase() argument
297 int32_t res = GetLoaderInstance()->bigNumExpMod(secret, &exp, params->largePrimeNumHex, &params->base); in DlSpekeCalBase()
678 Uint8Buff secret = { secretVal, DL_SPEKE_SECRET_LEN }; in DlSpekeServerStartRspProcEvent() local
679 res = CalSecret(&impl->params, &secret); in DlSpekeServerStartRspProcEvent()
683 res = DlSpekeCalBase(&impl->params, &secret); in DlSpekeServerStartRspProcEvent()
755 Uint8Buff secret = { secretVal, DL_SPEKE_SECRET_LEN }; in DlSpekeClientFinishReqProcEvent() local
756 int32_t res = CalSecret(&impl->params, &secret); in DlSpekeClientFinishReqProcEvent()
[all...]
/base/security/device_auth/frameworks/deviceauth_lite/source/key_agreement/
H A Dpake_client.c199 struct hkdf secret = { 0, {0} }; in parse_start_response_data() local
201 HICHAIN_SPEKE_BASE_INFO, HC_HKDF_SECRET_LEN, (struct var_buffer *)&secret); in parse_start_response_data()
211 (void)memset_s(&secret, sizeof(struct hkdf), 0, sizeof(struct hkdf)); in parse_start_response_data()
218 (void)memset_s(&secret, sizeof(struct hkdf), 0, sizeof(struct hkdf)); in parse_start_response_data()
229 ret = cal_bignum_exp((struct var_buffer *)&secret, (struct var_buffer *)&exp, prime_len, (struct big_num *)&base); in parse_start_response_data()
230 (void)memset_s(&secret, sizeof(struct hkdf), 0, sizeof(struct hkdf)); in parse_start_response_data()
308 LOGE("Object %u generate shared secret failed, error code is %d", pake_client_sn(pake_client), ret); in generate_session_key()
/base/account/os_account/services/accountmgr/src/account_iam/
H A Dinner_account_iam_manager.cpp452 void InnerAccountIAMManager::HandleFileKeyException(int32_t userId, const std::vector<uint8_t> &secret, in HandleFileKeyException() argument
480 code = UpdateStorageUserAuth(userId, callback->secureUid_, token, {}, secret); in HandleFileKeyException()
689 int32_t userId, const std::vector<uint8_t> &token, const std::vector<uint8_t> &secret) in UnlockUserScreen()
694 errCode = InnerUnlockUserScreen(userId, token, secret); in UnlockUserScreen()
706 int32_t userId, const std::vector<uint8_t> &token, const std::vector<uint8_t> &secret) in InnerUnlockUserScreen()
714 ErrCode result = storageMgrProxy->UnlockUserScreen(userId, token, secret); in InnerUnlockUserScreen()
724 int32_t userId, const std::vector<uint8_t> &token, const std::vector<uint8_t> &secret) in ActivateUserKey()
729 errCode = InnerActivateUserKey(userId, token, secret); in ActivateUserKey()
741 int32_t userId, const std::vector<uint8_t> &token, const std::vector<uint8_t> &secret) in InnerActivateUserKey()
749 ErrCode result = storageMgrProxy->ActiveUserKey(userId, token, secret); in InnerActivateUserKey()
688 UnlockUserScreen( int32_t userId, const std::vector<uint8_t> &token, const std::vector<uint8_t> &secret) UnlockUserScreen() argument
705 InnerUnlockUserScreen( int32_t userId, const std::vector<uint8_t> &token, const std::vector<uint8_t> &secret) InnerUnlockUserScreen() argument
723 ActivateUserKey( int32_t userId, const std::vector<uint8_t> &token, const std::vector<uint8_t> &secret) ActivateUserKey() argument
740 InnerActivateUserKey( int32_t userId, const std::vector<uint8_t> &token, const std::vector<uint8_t> &secret) InnerActivateUserKey() argument
[all...]
H A Daccount_iam_callback.cpp70 std::vector<uint8_t> secret; in HandleAuthResult() local
71 extraInfo.GetUint8ArrayValue(Attributes::ATTR_ROOT_SECRET, secret); in HandleAuthResult()
74 (void)InnerAccountIAMManager::GetInstance().HandleFileKeyException(accountId, secret, token); in HandleAuthResult()
79 ret = InnerAccountIAMManager::GetInstance().ActivateUserKey(accountId, token, secret); in HandleAuthResult()
97 ret = InnerAccountIAMManager::GetInstance().UnlockUserScreen(accountId, token, secret); in HandleAuthResult()
/base/security/device_auth/services/protocol/src/pake_protocol/pake_v2_protocol/
H A Dpake_v2_protocol_common.c174 Uint8Buff secret = { secretVal, PAKE_SECRET_LEN }; in GeneratePakeParams() local
185 res = params->loader->computeHkdf(&keyParams, &(params->salt), &keyInfo, &secret); in GeneratePakeParams()
187 LOGE("Derive secret from psk failed, res: %x.", res); in GeneratePakeParams()
193 res = GenerateEcPakeParams(params, &secret); in GeneratePakeParams()
195 res = GenerateDlPakeParams(params, &secret); in GeneratePakeParams()
203 (void)memset_s(secret.val, secret.length, 0, secret.length); in GeneratePakeParams()
206 (void)memset_s(secret.val, secret in GeneratePakeParams()
[all...]
/base/security/device_auth/services/protocol/src/pake_protocol/pake_protocol_dl_common/
H A Dpake_protocol_dl_common.c125 int32_t GenerateDlPakeParams(PakeBaseParams *params, const Uint8Buff *secret) in GenerateDlPakeParams() argument
141 res = params->loader->bigNumExpMod(secret, &exp, params->largePrimeNumHex, &params->base); in GenerateDlPakeParams()
/base/security/device_auth/services/protocol/src/pake_protocol/pake_protocol_ec_common/
H A Dpake_protocol_ec_common.c77 int32_t GenerateEcPakeParams(PakeBaseParams *params, Uint8Buff *secret) in GenerateEcPakeParams() argument
92 res = params->loader->hashToPoint(secret, alg, &params->base); in GenerateEcPakeParams()
94 LOGE("HashToPoint from secret to base failed, res: %x.", res); in GenerateEcPakeParams()
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/common/
H A Dmbedtls_ec_adapter.c403 mbedtls_mpi *secret = HcMalloc(sizeof(mbedtls_mpi), 0); in EcKeyAgreement() local
407 if ((secret == NULL) || (keyPair == NULL) || (entropy == NULL) || (ctrDrbg == NULL)) { in EcKeyAgreement()
409 HcFree(secret); in EcKeyAgreement()
415 mbedtls_mpi_init(secret); in EcKeyAgreement()
430 LOG_AND_GOTO_CLEANUP_IF_FAIL(EcKeyAgreementLog(keyPair, &p, ctrDrbg), "Compute secret key failed.\n"); in EcKeyAgreement()
431 LOG_AND_GOTO_CLEANUP_IF_FAIL(mbedtls_mpi_copy(secret, &p.MBEDTLS_PRIVATE(X)), "Copy secret failed.\n"); in EcKeyAgreement()
434 mbedtls_mpi_free(secret); in EcKeyAgreement()
439 HcFree(secret); in EcKeyAgreement()
/base/account/os_account/services/accountmgr/test/unittest/account_iam/
H A Daccount_iam_manager_test.cpp248 int32_t ActiveUserKey(uint32_t userId, const std::vector<uint8_t> &token, const std::vector<uint8_t> &secret) in ActiveUserKey() argument
287 const std::vector<uint8_t> &secret) in CreateRecoverKey()
297 int32_t UnlockUserScreen(uint32_t userId, const std::vector<uint8_t> &token, const std::vector<uint8_t> &secret) in UnlockUserScreen() argument
284 CreateRecoverKey(uint32_t userId, uint32_t userType, const std::vector<uint8_t> &token, const std::vector<uint8_t> &secret) CreateRecoverKey() argument
/base/account/os_account/services/accountmgr/src/appaccount/
H A Dapp_account_control_manager.cpp116 AssetAttr *secret = AssetParseAttr(resultSet.results, SEC_ASSET_TAG_SECRET); in GetDataFromAsset() local
117 if (secret == nullptr) { in GetDataFromAsset()
118 ACCOUNT_LOGE("secret is nullptr"); in GetDataFromAsset()
121 AssetBlob valueBlob = secret->value.blob; in GetDataFromAsset()
/base/security/device_auth/test/unittest/deviceauth/source/
H A Ddeviceauth_interface_test.cpp221 Uint8Buff secret = { secretVal, 16 }; in HWTEST_F() local
222 res = GenerateDlPakeParams(baseParams, &secret); in HWTEST_F()

Completed in 19 milliseconds