Home
last modified time | relevance | path

Searched refs:privateKey (Results 1 – 25 of 89) sorted by relevance

1234

/ohos5.0/base/security/huks/services/huks_standard/huks_engine/main/core_dependency/src/
H A Dhks_chipset_platform_key_hardcoded.c76 static int32_t MallocFullPlatformPrivateKey(struct HksBlob *privateKey) in MallocFullPlatformPrivateKey() argument
85 privateKey->data = (uint8_t *)HksMalloc(FULL_PLATFORM_PRIVATE_KEY_SIZE); in MallocFullPlatformPrivateKey()
86 HKS_IF_NULL_LOGE_RETURN(privateKey->data, HKS_ERROR_MALLOC_FAIL, "malloc private key failed") in MallocFullPlatformPrivateKey()
87 privateKey->size = FULL_PLATFORM_PRIVATE_KEY_SIZE; in MallocFullPlatformPrivateKey()
89 …int32_t ret = memcpy_s(privateKey->data, privateKey->size, &privateKeyMaterial, sizeof(privateKeyM… in MallocFullPlatformPrivateKey()
91 …ret = memcpy_s(privateKey->data + sizeof(privateKeyMaterial), privateKey->size - sizeof(privateKey… in MallocFullPlatformPrivateKey()
94 … ret = memcpy_s(privateKey->data + sizeof(privateKeyMaterial) + PLATFORM_KEY_PLATFORM_PUB_KEY_SIZE, in MallocFullPlatformPrivateKey()
95 privateKey->size - sizeof(privateKeyMaterial) - PLATFORM_KEY_PLATFORM_PUB_KEY_SIZE, in MallocFullPlatformPrivateKey()
100 …(void)(memset_s(privateKey->data, FULL_PLATFORM_PRIVATE_KEY_SIZE, 0, FULL_PLATFORM_PRIVATE_KEY_SIZ… in MallocFullPlatformPrivateKey()
101 HKS_FREE_BLOB(*privateKey); in MallocFullPlatformPrivateKey()
/ohos5.0/base/security/huks/test/unittest/huks_lite_test/liteos_a_adapter/
H A Dhks_agreement_test.cpp79 …nt32_t AgreeKey(const struct HksTestAgreeParamSet *agreeParamSetParams, struct HksBlob *privateKey, in AgreeKey() argument
93 ret = HksAgreeKeyRun(agreeParamSetTest, privateKey, peerPublicKey, agreedKey, 1); in AgreeKey()
106 struct HksBlob *privateKey = NULL; variable
113 …ret = GenerateLocalX25519Key(&privateKey, NULL, &g_testAgreeParams[0].localPrivateKeyParams, NULL);
127 ret = AgreeKey(&g_testAgreeParams[0].agreeParamSetParams, privateKey, peerPublicKey, agreeKey);
135 ret = HksDeleteKeyForDe(privateKey, NULL);
140 TestFreeBlob(&privateKey);
155 struct HksBlob *privateKey = NULL; variable
184 ret = AgreeKey(&g_testAgreeParams[0].agreeParamSetParams, privateKey, peerPublicKey2, agreeKey);
196 ASSERT_TRUE(HksDeleteKeyForDe(privateKey, NULL) == 0);
[all …]
/ohos5.0/base/security/huks/test/unittest/huks_lite_test/liteos_m_adapter/
H A Dhks_agreement_test.c81 …nt32_t AgreeKey(const struct HksTestAgreeParamSet *agreeParamSetParams, struct HksBlob *privateKey, in AgreeKey() argument
95 ret = HksAgreeKeyRun(agreeParamSet, privateKey, peerPublicKey, agreedKey, 1); in AgreeKey()
108 struct HksBlob *privateKey = NULL; in LITE_TEST_CASE() local
115 …ret = GenerateLocalX25519Key(&privateKey, NULL, &g_testAgreeParams[0].localPrivateKeyParams, NULL); in LITE_TEST_CASE()
129 ret = AgreeKey(&g_testAgreeParams[0].agreeParamSetParams, privateKey, peerPublicKey, agreeKey); in LITE_TEST_CASE()
137 ret = HksDeleteKeyForDe(privateKey, NULL); in LITE_TEST_CASE()
142 TestFreeBlob(&privateKey); in LITE_TEST_CASE()
158 struct HksBlob *privateKey = NULL; in LITE_TEST_CASE() local
182 ret = AgreeKey(&g_testAgreeParams[0].agreeParamSetParams, privateKey, peerPublicKey1, agreeKey); in LITE_TEST_CASE()
200 TEST_ASSERT_TRUE(HksDeleteKeyForDe(privateKey, NULL) == 0); in LITE_TEST_CASE()
[all …]
/ohos5.0/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/sdk_test/src/
H A Dhks_agreement_test.cpp79 …nt32_t AgreeKey(const struct HksTestAgreeParamSet *agreeParamSetParams, struct HksBlob *privateKey, in AgreeKey() argument
93 ret = HksAgreeKeyRun(agreeParamSetTest, privateKey, peerPublicKey, agreedKey, 1); in AgreeKey()
106 struct HksBlob *privateKey = NULL; variable
113 …ret = GenerateLocalX25519Key(&privateKey, NULL, &g_testAgreeParams[0].localPrivateKeyParams, NULL);
127 …ret = AgreeKey(&g_testAgreeParams[0].agreeParamSetParams, privateKey, peerPublicKeyTest, agreeKey);
135 ret = HksDeleteKeyForDe(privateKey, NULL);
140 TestFreeBlob(&privateKey);
/ohos5.0/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/alg_module_test/src/
H A Dhks_rsa_common_mt.cpp62 ASSERT_NE(privateKey.data, nullptr); in GenerateKeyTestCase()
92 HKS_FREE(privateKey.data); in GenerateKeyTestCase()
126 HksBlob privateKey = { .size = priKeyExport->blob.size, in EncryptLocalTestCase() local
128 ASSERT_NE(privateKey.data, nullptr); in EncryptLocalTestCase()
159 HKS_FREE(privateKey.data); in EncryptLocalTestCase()
259 ASSERT_NE(privateKey.data, nullptr); in DecryptLocalTestCase()
287 HKS_FREE(privateKey.data); in DecryptLocalTestCase()
375 ASSERT_NE(privateKey.data, nullptr); in SignLocalTestCase()
413 HKS_FREE(privateKey.data); in SignLocalTestCase()
502 ASSERT_NE(privateKey.data, nullptr); in VerifyLocalTestCase()
[all …]
H A Dhks_dsa_mt.cpp674 HksBlob privateKey = { in GenerateKeyTestCase() local
678 ASSERT_NE(privateKey.data, nullptr); in GenerateKeyTestCase()
679 (void)memcpy_s(privateKey.data, priKeyExport01->blob.size, in GenerateKeyTestCase()
689 EXPECT_EQ(OpensslSignDsa(&plainText, &signData, &privateKey, testCaseParams.keyDigest), in GenerateKeyTestCase()
696 HKS_FREE(privateKey.data); in GenerateKeyTestCase()
738 HksBlob privateKey = { in SignLocalTestCase() local
742 ASSERT_NE(privateKey.data, nullptr); in SignLocalTestCase()
758 HKS_FREE(privateKey.data); in SignLocalTestCase()
862 HksBlob privateKey = { in VerifyLocalTestCase() local
866 ASSERT_NE(privateKey.data, nullptr); in VerifyLocalTestCase()
[all …]
/ohos5.0/base/security/huks/frameworks/crypto_lite/cipher/src/
H A Dcipher_rsa.c47 char *privateKey = malloc(keyFinalLen); in RsaMallocPrivateKey() local
48 if (privateKey == NULL) { in RsaMallocPrivateKey()
52 (void)memset_s(privateKey, keyFinalLen, 0, keyFinalLen); in RsaMallocPrivateKey()
53 ret = memcpy_s(privateKey, keyFinalLen, start, startLen); in RsaMallocPrivateKey()
56 free(privateKey); in RsaMallocPrivateKey()
60 ret = memcpy_s(privateKey + startLen, keyFinalLen - startLen, key, *keyLen); in RsaMallocPrivateKey()
63 free(privateKey); in RsaMallocPrivateKey()
67 ret = memcpy_s(privateKey + startLen + *keyLen, keyFinalLen - startLen - *keyLen, end, endLen); in RsaMallocPrivateKey()
70 (void)memset_s(privateKey, keyFinalLen, 0, keyFinalLen); in RsaMallocPrivateKey()
71 free(privateKey); in RsaMallocPrivateKey()
[all …]
/ohos5.0/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/signature/src/
H A Ddsa_openssl.c64 static bool IsSignInitInputValid(HcfSignSpi *self, HcfPriKey *privateKey) in IsSignInitInputValid() argument
66 if ((self == NULL) || (privateKey == NULL)) { in IsSignInitInputValid()
71 (!HcfIsClassMatch((HcfObjectBase *)privateKey, OPENSSL_DSA_PRIKEY_CLASS))) { in IsSignInitInputValid()
188 static HcfResult EngineDsaSignInit(HcfSignSpi *self, HcfParamsSpec *params, HcfPriKey *privateKey) in EngineDsaSignInit() argument
191 if (!IsSignInitInputValid(self, privateKey)) { in EngineDsaSignInit()
194 EVP_PKEY *pKey = CreateDsaEvpKeyByDsa((HcfKey *)privateKey, true); in EngineDsaSignInit()
211 …sult EngineDsaSignWithoutDigestInit(HcfSignSpi *self, HcfParamsSpec *params, HcfPriKey *privateKey) in EngineDsaSignWithoutDigestInit() argument
214 if (!IsSignInitInputValid(self, privateKey)) { in EngineDsaSignWithoutDigestInit()
217 EVP_PKEY *pKey = CreateDsaEvpKeyByDsa((HcfKey *)privateKey, true); in EngineDsaSignWithoutDigestInit()
H A Ded25519_openssl.c96 static HcfResult EngineSignInit(HcfSignSpi *self, HcfParamsSpec *params, HcfPriKey *privateKey) in EngineSignInit() argument
99 if ((self == NULL) || (privateKey == NULL)) { in EngineSignInit()
104 (!HcfIsClassMatch((HcfObjectBase *)privateKey, OPENSSL_ALG25519_PRIKEY_CLASS))) { in EngineSignInit()
116 ((HcfOpensslAlg25519PriKey *)privateKey)->pkey) != HCF_OPENSSL_SUCCESS) { in EngineSignInit()
H A Dsignature_rsa_openssl.c197 static HcfResult SetOnlySignParams(HcfSignSpiRsaOpensslImpl *impl, HcfPriKey *privateKey) in SetOnlySignParams() argument
199 EVP_PKEY *dupKey = InitRsaEvpKey((HcfKey *)privateKey, true); in SetOnlySignParams()
236 static HcfResult SetSignParams(HcfSignSpiRsaOpensslImpl *impl, HcfPriKey *privateKey) in SetSignParams() argument
239 return SetOnlySignParams(impl, privateKey); in SetSignParams()
241 EVP_PKEY *dupKey = InitRsaEvpKey((HcfKey *)privateKey, true); in SetSignParams()
274 static HcfResult EngineSignInit(HcfSignSpi *self, HcfParamsSpec *params, HcfPriKey *privateKey) in EngineSignInit() argument
277 if (self == NULL || privateKey == NULL) { in EngineSignInit()
290 if (CheckInitKeyType((HcfKey *)privateKey, true) != HCF_SUCCESS) { in EngineSignInit()
295 HcfResult ret = SetSignParams(impl, privateKey); in EngineSignInit()
H A Dsm2_openssl.c169 static bool IsSm2SignInitInputValid(HcfSignSpi *self, HcfPriKey *privateKey) in IsSm2SignInitInputValid() argument
171 if ((self == NULL) || (privateKey == NULL)) { in IsSm2SignInitInputValid()
176 (!HcfIsClassMatch((HcfObjectBase *)privateKey, HCF_OPENSSL_SM2_PRI_KEY_CLASS))) { in IsSm2SignInitInputValid()
188 static HcfResult EngineSignInit(HcfSignSpi *self, HcfParamsSpec *params, HcfPriKey *privateKey) in EngineSignInit() argument
191 if (!IsSm2SignInitInputValid(self, privateKey)) { in EngineSignInit()
195 EC_KEY *ecKey = OpensslEcKeyDup(((HcfOpensslSm2PriKey *)privateKey)->ecKey); in EngineSignInit()
H A Decdsa_openssl.c119 static HcfResult EngineSignInit(HcfSignSpi *self, HcfParamsSpec *params, HcfPriKey *privateKey) in EngineSignInit() argument
122 if ((self == NULL) || (privateKey == NULL)) { in EngineSignInit()
127 (!HcfIsClassMatch((HcfObjectBase *)privateKey, HCF_OPENSSL_ECC_PRI_KEY_CLASS))) { in EngineSignInit()
138 EC_KEY *ecKey = OpensslEcKeyDup(((HcfOpensslEccPriKey *)privateKey)->ecKey); in EngineSignInit()
/ohos5.0/base/security/huks/frameworks/huks_standard/main/os_dependency/ipc/src/
H A Dhks_ipc_check.c150 int32_t HksCheckIpcAgreeKey(const struct HksParamSet *paramSet, const struct HksBlob *privateKey, in HksCheckIpcAgreeKey() argument
153 int32_t ret = HksCheckBlob3AndParamSet(privateKey, peerPublicKey, agreedKey, paramSet); in HksCheckIpcAgreeKey()
156 if ((privateKey->size > MAX_PROCESS_SIZE) || (peerPublicKey->size > MAX_PROCESS_SIZE)) { in HksCheckIpcAgreeKey()
159 …if ((ALIGN_SIZE(paramSet->paramSetSize) + sizeof(privateKey->size) + ALIGN_SIZE(privateKey->size) + in HksCheckIpcAgreeKey()
/ohos5.0/docs/zh-cn/application-dev/security/CryptoArchitectureKit/
H A Dcrypto-rsa-asym-encrypt-decrypt-pkcs1.md49 …async function decryptMessagePromise(privateKey: cryptoFramework.PriKey, cipherText: cryptoFramewo…
51 await decoder.init(cryptoFramework.CryptoMode.DECRYPT_MODE, privateKey, null);
99 …function decryptMessage(privateKey: cryptoFramework.PriKey, cipherText: cryptoFramework.DataBlob) {
101 decoder.initSync(cryptoFramework.CryptoMode.DECRYPT_MODE, privateKey, null);
H A Dcrypto-sm2-asym-encrypt-decrypt.md50 …async function decryptMessagePromise(privateKey: cryptoFramework.PriKey, cipherText: cryptoFramewo…
52 await decoder.init(cryptoFramework.CryptoMode.DECRYPT_MODE, privateKey, null);
101 …function decryptMessage(privateKey: cryptoFramework.PriKey, cipherText: cryptoFramework.DataBlob) {
103 decoder.initSync(cryptoFramework.CryptoMode.DECRYPT_MODE, privateKey, null);
/ohos5.0/base/security/huks/interfaces/inner_api/huks_standard/source/
H A Dhks_api_adapter.c69 int32_t HksAgreeKeyAdapter(const struct HksParamSet *paramSet, const struct HksBlob *privateKey, in HksAgreeKeyAdapter() argument
79 ret = HksClientAgreeKey(paramSet, privateKey, &publicKey, agreedKey); in HksAgreeKeyAdapter()
/ohos5.0/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/key_agreement/src/
H A Decdh_openssl.c61 static EVP_PKEY *NewPKeyByEccPriKey(HcfOpensslEccPriKey *privateKey) in NewPKeyByEccPriKey() argument
63 EC_KEY *ecKey = OpensslEcKeyDup(privateKey->ecKey); in NewPKeyByEccPriKey()
/ohos5.0/base/security/huks/services/huks_standard/huks_service/main/os_dependency/ca/
H A Dhks_ca_access.c83 int32_t HksAccessAgreeKey(const struct HksParamSet *paramSet, const struct HksBlob *privateKey, in HksAccessAgreeKey() argument
86 return HksTeeAgreeKey(paramSet, privateKey, peerPublicKey, agreedKey); in HksAccessAgreeKey()
/ohos5.0/base/security/huks/test/unittest/huks_common_test/src/
H A Dhks_test_common_func.cpp620 int32_t GenerateLocalX25519Key(struct HksBlob **privateKey, struct HksBlob **publicKey, in GenerateLocalX25519Key() argument
624 if ((privateKey != NULL) && (localPrivateKeyParams != NULL)) { in GenerateLocalX25519Key()
625 ret = TestConstuctBlob(privateKey, in GenerateLocalX25519Key()
666 if ((privateKey != NULL) && ((*privateKey) != NULL) && (localPrivateKeyParams != NULL) && in GenerateLocalX25519Key()
669 ret = memcpy_s((*privateKey)->data, (*privateKey)->size, in GenerateLocalX25519Key()
/ohos5.0/foundation/communication/netstack/frameworks/native/tls_socket/src/
H A Dtls_key.cpp263 char privateKey[FILE_READ_KEY_LEN] = {0}; in DecodePem() local
264 if (!fread(privateKey, 1, FILE_READ_KEY_LEN, fp)) { in DecodePem()
270 const char *privateKeyData = static_cast<const char *>(privateKey); in DecodePem()
/ohos5.0/docs/en/application-dev/security/CryptoArchitectureKit/
H A Dcrypto-rsa-asym-encrypt-decrypt-pkcs1.md49 …async function decryptMessagePromise(privateKey: cryptoFramework.PriKey, cipherText: cryptoFramewo…
51 await decoder.init(cryptoFramework.CryptoMode.DECRYPT_MODE, privateKey, null);
99 …function decryptMessage(privateKey: cryptoFramework.PriKey, cipherText: cryptoFramework.DataBlob) {
101 decoder.initSync(cryptoFramework.CryptoMode.DECRYPT_MODE, privateKey, null);
H A Dcrypto-sm2-asym-encrypt-decrypt.md50 …async function decryptMessagePromise(privateKey: cryptoFramework.PriKey, cipherText: cryptoFramewo…
52 await decoder.init(cryptoFramework.CryptoMode.DECRYPT_MODE, privateKey, null);
101 …function decryptMessage(privateKey: cryptoFramework.PriKey, cipherText: cryptoFramework.DataBlob) {
103 decoder.initSync(cryptoFramework.CryptoMode.DECRYPT_MODE, privateKey, null);
/ohos5.0/base/security/huks/frameworks/huks_standard/main/core/src/
H A Dhks_local_engine.c121 int32_t HksLocalAgreeKey(const struct HksParamSet *paramSet, const struct HksBlob *privateKey, in HksLocalAgreeKey() argument
124 HKS_IF_NOT_SUCC_RETURN(HksCheckBlob3AndParamSet(privateKey, peerPublicKey, agreedKey, paramSet), in HksLocalAgreeKey()
127 int32_t ret = HksCoreCheckAgreeKeyParams(paramSet, privateKey, peerPublicKey, agreedKey, true); in HksLocalAgreeKey()
134 ret = HksSetKeyToMaterial(spec.algType, false, privateKey, &privateKeyMaterial); in HksLocalAgreeKey()
/ohos5.0/foundation/communication/wifi/wifi/test/fuzztest/wifi_sta/wifidevicestub_fuzzer/
H A Dwifidevicestub_fuzzer.cpp791 config.wifiEapConfig.privateKey = std::string(reinterpret_cast<const char*>(data), size); in WifiDeviceServiceImplTest()
819 config.wifiEapConfig.privateKey = std::string(reinterpret_cast<const char*>(data), size); in CheckConfigEapTest()
843 config.wifiEapConfig.privateKey = std::string(reinterpret_cast<const char*>(data), size); in CheckConfigWapiTest()
865 config.wifiEapConfig.privateKey = std::string(reinterpret_cast<const char*>(data), size); in CheckConfigPwdTest()
881 config.wifiEapConfig.privateKey = std::string(reinterpret_cast<const char*>(data), size); in InitWifiBrokerProcessInfoTest()
904 config.wifiEapConfig.privateKey = std::string(reinterpret_cast<const char*>(data), size); in RemoveCandidateConfigFuzzTest()
930 config.wifiEapConfig.privateKey = std::string(reinterpret_cast<const char*>(data), size); in AddDeviceConfigTest()
955 config.wifiEapConfig.privateKey = std::string(reinterpret_cast<const char*>(data), size); in ConnectToDeviceTest()
1005 config.wifiEapConfig.privateKey = std::string(reinterpret_cast<const char*>(data), size); in HilinkGetMacAddressTest()
1022 config.wifiEapConfig.privateKey = std::string(reinterpret_cast<const char*>(data), size); in EnableHiLinkHandshakeTest()
/ohos5.0/base/security/huks/test/unittest/huks_standard_test/module_test/mock/idl/src/
H A Dhuks_access_mock.c139 …FI(int32_t HuksAccessAgreeKey(const struct HksParamSet *paramSet, const struct HksBlob *privateKey, in ENABLE_CFI() argument
142 return HksCoreAgreeKey(paramSet, privateKey, peerPublicKey, agreedKey); in ENABLE_CFI()

1234