Lines Matching refs:certChain
47 void FreeCertChain(struct OH_Huks_CertChain *certChain, const uint32_t pos)
49 if (certChain == nullptr || certChain->certs == nullptr) {
53 if (certChain->certs[j].data != nullptr) {
54 free(certChain->certs[j].data);
55 certChain->certs[j].data = nullptr;
58 if (certChain->certs != nullptr) {
59 free(certChain->certs);
60 certChain->certs = nullptr;
63 int32_t ConstructDataToCertChain(struct OH_Huks_CertChain *certChain)
65 if (certChain == nullptr) {
68 certChain->certsCount = CERT_COUNT;
70 …certChain->certs = (struct OH_Huks_Blob *)malloc(sizeof(struct OH_Huks_Blob) * (certChain->certsCo…
71 if (certChain->certs == nullptr) {
74 for (uint32_t i = 0; i < certChain->certsCount; i++) {
75 certChain->certs[i].size = g_size;
76 certChain->certs[i].data = (uint8_t *)malloc(certChain->certs[i].size);
77 if (certChain->certs[i].data == nullptr) {
78 FreeCertChain(certChain, i);
109 OH_Huks_CertChain certChain = { &certs, 0 };
125 (void)ConstructDataToCertChain(&certChain);
127 ohResult = OH_Huks_AttestKeyItem(&genAlias, attestParamSet, &certChain);
129 FreeCertChain(&certChain, CERT_COUNT);