Home
last modified time | relevance | path

Searched refs:certChain (Results 1 – 25 of 64) sorted by relevance

123

/base/security/code_signature/utils/src/
Dcert_utils.cpp29 bool ConstructDataToCertChain(struct HksCertChain **certChain) in ConstructDataToCertChain() argument
31 *certChain = static_cast<struct HksCertChain *>(malloc(sizeof(struct HksCertChain))); in ConstructDataToCertChain()
32 if (*certChain == nullptr) { in ConstructDataToCertChain()
36 (*certChain)->certsCount = CERT_COUNT; in ConstructDataToCertChain()
38 (*certChain)->certs = static_cast<struct HksBlob *>(malloc(sizeof(struct HksBlob) * in ConstructDataToCertChain()
39 ((*certChain)->certsCount))); in ConstructDataToCertChain()
40 if ((*certChain)->certs == nullptr) { in ConstructDataToCertChain()
41 free(*certChain); in ConstructDataToCertChain()
42 *certChain = nullptr; in ConstructDataToCertChain()
45 for (uint32_t i = 0; i < (*certChain)->certsCount; i++) { in ConstructDataToCertChain()
[all …]
Dpkcs7_data.cpp44 bool PKCS7Data::InitPKCS7Data(const std::vector<ByteBuffer> &certChain) in InitPKCS7Data() argument
48 if (certChain.empty()) { in InitPKCS7Data()
51 certs = MakeStackOfCerts(certChain); in InitPKCS7Data()
Dopenssl_utils.cpp57 STACK_OF(X509) *MakeStackOfCerts(const std::vector<ByteBuffer> &certChain) in STACK_OF()
63 for (const ByteBuffer &cert: certChain) { in STACK_OF()
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/
Dhks_attest_key_test_common.cpp35 void FreeCertChain(struct HksCertChain **certChain, const uint32_t pos) in FreeCertChain() argument
37 if (certChain == nullptr || *certChain == nullptr) { in FreeCertChain()
41 if ((*certChain)->certs == nullptr) { in FreeCertChain()
42 HksFree(*certChain); in FreeCertChain()
43 *certChain = nullptr; in FreeCertChain()
47 if ((*certChain)->certs[j].data != nullptr) { in FreeCertChain()
48 HksFree((*certChain)->certs[j].data); in FreeCertChain()
49 (*certChain)->certs[j].data = nullptr; in FreeCertChain()
53 if ((*certChain)->certs != nullptr) { in FreeCertChain()
54 HksFree((*certChain)->certs); in FreeCertChain()
[all …]
Dhks_attest_key_ids_test.cpp121 HksCertChain *certChain = NULL; variable
123 ret = ConstructDataToCertChain(&certChain, &certParam);
125 ret = HksAttestKey(&g_keyAlias, paramSet, certChain);
128 ret = ValidateCertChainTest(certChain, g_idsParams, IDS_PARAM);
130 FreeCertChain(&certChain, certChain->certsCount);
131 certChain = NULL;
156 HksCertChain *certChain = NULL; variable
159 ret = ConstructDataToCertChain(&certChain, &certParam);
161 ret = HksAttestKey(&g_keyAlias, paramSet, certChain);
166 ret = ValidateCertChainTest(certChain, g_idsParams, IDS_PARAM);
[all …]
Dhks_attest_key_nonids_test.cpp90 HksCertChain *certChain = nullptr; variable
92 (void)ConstructDataToCertChain(&certChain, &certParam);
93 ret = HksAttestKey(&g_keyAlias, paramSet, certChain);
126 ret = ValidateCertChainTest(certChain, g_commonParams, NON_IDS_PARAM);
129 FreeCertChain(&certChain, certChain->certsCount);
130 certChain = nullptr;
150 HksCertChain *certChain = NULL; variable
153 (void)ConstructDataToCertChain(&certChain, &certParam);
154 ret = HksAttestKey(&g_keyAlias, paramSet, certChain);
158 FreeCertChain(&certChain, certChain->certsCount);
[all …]
/base/security/device_security_level/oem_property/ohos/common/
Dhks_adapter.c95 int32_t ConstructHksCertChain(struct HksCertChain **certChain, const struct HksCertChainInitParams … in ConstructHksCertChain() argument
102 *certChain = (struct HksCertChain *)MALLOC(sizeof(struct HksCertChain)); in ConstructHksCertChain()
103 if (*certChain == NULL) { in ConstructHksCertChain()
106 (*certChain)->certsCount = CERT_CHAIN_CERT_NUM; in ConstructHksCertChain()
107 …(*certChain)->certs = (struct HksBlob *)MALLOC(sizeof(struct HksBlob) * ((*certChain)->certsCount)… in ConstructHksCertChain()
108 if ((*certChain)->certs == NULL) { in ConstructHksCertChain()
109 FREE(*certChain); in ConstructHksCertChain()
110 *certChain = NULL; in ConstructHksCertChain()
113 for (uint32_t i = 0; i < (*certChain)->certsCount; i++) { in ConstructHksCertChain()
114 (*certChain)->certs[i].size = 0; in ConstructHksCertChain()
[all …]
Ddslm_ohos_request.c62 uint8_t **certChain, uint32_t *certChainLen) in GenerateDslmCertChain() argument
87 ret = DslmCredAttestAdapter(&saveInfo, certChain, certChainLen); in GenerateDslmCertChain()
130 uint8_t *certChain = NULL; in RequestStandardDslmCred() local
132 int32_t ret = GenerateDslmCertChain(device, obj, credStr, &certChain, &certChainLen); in RequestStandardDslmCred()
137 DslmCredBuff *out = CreateDslmCred(CRED_TYPE_STANDARD, certChainLen, certChain); in RequestStandardDslmCred()
139 FREE(certChain); in RequestStandardDslmCred()
143 FREE(certChain); in RequestStandardDslmCred()
Dhks_adapter.h39 int32_t ConstructHksCertChain(struct HksCertChain **certChain, const struct HksCertChainInitParams …
40 void DestroyHksCertChain(struct HksCertChain *certChain);
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/sdk_test/src/
Dhks_device_sec_test.cpp83 static void FreeCertChain(struct HksCertChain **certChain, const uint32_t pos) in FreeCertChain() argument
85 if (certChain == NULL || *certChain == NULL) { in FreeCertChain()
89 if ((*certChain)->certs == NULL) { in FreeCertChain()
90 HksTestFree(*certChain); in FreeCertChain()
91 *certChain = NULL; in FreeCertChain()
96 if ((*certChain)->certs[j].data != NULL) { in FreeCertChain()
97 HksTestFree((*certChain)->certs[j].data); in FreeCertChain()
98 (*certChain)->certs[j].data = NULL; in FreeCertChain()
102 if ((*certChain)->certs != NULL) { in FreeCertChain()
103 HksTestFree((*certChain)->certs); in FreeCertChain()
[all …]
/base/security/huks/interfaces/kits/napi/src/v9/
Dhuks_napi_attest_key_item.cpp46 struct HksCertChain *certChain = nullptr; member
65 FreeHksCertChain(context->certChain); in DeleteAttestKeyAsyncContext()
110 static void InitCertChain(struct HksCertChain *certChain) in InitCertChain() argument
112 certChain->certsCount = HKS_CERT_COUNT; in InitCertChain()
113certChain->certs = static_cast<struct HksBlob *>(HksMalloc(certChain->certsCount * sizeof(struct H… in InitCertChain()
114 if (certChain->certs != nullptr) { in InitCertChain()
115 certChain->certs[INDEX_0].size = HKS_CERT_APP_SIZE; in InitCertChain()
116certChain->certs[INDEX_0].data = static_cast<uint8_t *>(HksMalloc(certChain->certs[INDEX_0].size)); in InitCertChain()
117 certChain->certs[INDEX_1].size = HKS_CERT_DEVICE_SIZE; in InitCertChain()
118certChain->certs[INDEX_1].data = static_cast<uint8_t *>(HksMalloc(certChain->certs[INDEX_1].size)); in InitCertChain()
[all …]
Dhuks_napi_common_item.cpp447 void FreeHksCertChain(HksCertChain *&certChain) in FreeHksCertChain() argument
449 if (certChain == nullptr) { in FreeHksCertChain()
453 if (certChain->certsCount > 0 && certChain->certs != nullptr) { in FreeHksCertChain()
454 for (uint32_t i = 0; i < certChain->certsCount; i++) { in FreeHksCertChain()
455 if (certChain->certs[i].data != nullptr) { in FreeHksCertChain()
456 HksFree(certChain->certs[i].data); in FreeHksCertChain()
457 certChain->certs[i].data = nullptr; in FreeHksCertChain()
462 HksFree(certChain); in FreeHksCertChain()
463 certChain = nullptr; in FreeHksCertChain()
697 … const struct HksBlob *outData, const HksParamSet *paramSet, const struct HksCertChain *certChain) in AddOutDataParamSetOrCertChain() argument
[all …]
/base/security/huks/test/fuzz_test/innerapi_fuzzer/hksgetcertificatechain_fuzzer/
Dhksgetcertificatechain_fuzzer.cpp45 struct HksCertChain *certChain = in DoSomethingInterestingWithMyAPI() local
47 certChain->certsCount = CERT_COUNT; in DoSomethingInterestingWithMyAPI()
48 certChain->certs = reinterpret_cast<struct HksBlob *>(myData + BLOB_SIZE); in DoSomethingInterestingWithMyAPI()
54 (void)HksGetCertificateChain(&keyAlias, paramSet, certChain); in DoSomethingInterestingWithMyAPI()
56 if (certChain != nullptr) { in DoSomethingInterestingWithMyAPI()
57 HksFree(certChain); in DoSomethingInterestingWithMyAPI()
/base/security/huks/test/fuzz_test/innerapi_fuzzer/hksattestkey_fuzzer/
Dhksattestkey_fuzzer.cpp44 struct HksCertChain *certChain = in DoSomethingInterestingWithMyAPI() local
46 certChain->certsCount = CERT_COUNT; in DoSomethingInterestingWithMyAPI()
47 certChain->certs = reinterpret_cast<struct HksBlob *>(myData + BLOB_SIZE); in DoSomethingInterestingWithMyAPI()
53 (void)HksAttestKey(&keyAlias, paramSet, certChain); in DoSomethingInterestingWithMyAPI()
55 if (certChain != nullptr) { in DoSomethingInterestingWithMyAPI()
56 HksFree(certChain); in DoSomethingInterestingWithMyAPI()
/base/security/huks/frameworks/huks_standard/main/os_dependency/ipc/src/
Dhks_ipc_check.c173 const struct HksCertChain *certChain) in HksCheckIpcCertificateChain() argument
175 if ((certChain->certs == NULL) || (certChain->certsCount < MIN_CERT_COUNT) || in HksCheckIpcCertificateChain()
176 (certChain->certsCount > MAX_CERT_COUNT)) { in HksCheckIpcCertificateChain()
186 uint32_t certBufSize = sizeof(certChain->certsCount); in HksCheckIpcCertificateChain()
187 for (uint32_t i = 0; i < certChain->certsCount; ++i) { in HksCheckIpcCertificateChain()
188 if (IsAdditionOverflow(certBufSize, sizeof(certChain->certs[i].size))) { in HksCheckIpcCertificateChain()
191 certBufSize += sizeof(certChain->certs[i].size); in HksCheckIpcCertificateChain()
193 if (IsAdditionOverflow(certChain->certs[i].size, DEFAULT_ALIGN_MASK_SIZE)) { in HksCheckIpcCertificateChain()
196 if (IsAdditionOverflow(certBufSize, ALIGN_SIZE(certChain->certs[i].size))) { in HksCheckIpcCertificateChain()
199 certBufSize += ALIGN_SIZE(certChain->certs[i].size); in HksCheckIpcCertificateChain()
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/include/
Dhks_attest_key_test_common.h54 void FreeCertChain(struct HksCertChain **certChain, const uint32_t pos);
58 int32_t ConstructDataToCertChain(struct HksCertChain **certChain,
63 int32_t ValidateCertChainTest(const struct HksCertChain *certChain, const struct HksParam tmpParam[…
/base/security/code_signature/utils/include/
Dcert_utils.h26 bool ConstructDataToCertChain(struct HksCertChain **certChain);
27 void FreeCertChain(struct HksCertChain **certChain, const uint32_t pos);
/base/security/code_signature/services/local_code_sign/src/
Dlocal_sign_key.cpp97 const HksCertChain *certChain = GetCertChain(); in GetSignCert() local
98 if (certChain == nullptr) { in GetSignCert()
107 if (!cert_->CopyFrom(certChain->certs[0].data, certChain->certs[0].size)) { in GetSignCert()
134 HksCertChain *certChain = nullptr; in QueryCertChain() local
136 if (!ConstructDataToCertChain(&certChain)) { in QueryCertChain()
141 int32_t ret = HksAttestKey(&LOCAL_SIGN_KEY_ALIAS, paramSet.GetParamSet(), certChain); in QueryCertChain()
146 return certChain; in QueryCertChain()
/base/security/huks/test/unittest/huks_standard_test/module_test/interface_test/src/
Dhks_api_test.cpp136 struct HksCertChain certChain = { nullptr, 0 }; variable
137 int32_t ret = HksValidateCertChain(&certChain, nullptr);
152 struct HksCertChain certChain = { nullptr, DEFAULT_CERT_COUNT }; variable
153 int32_t ret = HksValidateCertChain(&certChain, paramSetOut);
171 …struct HksCertChain certChain = { cert, sizeof(cert) / sizeof(cert[0]) }; /* certChain->certsCount… variable
173 int32_t ret = HksValidateCertChain(&certChain, paramSetOut);
190 struct HksCertChain certChain = { cert, sizeof(cert) / sizeof(cert[0]) }; variable
192 int32_t ret = HksValidateCertChain(&certChain, paramSetOut);
219 struct HksCertChain certChain = { cert, sizeof(cert) / sizeof(cert[0]) }; variable
220 int32_t ret = HksValidateCertChain(&certChain, paramSetOut);
[all …]
/base/security/huks/test/unittest/huks_standard_test/module_test/service_test/huks_service/core/src/
Dhks_client_service_test.cpp190 static void FreeCertChainBlob(struct HksBlob *certChain) in FreeCertChainBlob() argument
192 HKS_FREE_PTR(certChain->data); in FreeCertChainBlob()
193 certChain->size = 0; in FreeCertChainBlob()
194 HKS_FREE_PTR(certChain); in FreeCertChainBlob()
199 … struct HksBlob *certChain = (struct HksBlob *)HksMalloc(sizeof(struct HksBlob) * HKS_CERT_COUNT); in ConstructCertChainBlob() local
200 if (certChain == nullptr) { in ConstructCertChainBlob()
203 certChain->data = (uint8_t *)HksMalloc(g_defaultCertSize); in ConstructCertChainBlob()
204 if (certChain->data == nullptr) { in ConstructCertChainBlob()
205 FreeCertChainBlob(certChain); in ConstructCertChainBlob()
208 certChain->size = g_defaultCertSize; in ConstructCertChainBlob()
[all …]
/base/security/huks/frameworks/huks_standard/main/core/src/
Dhks_verifier.c574 static int32_t InitCertChainInfo(const struct HksCertChain *certChain, struct HksCertInfo **certs) in InitCertChainInfo() argument
578 uint32_t certsInfoLen = sizeof(struct HksCertInfo) * certChain->certsCount; /* only 4 cert */ in InitCertChainInfo()
584 for (uint32_t i = 0; i < certChain->certsCount; ++i) { in InitCertChainInfo()
586 cert->data = certChain->certs[i].data; in InitCertChainInfo()
587 cert->length = certChain->certs[i].size; in InitCertChainInfo()
620 static int32_t CheckCertChainParams(const struct HksCertChain *certChain) in CheckCertChainParams() argument
623 if ((certChain->certs == NULL) || (certChain->certsCount != HKS_DEFAULT_CERT_CHAIN_CNT)) { in CheckCertChainParams()
628 for (uint32_t i = 0; i < certChain->certsCount; ++i) { in CheckCertChainParams()
629 if (CheckBlob(&certChain->certs[i]) != HKS_SUCCESS) { in CheckCertChainParams()
637 static int32_t CheckValidateCertChainParams(const struct HksCertChain *certChain, struct HksParamSe… in CheckValidateCertChainParams() argument
[all …]
/base/security/huks/services/huks_standard/huks_service/main/os_dependency/ca/
Dhks_ca_access.c106 int32_t HksAccessExportTrustCerts(struct HksBlob *certChain) in HksAccessExportTrustCerts() argument
108 return HksTeeExportTrustCerts(certChain); in HksAccessExportTrustCerts()
111 int32_t HksAccessImportTrustCerts(const struct HksBlob *certChain) in HksAccessImportTrustCerts() argument
113 return HksTeeImportTrustCerts(certChain); in HksAccessImportTrustCerts()
Dhks_teec.h65 …ttestKey(const struct HksBlob *key, const struct HksParamSet *paramSet, struct HksBlob *certChain);
70 int32_t HksTeeExportTrustCerts(struct HksBlob *certChain);
72 int32_t HksTeeImportTrustCerts(const struct HksBlob *certChain);
/base/security/appverify/interfaces/innerkits/appverify/include/util/
Dpkcs7_context.h54 for (auto certChain : certChains) { in ~Pkcs7Context() local
55 for (auto cert : certChain) { in ~Pkcs7Context()
/base/security/huks/interfaces/kits/c/src/
Dnative_huks_api_adapter.c23 struct OH_Huks_CertChain *certChain) in HuksAttestAdapter() argument
58 (struct HksCertChain *)certChain); in HuksAttestAdapter()

123