/base/update/updater/services/package/pkg_verify/ |
D | cert_verify.cpp | 43 int32_t CertVerify::CheckCertChain(STACK_OF(X509) *certStack, X509 *cert) in CheckCertChain() argument 49 return helper_->CertChainCheck(certStack, cert); in CheckCertChain() 59 int32_t SingleCertHelper::CertChainCheck(STACK_OF(X509) *certStack, X509 *cert) in CertChainCheck() argument 62 if (cert == nullptr) { in CertChainCheck() 72 return VerifySingleCert(cert); in CertChainCheck() 92 int32_t SingleCertHelper::VerifySingleCert(X509 *cert) in VerifySingleCert() argument 94 int32_t ret = CompareCertSubjectAndIssuer(cert); in VerifySingleCert() 100 return ((VerifyX509CertByIssuerCert(cert, rootInfo_.rootCert)) ? 0 : -1); in VerifySingleCert() 103 int32_t SingleCertHelper::CompareCertSubjectAndIssuer(X509 *cert) in CompareCertSubjectAndIssuer() argument 105 string certSubject = GetX509CertSubjectName(cert); in CompareCertSubjectAndIssuer() [all …]
|
D | openssl_util.cpp | 102 X509 *cert = PEM_read_bio_X509(pemBio, nullptr, nullptr, nullptr); in GetX509CertFromPemString() local 103 if (cert == nullptr) { in GetX509CertFromPemString() 108 return cert; in GetX509CertFromPemString() 124 X509 *cert = PEM_read_bio_X509(certbio, nullptr, nullptr, nullptr); in GetX509CertFromPemFile() local 125 if (cert == nullptr) { in GetX509CertFromPemFile() 132 return cert; in GetX509CertFromPemFile() 135 bool VerifyX509CertByIssuerCert(X509 *cert, X509 *issuerCert) in VerifyX509CertByIssuerCert() argument 137 if (cert == nullptr || issuerCert == nullptr) { in VerifyX509CertByIssuerCert() 147 return (X509_verify(cert, pubKey) == 1); in VerifyX509CertByIssuerCert() 251 std::string GetX509CertSubjectName(X509 *cert) in GetX509CertSubjectName() argument [all …]
|
D | openssl_util.h | 30 std::string GetX509CertSubjectName(X509 *cert); 31 std::string GetX509CertIssuerName(X509 *cert); 32 bool VerifyX509CertByIssuerCert(X509 *cert, X509 *issuerCert);
|
D | pkcs7_signed_data.cpp | 297 STACK_OF(X509) *certStack = pkcs7_->d.sign->cert; in Pkcs7SignleSignerVerify() 303 …X509 *cert = X509_find_by_issuer_and_serial(certStack, signerInfo.issuerName, signerInfo.serialNum… in Pkcs7SignleSignerVerify() local 304 if (cert == nullptr) { in Pkcs7SignleSignerVerify() 309 if (CertVerify::GetInstance().CheckCertChain(certStack, cert) != 0) { in Pkcs7SignleSignerVerify() 314 return VerifyDigest(cert, signerInfo); in Pkcs7SignleSignerVerify() 317 int32_t Pkcs7SignedData::VerifyDigest(X509 *cert, const Pkcs7SignerInfo &signer) const in VerifyDigest() argument 319 if (cert == nullptr) { in VerifyDigest() 330 EVP_PKEY *pubKey = X509_get_pubkey(cert); in VerifyDigest()
|
/base/security/appverify/interfaces/innerkits/appverify/test/unittest/src/ |
D | trusted_root_ca_test.cpp | 90 X509* cert = nullptr; variable 91 ASSERT_TRUE(rootCertsObj.FindMatchedRoot(cert) == nullptr); 96 cert = HapCertVerifyOpensslUtils::GetX509CertFromPemString(ECC_TEST_CERT); 97 ASSERT_TRUE(cert != nullptr); 98 ASSERT_TRUE(rootCertsObj.FindMatchedRoot(cert) == nullptr); 99 X509_free(cert); 104 cert = HapCertVerifyOpensslUtils::GetX509CertFromPemString(SOFT_CA_CERT); 105 ASSERT_TRUE(cert != nullptr); 106 X509* matchCert = rootCertsObj.FindMatchedRoot(cert); 108 X509_free(cert);
|
/base/security/appverify/interfaces/innerkits/appverify/src/util/ |
D | hap_cert_verify_openssl_utils.cpp | 55 X509* cert = PEM_read_bio_X509(pemBio, nullptr, nullptr, nullptr); in GetX509CertFromPemString() local 57 return cert; in GetX509CertFromPemString() 73 X509* cert = d2i_X509(nullptr, &derBits, len); in GetX509CertFromBase64String() local 74 return cert; in GetX509CertFromBase64String() 79 X509* cert = GetX509CertFromPemString(certStr); in GetPublickeyBase64FromPemCert() local 80 if (cert == nullptr) { in GetPublickeyBase64FromPemCert() 85 if (!GetPublickeyBase64(cert, publicKey)) { in GetPublickeyBase64FromPemCert() 88 X509_free(cert); in GetPublickeyBase64FromPemCert() 91 X509_free(cert); in GetPublickeyBase64FromPemCert() 98 X509* cert = GetX509CertFromPemString(certStr); in GetFingerprintBase64FromPemCert() local [all …]
|
/base/startup/hvb/libhvb/src/cert/ |
D | hvb_cert.c | 96 struct hvb_cert *cert, const char *const *hash_ptn_list, in hash_image_init_desc() argument 102 struct hvb_buf salt_buf = {cert->hash_payload.salt, cert->salt_size}; in hash_image_init_desc() 103 struct hvb_buf digest_buf = {cert->hash_payload.digest, cert->digest_size}; in hash_image_init_desc() 106 enum hvb_image_type image_type = (enum hvb_image_type)cert->verity_type; in hash_image_init_desc() 113 image_buf.size = cert->image_original_len; in hash_image_init_desc() 132 ret = hvb_compare_hash(&digest_buf, &image_buf, &salt_buf, cert->hash_algo); in hash_image_init_desc() 173 static enum hvb_errno _hvb_cert_payload_parser(struct hvb_cert *cert, uint8_t **p, uint8_t *end) in _hvb_cert_payload_parser() argument 176 struct hash_payload *payload = &cert->hash_payload; in _hvb_cert_payload_parser() 178 if (!_decode_octets(&buf, cert->salt_size, p, end)) { in _hvb_cert_payload_parser() 184 if (!_decode_octets(&buf, cert->digest_size, p, end)) { in _hvb_cert_payload_parser() [all …]
|
/base/security/certificate_manager/frameworks/cert_manager_standard/main/common/src/ |
D | cm_pfx.c | 27 static int32_t CmGetAppCertChain(X509 *cert, STACK_OF(X509) *caCert, struct AppCert *appCert) in CmGetAppCertChain() argument 32 if (cert == NULL) { in CmGetAppCertChain() 45 if (PEM_write_bio_X509(out, cert) == 0) { in CmGetAppCertChain() 87 X509 *cert = NULL; in CmParsePkcs12Cert() local 111 if (PKCS12_parse(p12, passWd, pkey, &cert, &caCert) != 1) { in CmParsePkcs12Cert() 117 ret = CmGetAppCertChain(cert, caCert, appCert); in CmParsePkcs12Cert() 133 if (cert != NULL) { in CmParsePkcs12Cert() 134 X509_free(cert); in CmParsePkcs12Cert()
|
/base/update/updater/services/include/package/ |
D | cert_verify.h | 33 virtual int32_t CertChainCheck(STACK_OF(X509) *certStack, X509 *cert) = 0; 42 int32_t CheckCertChain(STACK_OF(X509) *certStack, X509 *cert); 55 int32_t CertChainCheck(STACK_OF(X509) *certStack, X509 *cert) override; 59 int32_t VerifySingleCert(X509 *cert); 60 int32_t CompareCertSubjectAndIssuer(X509 *cert);
|
/base/security/crypto_framework/frameworks/js/napi/certificate/src/ |
D | napi_x509_certificate.cpp | 46 HcfX509Certificate *cert; member 140 HcfX509Certificate *cert = context->certClass->GetX509Cert(); in VerifyExecute() local 141 context->errCode = cert->base.verify(&(cert->base), context->pubKey); in VerifyExecute() 158 HcfX509Certificate *cert = context->certClass->GetX509Cert(); in GetEncodedExecute() local 166 context->errCode = cert->base.getEncoded(&(cert->base), encodingBlob); in GetEncodedExecute() 273 HcfX509Certificate *cert = GetX509Cert(); in GetPublicKey() local 275 HcfResult ret = cert->base.getPublicKey(&(cert->base), &returnPubKey); in GetPublicKey() 315 HcfX509Certificate *cert = GetX509Cert(); in CheckValidityWithDate() local 316 HcfResult ret = cert->checkValidityWithDate(cert, date.c_str()); in CheckValidityWithDate() 326 HcfX509Certificate *cert = GetX509Cert(); in GetVersion() local [all …]
|
/base/security/huks/test/unittest/huks_standard_test/module_test/interface_test/src/ |
D | hks_api_test.cpp | 167 struct HksBlob cert[] = { { sizeof(certData), certData } }; variable 168 …struct HksCertChain certChain = { cert, sizeof(cert) / sizeof(cert[0]) }; /* certChain->certsCount… 186 struct HksBlob cert[] = { { 0, nullptr }, { 0, nullptr }, { 0, nullptr }, { 0, nullptr } }; variable 187 struct HksCertChain certChain = { cert, sizeof(cert) / sizeof(cert[0]) }; 210 struct HksBlob cert[] = { variable 216 struct HksCertChain certChain = { cert, sizeof(cert) / sizeof(cert[0]) }; 237 struct HksBlob cert[] = { variable 243 struct HksCertChain certChain = { cert, sizeof(cert) / sizeof(cert[0]) };
|
/base/security/appverify/interfaces/innerkits/appverify/include/util/ |
D | hap_cert_verify_openssl_utils.h | 38 DLL_EXPORT static bool CertVerify(X509* cert, const X509* issuerCert); 39 DLL_EXPORT static bool GetSubjectFromX509(const X509* cert, std::string& subject); 40 DLL_EXPORT static bool GetIssuerFromX509(const X509* cert, std::string& issuer); 41 DLL_EXPORT static bool GetSerialNumberFromX509(const X509* cert, long long& certNumber); 50 DLL_EXPORT static bool GetPublickeyBase64(const X509* cert, std::string& publicKey); 54 DLL_EXPORT static X509* FindCertOfIssuer(X509* cert, CertSign& certVisitSign); 57 … DLL_EXPORT static X509_CRL* GetCrlBySignedCertIssuer(STACK_OF(X509_CRL)* crls, const X509* cert);
|
D | pkcs7_context.h | 55 for (auto cert : certChain) { in ~Pkcs7Context() local 56 X509_free(cert); in ~Pkcs7Context()
|
/base/startup/init/interfaces/innerkits/fs_manager/libfs_hvb/ |
D | fs_hvb.c | 206 static int FsHvbGetCert(struct hvb_cert *cert, char *devName, struct hvb_verified_data *vd) in FsHvbGetCert() argument 228 hr = hvb_cert_parser(cert, &p->data); in FsHvbGetCert() 366 static int FsHvbConstructVerityTarget(DmVerityTarget *target, char *devName, struct hvb_cert *cert) in FsHvbConstructVerityTarget() argument 374 target->length = cert->image_len / FS_HVB_SECTOR_BYTES; in FsHvbConstructVerityTarget() 397 RETURN_ERR_IF_APPEND_DIGIT_ERR(&p, end, cert->data_block_size); in FsHvbConstructVerityTarget() 399 RETURN_ERR_IF_APPEND_DIGIT_ERR(&p, end, cert->hash_block_size); in FsHvbConstructVerityTarget() 401 RETURN_ERR_IF_APPEND_DIGIT_ERR(&p, end, cert->image_len / cert->data_block_size); in FsHvbConstructVerityTarget() 403 RETURN_ERR_IF_APPEND_DIGIT_ERR(&p, end, cert->hashtree_offset / cert->hash_block_size); in FsHvbConstructVerityTarget() 406 hashALgo = FsHvbGetHashAlgStr(cert->hash_algo); in FsHvbConstructVerityTarget() 408 BEGET_LOGE("error, hash alg %d is invalid", cert->hash_algo); in FsHvbConstructVerityTarget() [all …]
|
/base/update/packaging_tools/ |
D | build_pkcs7.py | 184 cert = load_public_cert() 187 signed_data['certificates'] = [cert] 199 issuer = cert.issuer 200 serial_number = cert.serial_number 202 issuer_and_serial['issuer'] = cert.issuer 203 issuer_and_serial['serial_number'] = cert.serial_number 205 key_id = cert.key_identifier_value.native
|
/base/security/huks/frameworks/huks_standard/main/core/src/ |
D | hks_verifier.c | 150 static X509 *GetX509FormatCert(const struct HksCertInfo *cert) in GetX509FormatCert() argument 154 BIO *bio = BIO_new_mem_buf(cert->data, cert->length); in GetX509FormatCert() 157 if (cert->format == HKS_CERT_DER) { in GetX509FormatCert() 159 } else if (cert->format == HKS_CERT_PEM) { in GetX509FormatCert() 179 static int32_t VerifySignature(const struct HksCertInfo *cert, const struct HksCertInfo *issuerCert) in VerifySignature() argument 184 int32_t resOpenssl = X509_verify(cert->x509, pubKey); in VerifySignature() 392 static int32_t GetKeyDescriptionSeqValue(const struct HksCertInfo *cert, uint8_t **data, uint32_t *… in GetKeyDescriptionSeqValue() argument 398 int32_t idx = X509_get_ext_by_OBJ(cert->x509, obj, -1); in GetKeyDescriptionSeqValue() 404 X509_EXTENSION *ext = X509_get_ext(cert->x509, idx); in GetKeyDescriptionSeqValue() 577 struct HksCertInfo *cert = &(certsInfo[i]); in InitCertChainInfo() local [all …]
|
/base/security/crypto_framework/ |
D | README_zh.md | 38 …限制](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/cert-overview.md) 45 …ttps://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) 50 - [证书-开发指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/cert-guid…
|
/base/security/appverify/interfaces/innerkits/appverify/src/init/ |
D | hap_crl_manager.cpp | 173 bool HapCrlManager::CrlCheck(X509* cert, X509_CRL* targetCrl, Pkcs7Context& pkcs7Context) in CrlCheck() argument 175 if (cert == nullptr) { in CrlCheck() 189 if (X509_CRL_get0_by_cert(targetCrl, &revoked, cert) != 0) { in CrlCheck() 192 HapCertVerifyOpensslUtils::GetSerialNumberFromX509(cert, certNumber); in CrlCheck() 193 HapCertVerifyOpensslUtils::GetSubjectFromX509(cert, certSuject); in CrlCheck()
|
D | trusted_root_ca.cpp | 107 X509* cert = HapCertVerifyOpensslUtils::GetX509CertFromPemString(jsonPair.second); in GetTrustedRootCAFromJson() local 108 if (cert == nullptr) { in GetTrustedRootCAFromJson() 113 rootCertMap[jsonPair.first] = cert; in GetTrustedRootCAFromJson()
|
/base/startup/hvb/libhvb/src/footer/ |
D | hvb_footer.c | 75 static enum hvb_errno _load_cert(struct hvb_ops *ops, struct hvb_buf *cert, const char *ptn, struct… in _load_cert() argument 81 io_ret = ops->read_partition(ops, ptn, offset, cert->size, cert->addr, &read_bytes); in _load_cert() 87 if (cert->size != read_bytes) { in _load_cert()
|
/base/security/certificate_manager/services/cert_manager_standard/cert_manager_engine/main/core/src/ |
D | cert_manager_query.c | 387 X509 *cert = InitCertContext(certData->data, certData->size); in GetSysCertAlias() local 388 if (cert == NULL) { in GetSysCertAlias() 393 …int32_t aliasLen = GetX509SubjectName(cert, CM_ORGANIZATION_NAME, (char *)alias->data, alias->size… in GetSysCertAlias() 395 aliasLen = GetX509SubjectName(cert, CM_COMMON_NAME, (char *)alias->data, alias->size); in GetSysCertAlias() 398 FreeCertContext(cert); in GetSysCertAlias() 404 FreeCertContext(cert); in GetSysCertAlias() 431 X509 *cert = InitCertContext(certData->data, certData->size); in CmGetCertSubjectName() local 432 if (cert == NULL) { in CmGetCertSubjectName() 437 …int32_t subjectLen = GetX509SubjectNameLongFormat(cert, (char *)subjectName->data, MAX_LEN_SUBJECT… in CmGetCertSubjectName() 440 FreeCertContext(cert); in CmGetCertSubjectName() [all …]
|
/base/security/crypto_framework/frameworks/spi/ |
D | x509_crl_spi.h | 33 bool (*engineIsRevoked)(HcfX509CrlSpi *self, const HcfCertificate *cert); 49 HcfResult (*engineGetRevokedCertWithCert)(HcfX509CrlSpi *self, HcfX509Certificate *cert,
|
/base/security/appverify/interfaces/innerkits/appverify_lite/src/ |
D | app_verify.c | 368 static int GetCertTypeBySourceName(const TrustAppCert *cert) in GetCertTypeBySourceName() argument 370 if (cert == NULL) { in GetCertTypeBySourceName() 372 } else if (strcmp(cert->name, "huawei app gallary") == 0) { in GetCertTypeBySourceName() 374 } else if (strcmp(cert->name, "huawei system apps") == 0) { in GetCertTypeBySourceName() 377 } else if (strcmp(cert->name, "OpenHarmony apps") == 0) { in GetCertTypeBySourceName() 655 mbedtls_x509_crt *cert = APPV_MALLOC(sizeof(mbedtls_x509_crt)); in ParseCertGetPk() local 656 P_NULL_RETURN_WTTH_LOG(cert); in ParseCertGetPk() 658 mbedtls_x509_crt_init(cert); in ParseCertGetPk() 659 int ret = mbedtls_x509_crt_parse(cert, (unsigned char *)certEncoded, strlen(certEncoded) + 1); in ParseCertGetPk() 662 APPV_FREE(cert); in ParseCertGetPk() [all …]
|
/base/update/updater/test/unittest/package/ |
D | pkg_verify_unittest.cpp | 131 X509 *cert = PEM_read_bio_X509(certbio, nullptr, nullptr, nullptr); in TestOpensslUtilFailed() local 137 boolResult = VerifyX509CertByIssuerCert(cert, cert); in TestOpensslUtilFailed() 149 stringResult = GetX509CertSubjectName(cert); in TestOpensslUtilFailed() 153 stringResult = GetX509CertIssuerName(cert); in TestOpensslUtilFailed()
|
/base/security/crypto_framework/interfaces/innerkits/certificate/ |
D | crl.h | 30 bool (*isRevoked)(HcfCrl *self, const HcfCertificate *cert);
|