Home
last modified time | relevance | path

Searched refs:publicKey (Results 1 – 25 of 106) sorted by relevance

12345

/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/
Dhks_export_test_mt.cpp72 …HksBlob publicKey = { .size = HKS_ECC_KEY_SIZE_224, .data = (uint8_t *)HksMalloc(HKS_ECC_KEY_SIZE_… variable
73 if (publicKey.data != nullptr) {
74 EXPECT_EQ(HksExportPublicKey(&testAlias, nullptr, &publicKey), HKS_SUCCESS);
77 HksFree(publicKey.data);
87 …HksBlob publicKey = { .size = HKS_ECC_KEY_SIZE_224, .data = (uint8_t *)HksMalloc(HKS_ECC_KEY_SIZE_… variable
88 if (publicKey.data != nullptr) {
89 EXPECT_EQ(HksExportPublicKey(nullptr, nullptr, &publicKey), HKS_ERROR_NULL_POINTER);
92 HksFree(publicKey.data);
115 …HksBlob publicKey = { .size = HKS_ECC_KEY_SIZE_224, .data = (uint8_t *)HksMalloc(HKS_ECC_KEY_SIZE_… variable
116 if (publicKey.data != nullptr) {
[all …]
Dhks_ecdh_agree_test_common.cpp22 int32_t HksEcdhAgreeFinish(const struct HksBlob *keyAlias, const struct HksBlob *publicKey, in HksEcdhAgreeFinish() argument
40 ret = HksUpdate(&handle, initParamSet, publicKey, &outDataUpdate); in HksEcdhAgreeFinish()
54 int32_t HksEcdhAgreeAbort(const struct HksBlob *keyAlias, const struct HksBlob *publicKey, in HksEcdhAgreeAbort() argument
67 ret = HksUpdate(&handle, initParamSet, publicKey, &outDataUpdate); in HksEcdhAgreeAbort()
/base/security/huks/interfaces/innerkits/huks_standard/main/src/
Dhks_api_adapter.c72 struct HksBlob publicKey = { 0, NULL }; in HksAgreeKeyAdapter() local
73 int32_t ret = GetHksPubKeyInnerFormat(paramSet, peerPublicKey, &publicKey); in HksAgreeKeyAdapter()
79 ret = HksClientAgreeKey(paramSet, privateKey, &publicKey, agreedKey); in HksAgreeKeyAdapter()
80 (void)memset_s(publicKey.data, publicKey.size, 0, publicKey.size); in HksAgreeKeyAdapter()
81 HKS_FREE_BLOB(publicKey); in HksAgreeKeyAdapter()
93 struct HksBlob publicKey = { MAX_KEY_SIZE, buffer }; in HksExportPublicKeyAdapter() local
95 int32_t ret = HksClientExportPublicKey(keyAlias, paramSet, &publicKey); in HksExportPublicKeyAdapter()
98 ret = TranslateToX509PublicKey(&publicKey, &x509Key); in HksExportPublicKeyAdapter()
113 HKS_FREE_BLOB(publicKey); in HksExportPublicKeyAdapter()
/base/security/huks/utils/crypto_adapter/
Dhks_client_service_adapter_lite.c212 static int32_t Curve25519ToX509PublicKey(const struct HksBlob *publicKey, struct HksBlob *x509Key) in Curve25519ToX509PublicKey() argument
214 if (publicKey->size != HKS_KEY_BYTES(HKS_CURVE25519_KEY_SIZE_256)) { in Curve25519ToX509PublicKey()
215 HKS_LOG_E("Invalid public key size! key size = 0x%" LOG_PUBLIC "X", publicKey->size); in Curve25519ToX509PublicKey()
219 x509Key->data = (uint8_t *)HksMalloc(publicKey->size); in Curve25519ToX509PublicKey()
223 if (memcpy_s(x509Key->data, publicKey->size, publicKey->data, publicKey->size) != EOK) { in Curve25519ToX509PublicKey()
228 x509Key->size = publicKey->size; in Curve25519ToX509PublicKey()
234 int32_t TranslateToX509PublicKey(const struct HksBlob *publicKey, struct HksBlob *x509Key) in TranslateToX509PublicKey() argument
238 …if ((publicKey == NULL) || (publicKey->data == NULL) || (publicKey->size == 0) || (x509Key == NULL… in TranslateToX509PublicKey()
243 if (publicKey->size < sizeof(struct HksPubKeyInfo)) { in TranslateToX509PublicKey()
248 struct HksPubKeyInfo *publicKeyInfo = (struct HksPubKeyInfo *)publicKey->data; in TranslateToX509PublicKey()
[all …]
Dhks_client_service_adapter.c195 …const struct HksBlob *publicKey, struct HksBlob *y, struct HksBlob *p, struct HksBlob *q, struct H… in GetDsaPubKeyParam() argument
197 if (publicKey->size < sizeof(struct KeyMaterialDsa)) { in GetDsaPubKeyParam()
202 struct KeyMaterialDsa *keyMaterial = (struct KeyMaterialDsa *)publicKey->data; in GetDsaPubKeyParam()
205 if (publicKey->size < keyMaterialSize) { in GetDsaPubKeyParam()
211 y->data = publicKey->data + offset; in GetDsaPubKeyParam()
214 p->data = publicKey->data + offset; in GetDsaPubKeyParam()
217 q->data = publicKey->data + offset; in GetDsaPubKeyParam()
220 g->data = publicKey->data + offset; in GetDsaPubKeyParam()
276 static int32_t DsaPublicKeyToX509(const struct HksBlob *publicKey, struct HksBlob *x509Key) in DsaPublicKeyToX509() argument
282 int32_t ret = GetDsaPubKeyParam(publicKey, &y, &p, &q, &g); in DsaPublicKeyToX509()
[all …]
Dhks_client_service_adapter.h27 int32_t TranslateToX509PublicKey(const struct HksBlob *publicKey, struct HksBlob *x509Key);
29 …ateFromX509PublicKey(const uint32_t alg, const struct HksBlob *x509Key, struct HksBlob *publicKey);
/base/security/device_security_level/oem_property/common/
Ddslm_credential_utils.c60 PublicKey publicKey; member
179 … int32_t ret = EcdsaVerify(&root->publicKey, &root->signature, &root->publicKey, root->algorithm); in VerifyCredentialCb()
187 …ret = EcdsaVerify(&intermediate->publicKey, &intermediate->signature, &root->publicKey, intermedia… in VerifyCredentialCb()
195 … ret = EcdsaVerify(&last->publicKey, &last->signature, &intermediate->publicKey, last->algorithm); in VerifyCredentialCb()
203 ret = EcdsaVerify(&payload->payload, &payload->signature, &last->publicKey, TYPE_ECDSA_SHA_384); in VerifyCredentialCb()
205 … ret = EcdsaVerify(&payload->payload, &payload->signature, &last->publicKey, TYPE_ECDSA_SHA_256); in VerifyCredentialCb()
298 if (attestation->publicKey.data != NULL) { in FreePublicKeyAttestation()
299 FREE(attestation->publicKey.data); in FreePublicKeyAttestation()
379 …attestation->publicKey.length = (uint32_t)Base64UrlDecodeApp((uint8_t *)pbkData, &attestation->pub… in ParsePublicKeyAttestation()
380 if (attestation->publicKey.length == 0 || attestation->publicKey.data == NULL) { in ParsePublicKeyAttestation()
[all …]
/base/security/huks/frameworks/huks_standard/main/common/src/
Dhks_crypto_adapter.c403 uint8_t *publicKey = (uint8_t *)HksMalloc(publicKeySize); in FormatRsaKey() local
404 HKS_IF_NULL_LOGE_RETURN(publicKey, HKS_ERROR_MALLOC_FAIL, "malloc public key failed.") in FormatRsaKey() local
406 (void)memcpy_s(publicKey, publicKeySize, keyIn->data, publicKeySize); in FormatRsaKey()
407 ((struct KeyMaterialRsa *)publicKey)->dSize = 0; in FormatRsaKey()
412 .blob = { publicKeySize, publicKey }, in FormatRsaKey()
420 (void)memset_s(publicKey, publicKeySize, 0, publicKeySize); in FormatRsaKey()
421 HksFree(publicKey); in FormatRsaKey()
454 uint8_t *publicKey = (uint8_t *)HksMalloc(publicKeySize); in FormatDsaKey() local
455 HKS_IF_NULL_LOGE_RETURN(publicKey, HKS_ERROR_MALLOC_FAIL, "malloc key failed.") in FormatDsaKey() local
457 (void)memcpy_s(publicKey, publicKeySize, keyIn->data, sizeof(struct KeyMaterialDsa)); in FormatDsaKey()
[all …]
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/alg_module_test/src/
Dhks_rsa_common_mt.cpp53 HksBlob publicKey = { .size = pubKeyExport->blob.size, .data = in GenerateKeyTestCase() local
55 ASSERT_NE(publicKey.data, nullptr); in GenerateKeyTestCase()
56 …(void)memcpy_s(publicKey.data, pubKeyExport->blob.size, pubKeyExport->blob.data, pubKeyExport->blo… in GenerateKeyTestCase()
76 …EXPECT_EQ(EncryptRsa(&plainText, &cipherText, &publicKey, testCaseParams.padding, testCaseParams.k… in GenerateKeyTestCase()
91 HksFree(publicKey.data); in GenerateKeyTestCase()
118 HksBlob publicKey = { .size = pubKeyExport->blob.size, in EncryptLocalTestCase() local
120 ASSERT_NE(publicKey.data, nullptr); in EncryptLocalTestCase()
121 …(void)memcpy_s(publicKey.data, pubKeyExport->blob.size, pubKeyExport->blob.data, pubKeyExport->blo… in EncryptLocalTestCase()
143 …EXPECT_EQ(HksEncrypt(&publicKey, paramInSet, &plainText, &cipherText), testCaseParams.encryptResul… in EncryptLocalTestCase()
158 HksFree(publicKey.data); in EncryptLocalTestCase()
[all …]
/base/useriam/user_auth_framework/test/fuzztest/clients/coauthclient_fuzzer/
Dco_auth_client_fuzzer.cpp36 const std::vector<uint8_t> &publicKey, const std::vector<uint64_t> &templateIds) in OnMessengerReady() argument
40 static_cast<void>(publicKey); in OnMessengerReady()
44 int32_t OnBeginExecute(uint64_t scheduleId, const std::vector<uint8_t> &publicKey, in OnBeginExecute() argument
49 static_cast<void>(publicKey); in OnBeginExecute()
116 Common::FillFuzzUint8Vector(parcel, info.publicKey); in FillExecutorInfo()
148 std::vector<uint8_t> publicKey; in FuzzExecutorCallbackServiceOnMessengerReady() local
149 Common::FillFuzzUint8Vector(parcel, publicKey); in FuzzExecutorCallbackServiceOnMessengerReady()
153 g_ExecutorCallbackService->OnMessengerReady(messenger, publicKey, templateIdList); in FuzzExecutorCallbackServiceOnMessengerReady()
162 std::vector<uint8_t> publicKey; in FuzzExecutorCallbackServiceOnBeginExecute() local
163 Common::FillFuzzUint8Vector(parcel, publicKey); in FuzzExecutorCallbackServiceOnBeginExecute()
[all …]
/base/useriam/user_auth_framework/frameworks/native/client/src/
Dexecutor_callback_service.cpp33 const std::vector<uint8_t> &publicKey, const std::vector<uint64_t> &templateIdList) in OnMessengerReady() argument
44 callback_->OnMessengerReady(wrapper, publicKey, templateIdList); in OnMessengerReady()
47 …ExecutorCallbackService::OnBeginExecute(uint64_t scheduleId, const std::vector<uint8_t> &publicKey, in OnBeginExecute() argument
54 return callback_->OnBeginExecute(scheduleId, publicKey, command); in OnBeginExecute()
/base/useriam/user_auth_framework/frameworks/native/ipc/src/
Dexecutor_callback_stub.cpp64 std::vector<uint8_t> publicKey; in OnMessengerReadyStub() local
67 if (!data.ReadUInt8Vector(&publicKey)) { in OnMessengerReadyStub()
76 OnMessengerReady(messenger, publicKey, templateIds); in OnMessengerReadyStub()
83 std::vector<uint8_t> publicKey; in OnBeginExecuteStub() local
90 if (!data.ReadUInt8Vector(&publicKey)) { in OnBeginExecuteStub()
100 int32_t result = OnBeginExecute(scheduleId, publicKey, commandAttrs); in OnBeginExecuteStub()
/base/update/ota_lite/frameworks/source/verify/
Dapp_rsa.c31 int32 AppRsaDecodePublicKey(AppRsaContext *rsa, const uint8 *publicKey, uint32 length) in AppRsaDecodePublicKey() argument
33 if ((rsa == NULL) || (publicKey == NULL)) { in AppRsaDecodePublicKey()
37 int32 parseRet = mbedtls_pk_parse_public_key(&rsa->context, publicKey, length); in AppRsaDecodePublicKey()
/base/useriam/user_auth_framework/test/fuzztest/services/servicecore_fuzzer/src/
Dresource_node_fuzzer.cpp31 …nMessengerReady(sptr<ExecutorMessengerInterface> &messenger, const std::vector<uint8_t> &publicKey, in OnMessengerReady() argument
36 static_cast<void>(publicKey); in OnMessengerReady()
40 int32_t OnBeginExecute(uint64_t scheduleId, const std::vector<uint8_t> &publicKey, in OnBeginExecute() argument
45 static_cast<void>(publicKey); in OnBeginExecute()
92 Common::FillFuzzUint8Vector(parcel, info.publicKey); in GetResourceNode()
197 std::vector<uint8_t> publicKey; in FuzzResourceNodeBeginExecute() local
198 Common::FillFuzzUint8Vector(parcel, publicKey); in FuzzResourceNodeBeginExecute()
204 node->BeginExecute(scheduleId, publicKey, command); in FuzzResourceNodeBeginExecute()
/base/security/huks/services/huks_standard/huks_engine/main/core/src/
Dhks_attest_utils.c115 uint8_t *publicKey = (uint8_t *)(info + 1); in GetEcPublicKey() local
116 (void)memcpy_s(p, totalSize - spkiHeaderLen, publicKey, info->nOrXSize); in GetEcPublicKey()
118 …(void)memcpy_s(p, totalSize - spkiHeaderLen - info->nOrXSize, publicKey + info->nOrXSize, info->eO… in GetEcPublicKey()
132 uint8_t *publicKey = (uint8_t *)(info + 1); in ConstructKeySeq() local
133 struct HksAsn1Blob n = { ASN_1_TAG_TYPE_INT, info->nOrXSize, publicKey }; in ConstructKeySeq()
137 struct HksAsn1Blob e = { ASN_1_TAG_TYPE_INT, info->eOrYSize, publicKey + info->nOrXSize }; in ConstructKeySeq()
201 uint8_t *publicKey = (uint8_t *)(info + 1); in GetX25519PublicKey()
202 struct HksAsn1Blob spkiBlob = { ASN_1_TAG_TYPE_BIT_STR, info->nOrXSize, publicKey }; in GetX25519PublicKey()
/base/useriam/user_auth_framework/test/unittest/inner_api/src/
Dexecutor_callback_proxy_test.cpp48 std::vector<uint8_t> publicKey; variable
56 proxy->OnMessengerReady(messenger, publicKey, templateIdList);
76 std::vector<uint8_t> publicKey; variable
78 proxy->OnMessengerReady(messenger, publicKey, templateIdList);
98 std::vector<uint8_t> publicKey; variable
101 EXPECT_EQ(proxy->OnBeginExecute(scheduleId, publicKey, command), SUCCESS);
/base/useriam/user_auth_framework/interfaces/inner_api/
Dco_auth_client_callback.h28 const std::vector<uint8_t> &publicKey, const std::vector<uint64_t> &templateIds) = 0;
30 virtual int32_t OnBeginExecute(uint64_t scheduleId, const std::vector<uint8_t> &publicKey,
/base/useriam/user_auth_framework/test/unittest/inner_api/mocks/
Dmock_executor_register_callback.h31 const std::vector<uint8_t> &publicKey, const std::vector<uint64_t> &templateIds));
32 MOCK_METHOD3(OnBeginExecute, int32_t(uint64_t scheduleId, const std::vector<uint8_t> &publicKey,
Dmock_executor_callback_service.h29 const std::vector<uint8_t> &publicKey, const std::vector<uint64_t> &templateIdList));
30 MOCK_METHOD3(OnBeginExecute, int32_t(uint64_t scheduleId, const std::vector<uint8_t> &publicKey,
/base/useriam/user_auth_framework/test/unittest/services/src/
Dco_auth_stub_test.cpp54 testInfo.publicKey = {'a', 'b', 'c', 'd'};
71 EXPECT_THAT(info.publicKey, ElementsAreArray(testInfo.publicKey)); in __anon3c6aa29e0102()
82 EXPECT_TRUE(data.WriteUInt8Vector(testInfo.publicKey));
/base/useriam/user_auth_framework/services/core/src/
Dresource_node_impl.cpp48 int32_t BeginExecute(uint64_t scheduleId, const std::vector<uint8_t> &publicKey,
132 return info_.publicKey; in GetExecutorPublicKey()
135 int32_t ResourceNodeImpl::BeginExecute(uint64_t scheduleId, const std::vector<uint8_t> &publicKey, in BeginExecute() argument
140 return callback_->OnBeginExecute(scheduleId, publicKey, command); in BeginExecute()
191 .publicKey = info_.publicKey, in SyncWithDriver()
/base/useriam/user_auth_framework/frameworks/native/ipc/common_defines/
Dexecutor_callback_interface.h37 …nMessengerReady(sptr<ExecutorMessengerInterface> &messenger, const std::vector<uint8_t> &publicKey,
39 virtual int32_t OnBeginExecute(uint64_t scheduleId, const std::vector<uint8_t> &publicKey,
/base/useriam/user_auth_framework/frameworks/native/client/inc/
Dexecutor_callback_service.h30 …nMessengerReady(sptr<ExecutorMessengerInterface> &messenger, const std::vector<uint8_t> &publicKey,
32 int32_t OnBeginExecute(uint64_t scheduleId, const std::vector<uint8_t> &publicKey,
/base/useriam/user_auth_framework/test/unittest/services/mocks/
Dmock_executor_callback.h31 void(sptr<ExecutorMessengerInterface> &messenger, const std::vector<uint8_t> &publicKey,
34 … int32_t(uint64_t scheduleId, const std::vector<uint8_t> &publicKey, const Attributes &command));
/base/useriam/user_auth_framework/common/executors/include/framework/
Dframework_executor_callback.h37 …erReady(const std::shared_ptr<ExecutorMessenger> &messenger, const std::vector<uint8_t> &publicKey,
40 int32_t OnBeginExecute(uint64_t scheduleId, const std::vector<uint8_t> &publicKey,
49 ResultCode OnBeginExecuteInner(uint64_t scheduleId, std::vector<uint8_t> &publicKey,

12345