/base/security/dlp_permission_service/services/dlp_permission/sa/test/unittest/src/ |
D | dlp_credential_test.cpp | 80 std::vector<uint8_t> cert; variable 81 proxy->OnGenerateDlpCertificate(0, cert); 82 EXPECT_EQ(true, (cert.size() == 0)); 83 proxy->OnGenerateDlpCertificate(-1, cert); 84 EXPECT_EQ(true, (cert.size() == 0)); 87 proxy->OnParseDlpCertificate(0, policy, cert); 88 EXPECT_EQ(true, (cert.size() == 0)); 89 proxy->OnParseDlpCertificate(-1, policy, cert); 90 EXPECT_EQ(true, (cert.size() == 0)); 99 void OnGenerateDlpCertificate(int32_t result, const std::vector<uint8_t>& cert) override {}; in OnGenerateDlpCertificate() argument [all …]
|
/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/update/updater/services/package/pkg_verify/ |
D | cert_verify.cpp | 52 int32_t CertVerify::CheckCertChain(STACK_OF(X509) *certStack, X509 *cert) in CheckCertChain() argument 58 return helper_->CertChainCheck(certStack, cert); in CheckCertChain() 78 int32_t SingleCertHelper::CertChainCheck(STACK_OF(X509) * certStack, X509 *cert) in CertChainCheck() argument 81 if (cert == nullptr) { in CertChainCheck() 85 return VerifySingleCert(cert); in CertChainCheck() 109 int32_t SingleCertHelper::VerifySingleCert(X509 *cert) in VerifySingleCert() argument 111 int32_t ret = CompareCertSubjectAndIssuer(cert); in VerifySingleCert() 117 return ((VerifyX509CertByIssuerCert(cert, rootInfo_.rootCert)) ? 0 : -1); in VerifySingleCert() 120 int32_t SingleCertHelper::CompareCertSubjectAndIssuer(X509 *cert) in CompareCertSubjectAndIssuer() argument 122 string certSubject = GetX509CertSubjectName(cert); in CompareCertSubjectAndIssuer() [all …]
|
D | openssl_util.cpp | 103 X509 *cert = PEM_read_bio_X509(pemBio, nullptr, nullptr, nullptr); in GetX509CertFromPemString() local 104 if (cert == nullptr) { in GetX509CertFromPemString() 109 return cert; in GetX509CertFromPemString() 125 X509 *cert = PEM_read_bio_X509(certbio, nullptr, nullptr, nullptr); in GetX509CertFromPemFile() local 126 if (cert == nullptr) { in GetX509CertFromPemFile() 133 return cert; in GetX509CertFromPemFile() 136 bool VerifyX509CertByIssuerCert(X509 *cert, X509 *issuerCert) in VerifyX509CertByIssuerCert() argument 138 if (cert == nullptr || issuerCert == nullptr) { in VerifyX509CertByIssuerCert() 148 bool ret = (X509_verify(cert, pubKey) == 1); in VerifyX509CertByIssuerCert() 265 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);
|
/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/security/code_signature/services/key_enable/utils/src/ |
D | local_code_sign_utils.cpp | 27 ByteBuffer cert; in InitLocalCertificate() local 28 int32_t ret = LocalCodeSignKit::InitLocalCertificate(cert); in InitLocalCertificate() 32 if (memcpy_s(certData, *certSize, cert.GetBuffer(), cert.GetSize()) != EOK) { in InitLocalCertificate() 35 *certSize = cert.GetSize(); in InitLocalCertificate()
|
/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/code_signature/services/key_enable/src/ |
D | cert_chain_utils.rs | 50 fn dump_cert_in_der(cert: X509) -> Option<Vec<u8>> in dump_cert_in_der() 52 match cert.to_der() { in dump_cert_in_der() 64 for cert in certs { in convert_to_stack() 65 stack_of_certs.push(cert).unwrap(); in convert_to_stack() 73 for cert in certs { in convert_to_store() 74 store_builder.add_cert(cert).unwrap(); in convert_to_store() 80 fn verify_certs(cert: &X509, inter_ca:Vec<X509>, root_ca: Vec<X509>) -> Result<X509VerifyResult, Er… in verify_certs() 85 ctx.init(&store, cert, &cert_chain, |c| { in verify_certs() 109 let cert = certs.pop().unwrap(); in get_verifed_cert_from_chain() localVariable 116 match verify_certs(&cert, inter_ca, root_ca) { in get_verifed_cert_from_chain() [all …]
|
/base/security/dlp_permission_service/interfaces/inner_api/dlp_permission/src/ |
D | dlp_permission_async_stub.cpp | 64 std::vector<uint8_t> cert; in OnGenerateDlpCertificateStub() local 76 if (!data.ReadUInt8Vector(&cert)) { in OnGenerateDlpCertificateStub() 81 this->OnGenerateDlpCertificate(result, cert); in OnGenerateDlpCertificateStub() 85 … DlpPermissionAsyncStub::OnGenerateDlpCertificate(int32_t result, const std::vector<uint8_t>& cert) in OnGenerateDlpCertificate() argument 92 generateDlpCertificateCallback_->OnGenerateDlpCertificate(result, cert); in OnGenerateDlpCertificate() 116 std::vector<uint8_t> cert; in OnParseDlpCertificateStub() local 117 if (!data.ReadUInt8Vector(&cert)) { in OnParseDlpCertificateStub() 122 this->OnParseDlpCertificate(result, policyParcel->policyParams_, cert); in OnParseDlpCertificateStub() 127 const std::vector<uint8_t>& cert) in OnParseDlpCertificate() argument 134 parseDlpCertificateCallback_->OnParseDlpCertificate(result, policy, cert); in OnParseDlpCertificate()
|
D | dlp_permission_kit.cpp | 33 …eDlpCertificateCallback::OnGenerateDlpCertificate(int32_t result, const std::vector<uint8_t>& cert) in OnGenerateDlpCertificate() argument 38 this->cert_ = cert; in OnGenerateDlpCertificate() 46 const std::vector<uint8_t>& cert) in OnParseDlpCertificate() argument 52 this->offlineCert_ = cert; in OnParseDlpCertificate() 59 …lpPermissionKit::GenerateDlpCertificate(const PermissionPolicy& policy, std::vector<uint8_t>& cert) in GenerateDlpCertificate() argument 83 cert = callback->cert_; in GenerateDlpCertificate() 93 std::vector<uint8_t> cert; in ParseDlpCertificate() local 98 cert = offlineCert; in ParseDlpCertificate() 101 cert = onlineCert; in ParseDlpCertificate() 106 int32_t res = DlpPermissionClient::GetInstance().ParseDlpCertificate(cert, in ParseDlpCertificate() [all …]
|
/base/security/code_signature/utils/src/ |
D | openssl_utils.cpp | 49 X509 *cert = d2i_X509_bio(mem, nullptr); in LoadCertFromBuffer() local 50 if (cert == nullptr) { in LoadCertFromBuffer() 54 return cert; in LoadCertFromBuffer() 63 for (const ByteBuffer &cert: certChain) { in STACK_OF() local 64 X509 *tmp = LoadCertFromBuffer(cert.GetBuffer(), cert.GetSize()); in STACK_OF()
|
D | pkcs7_generator.cpp | 36 X509 *cert = nullptr; in GenerateSignature() local 43 cert = LoadCertFromBuffer(certBuffer->GetBuffer(), certBuffer->GetSize()); in GenerateSignature() 44 if (cert == nullptr) { in GenerateSignature() 52 PKCS7Data pkcs7(md, cert); in GenerateSignature() 57 if (!signerInfo.InitSignerInfo(cert, md, contentData)) { in GenerateSignature() 73 X509_free(cert); in GenerateSignature()
|
D | signer_info.cpp | 29 bool SignerInfo::InitSignerInfo(X509 *cert, const EVP_MD *md, in InitSignerInfo() argument 32 if ((cert == nullptr) || (md == nullptr)) { in InitSignerInfo() 51 X509_get_issuer_name(cert))) { in InitSignerInfo() 56 ASN1_INTEGER_dup(X509_get_serialNumber(cert)))) { in InitSignerInfo() 65 int signatureNid = GetSignAlgorithmID(cert); in InitSignerInfo() 185 int SignerInfo::GetSignAlgorithmID(const X509 *cert) in GetSignAlgorithmID() argument 187 X509_PUBKEY *xpkey = X509_get_X509_PUBKEY(cert); in GetSignAlgorithmID()
|
/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; 44 int32_t CheckCertChain(STACK_OF(X509) *certStack, X509 *cert); 58 int32_t CertChainCheck(STACK_OF(X509) *certStack, X509 *cert) override; 62 int32_t VerifySingleCert(X509 *cert); 63 int32_t CompareCertSubjectAndIssuer(X509 *cert);
|
/base/security/certificate_framework/frameworks/js/napi/certificate/src/ |
D | napi_x509_certificate.cpp | 49 HcfX509Certificate *cert = nullptr; member 148 HcfX509Certificate *cert = context->certClass->GetX509Cert(); in VerifyExecute() local 149 context->errCode = cert->base.verify(&(cert->base), context->pubKey); in VerifyExecute() 166 HcfX509Certificate *cert = context->certClass->GetX509Cert(); in GetEncodedExecute() local 174 context->errCode = cert->base.getEncoded(&(cert->base), encodingBlob); in GetEncodedExecute() 281 HcfX509Certificate *cert = GetX509Cert(); in GetPublicKey() local 283 CfResult ret = cert->base.getPublicKey(&(cert->base), &returnPubKey); in GetPublicKey() 324 HcfX509Certificate *cert = GetX509Cert(); in CheckValidityWithDate() local 325 CfResult ret = cert->checkValidityWithDate(cert, date.c_str()); in CheckValidityWithDate() 335 HcfX509Certificate *cert = GetX509Cert(); in GetVersion() local [all …]
|
/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 int FsHvbConstructVerityTarget(DmVerityTarget *target, const char *devName, struct hvb_cert *cert) in FsHvbConstructVerityTarget() argument 374 target->length = cert->image_len / FS_HVB_SECTOR_BYTES; in FsHvbConstructVerityTarget() 398 RETURN_ERR_IF_APPEND_DIGIT_ERR(&p, end, cert->data_block_size); in FsHvbConstructVerityTarget() 400 RETURN_ERR_IF_APPEND_DIGIT_ERR(&p, end, cert->hash_block_size); in FsHvbConstructVerityTarget() 402 RETURN_ERR_IF_APPEND_DIGIT_ERR(&p, end, cert->image_len / cert->data_block_size); in FsHvbConstructVerityTarget() 404 RETURN_ERR_IF_APPEND_DIGIT_ERR(&p, end, cert->hashtree_offset / cert->hash_block_size); in FsHvbConstructVerityTarget() 407 hashALgo = FsHvbGetHashAlgStr(cert->hash_algo); in FsHvbConstructVerityTarget() 409 BEGET_LOGE("error, hash alg %d is invalid", cert->hash_algo); in FsHvbConstructVerityTarget() [all …]
|
/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);
|
/base/security/huks/test/unittest/huks_standard_test/module_test/interface_test/src/ |
D | hks_api_test.cpp | 170 struct HksBlob cert[] = { { sizeof(certData), certData } }; variable 171 …struct HksCertChain certChain = { cert, sizeof(cert) / sizeof(cert[0]) }; /* certChain->certsCount… 189 struct HksBlob cert[] = { { 0, nullptr }, { 0, nullptr }, { 0, nullptr }, { 0, nullptr } }; variable 190 struct HksCertChain certChain = { cert, sizeof(cert) / sizeof(cert[0]) }; 213 struct HksBlob cert[] = { variable 219 struct HksCertChain certChain = { cert, sizeof(cert) / sizeof(cert[0]) }; 240 struct HksBlob cert[] = { variable 246 struct HksCertChain certChain = { cert, sizeof(cert) / sizeof(cert[0]) };
|
/base/security/code_signature/services/local_code_sign/src/ |
D | local_code_sign_stub.cpp | 64 ByteBuffer cert; in InitLocalCertificateInner() local 65 int32_t result = InitLocalCertificate(cert); in InitLocalCertificateInner() 72 if (!reply.WriteUint32(cert.GetSize())) { in InitLocalCertificateInner() 75 if (!reply.WriteBuffer(cert.GetBuffer(), cert.GetSize())) { in InitLocalCertificateInner()
|
/base/security/dlp_permission_service/services/dlp_permission/sa/sa_main/ |
D | dlp_permission_async_proxy.cpp | 30 …DlpPermissionAsyncProxy::OnGenerateDlpCertificate(int32_t result, const std::vector<uint8_t>& cert) in OnGenerateDlpCertificate() argument 42 if (!data.WriteUInt8Vector(cert)) { in OnGenerateDlpCertificate() 64 const std::vector<uint8_t>& cert) in OnParseDlpCertificate() argument 85 if (!data.WriteUInt8Vector(cert)) { in OnParseDlpCertificate()
|
/base/security/code_signature/interfaces/innerkits/local_code_sign/src/ |
D | local_code_sign_kit.cpp | 23 int32_t LocalCodeSignKit::InitLocalCertificate(ByteBuffer &cert) in InitLocalCertificate() argument 25 return LocalCodeSignClient::GetInstance().InitLocalCertificate(cert); in InitLocalCertificate()
|
/base/web/webview/interfaces/kits/napi/js/ |
D | webview_export.js | 16 let cert = requireInternal('security.cert'); variable 44 encodingFormat: cert.EncodingFormat.FORMAT_DER 46 x509CertArray[i] = cert.createX509Cert(encodeBlobData);
|
/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
|