Home
last modified time | relevance | path

Searched refs:inStream (Results 1 – 25 of 29) sorted by relevance

12

/base/security/crypto_framework/test/fuzztest/certificate/x509certificate_fuzzer/
Dx509certificate_fuzzer.cpp126 HcfEncodingBlob inStream = { 0 }; in CreateOneCert() local
127 inStream.data = reinterpret_cast<uint8_t *>(g_fuzzCert); in CreateOneCert()
128 inStream.encodingFormat = HCF_FORMAT_PEM; in CreateOneCert()
129 inStream.len = strlen(g_fuzzCert) + 1; in CreateOneCert()
131 HcfResult res = HcfX509CertificateCreate(&inStream, &x509CertObj); in CreateOneCert()
149 HcfEncodingBlob inStream = { 0 }; in X509CertificateFuzzTest() local
150 inStream.data = const_cast<uint8_t *>(data); in X509CertificateFuzzTest()
151 inStream.encodingFormat = HCF_FORMAT_PEM; in X509CertificateFuzzTest()
152 inStream.len = size; in X509CertificateFuzzTest()
154 HcfResult res = HcfX509CertificateCreate(&inStream, &x509CertObj); in X509CertificateFuzzTest()
/base/security/crypto_framework/test/unittest/src/
Dcrypto_x509_certificate_test.cpp259 HcfEncodingBlob inStream = { 0 }; in SetUpTestCase() local
260 inStream.data = (uint8_t *)g_testSelfSignedCaCert; in SetUpTestCase()
261 inStream.encodingFormat = HCF_FORMAT_PEM; in SetUpTestCase()
262 inStream.len = strlen(g_testSelfSignedCaCert) + 1; in SetUpTestCase()
263 (void)HcfX509CertificateCreate(&inStream, &g_x509CertObj); in SetUpTestCase()
284 HcfEncodingBlob inStream = { 0 }; variable
285 inStream.data = (uint8_t *)g_testSelfSignedCaCert;
286 inStream.encodingFormat = HCF_FORMAT_PEM;
287 inStream.len = strlen(g_testSelfSignedCaCert) + 1;
288 HcfResult ret = HcfX509CertificateCreate(&inStream, &x509Cert);
[all …]
/base/update/updater/services/package/pkg_package/
Dpkg_lz4file.cpp22 int32_t Lz4FileEntry::Init(const PkgManager::FileInfoPtr fileInfo, PkgStreamPtr inStream) in Init() argument
24 int32_t ret = PkgEntry::Init(&fileInfo_.fileInfo, fileInfo, inStream); in Init()
39 int32_t Lz4FileEntry::EncodeHeader(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) in EncodeHeader() argument
47 int32_t Lz4FileEntry::Pack(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) in Pack() argument
55 if (algorithm == nullptr || outStream == nullptr || inStream == nullptr) { in Pack()
65 int32_t ret = algorithm->Pack(inStream, outStream, context); in Pack()
85 PkgStreamPtr inStream = pkgFile_->GetPkgStream(); in Unpack() local
86 if (outStream == nullptr || inStream == nullptr) { in Unpack()
95 int32_t ret = algorithm->Unpack(inStream, outStream, context); in Unpack()
129 int32_t Lz4PkgFile::AddEntry(const PkgManager::FileInfoPtr file, const PkgStreamPtr inStream) in AddEntry() argument
[all …]
Dpkg_gzipfile.cpp64 int32_t GZipFileEntry::EncodeHeader(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) in EncodeHeader() argument
112 int32_t GZipFileEntry::Pack(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) in Pack() argument
120 if (algorithm == nullptr || outStream == nullptr || inStream == nullptr) { in Pack()
130 int32_t ret = algorithm->Pack(inStream, outStream, context); in Pack()
166 PkgStreamPtr inStream = pkgFile_->GetPkgStream(); in Unpack() local
167 PKG_CHECK(outStream != nullptr && inStream != nullptr, return PKG_INVALID_PARAM, in Unpack()
174 int32_t ret = algorithm->Unpack(inStream, outStream, context); in Unpack()
181 …ret = inStream->Read(buffer, context.packedSize + fileInfo_.fileInfo.dataOffset, BLOCK_SIZE, readL… in Unpack()
182 …PKG_CHECK(ret == PKG_SUCCESS, return ret, "Fail to read file %s", inStream->GetFileName().c_str()); in Unpack()
221 PkgStreamPtr inStream = pkgFile_->GetPkgStream(); in DecodeHeader() local
[all …]
Dpkg_lz4file.h35 int32_t Init(const PkgManager::FileInfoPtr fileInfo, PkgStreamPtr inStream) override;
42 int32_t EncodeHeader(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) override;
44 int32_t Pack(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) override;
64 int32_t AddEntry(const PkgManager::FileInfoPtr file, const PkgStreamPtr inStream) override;
Dpkg_zipfile.h133 int32_t Init(const PkgManager::FileInfoPtr fileInfo, PkgStreamPtr inStream) override;
140 int32_t EncodeHeader(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) override;
142 int32_t Pack(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) override;
151 int32_t DecodeCentralDirEntry(PkgStreamPtr inStream, PkgBuffer &buffer, size_t currentPos,
159 …int32_t DecodeLocalFileHeaderCheck(PkgStreamPtr inStream, const PkgBuffer &data, size_t currentPos…
161 int32_t DecodeLocalFileHeader(PkgStreamPtr inStream, const PkgBuffer &data, size_t currentPos,
181 int32_t AddEntry(const PkgManager::FileInfoPtr file, const PkgStreamPtr inStream) override;
Dpkg_zipfile.cpp41 int32_t ZipPkgFile::AddEntry(const PkgManager::FileInfoPtr file, const PkgStreamPtr inStream) in AddEntry() argument
47 if (file == nullptr || inStream == nullptr) { in AddEntry()
59 entry->Init(file, inStream); in AddEntry()
62 ret = entry->EncodeHeader(inStream, currentOffset_, encodeLen); in AddEntry()
68 ret = entry->Pack(inStream, currentOffset_, encodeLen); in AddEntry()
239 int32_t ZipFileEntry::EncodeHeader(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) in EncodeHeader() argument
247 int32_t ZipFileEntry::Pack(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) in Pack() argument
253 …PKG_CHECK(algorithm != nullptr && outStream != nullptr && inStream != nullptr, return PKG_INVALID_… in Pack()
277 int32_t ret = algorithm->Pack(inStream, outStream, context); in Pack()
412 int32_t ZipFileEntry::DecodeCentralDirEntry(PkgStreamPtr inStream, PkgBuffer &buffer, size_t curren… in DecodeCentralDirEntry() argument
[all …]
Dpkg_gzipfile.h45 int32_t EncodeHeader(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) override;
47 int32_t Pack(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) override;
69 int32_t AddEntry(const PkgManager::FileInfoPtr file, const PkgStreamPtr inStream) override;
Dpkg_upgradefile.h60 int32_t Init(const PkgManager::FileInfoPtr fileInfo, PkgStreamPtr inStream) override;
62 int32_t EncodeHeader(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) override;
64 int32_t Pack(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) override;
94 int32_t AddEntry(const PkgManager::FileInfoPtr file, const PkgStreamPtr inStream) override;
Dpkg_pkgfile.cpp134 PkgStreamPtr inStream) in Init() argument
136 if (localFileInfo == nullptr || fileInfo == nullptr || inStream == nullptr) { in Init()
141 fileName_.assign(inStream->GetFileName()); in Init()
152 localFileInfo->unpackedSize = inStream->GetFileLength(); in Init()
155 localFileInfo->packedSize = inStream->GetFileLength(); in Init()
Dpkg_pkgfile.h35 virtual int32_t Init(const PkgManager::FileInfoPtr fileInfo, PkgStreamPtr inStream) = 0;
37 virtual int32_t EncodeHeader(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) = 0;
39 virtual int32_t Pack(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) = 0;
65 PkgStreamPtr inStream);
Dpkg_upgradefile.cpp48 int32_t UpgradeFileEntry::Init(const PkgManager::FileInfoPtr fileInfo, PkgStreamPtr inStream) in Init() argument
50 int32_t ret = PkgEntry::Init(&fileInfo_.fileInfo, fileInfo, inStream); in Init()
81 int32_t UpgradePkgFile::AddEntry(const PkgManager::FileInfoPtr file, const PkgStreamPtr inStream) in AddEntry() argument
83 …PKG_CHECK(file != nullptr && inStream != nullptr, return PKG_INVALID_PARAM, "Fail to check input p… in AddEntry()
97 int32_t ret = entry->Init(file, inStream); in AddEntry()
104 ret = entry->Pack(inStream, dataOffset, encodeLen); in AddEntry()
109 ret = entry->EncodeHeader(inStream, offset, encodeLen); in AddEntry()
371 int32_t UpgradeFileEntry::EncodeHeader(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) in EncodeHeader() argument
374 PKG_CHECK(outStream != nullptr && inStream != nullptr, return PKG_INVALID_PARAM, in EncodeHeader()
408 int32_t UpgradeFileEntry::Pack(PkgStreamPtr inStream, size_t startOffset, size_t &encodeLen) in Pack() argument
[all …]
/base/update/updater/services/package/pkg_algorithm/
Dpkg_algo_lz4.h39 int32_t Pack(const PkgStreamPtr inStream, const PkgStreamPtr outStream,
42 int32_t Unpack(const PkgStreamPtr inStream,
55 const PkgStreamPtr inStream, size_t &nextToRead, size_t &srcOffset);
76 int32_t Pack(const PkgStreamPtr inStream,
79 int32_t Unpack(const PkgStreamPtr inStream, const PkgStreamPtr outStream,
Dpkg_algo_deflate.h37 int32_t Pack(const PkgStreamPtr inStream, const PkgStreamPtr outStream,
40 int32_t Unpack(const PkgStreamPtr inStream,
44 int32_t UnpackCalculate(PkgAlgorithmContext &context, const PkgStreamPtr inStream,
Dpkg_algo_lz4.cpp60 int32_t PkgAlgorithmBlockLz4::Pack(const PkgStreamPtr inStream, const PkgStreamPtr outStream, in Pack() argument
63 …PKG_CHECK(inStream != nullptr && outStream != nullptr, return PKG_INVALID_PARAM, "Param context nu… in Pack()
86 ret = ReadData(inStream, srcOffset, inBuffer, remainSize, readLen); in Pack()
110 int32_t PkgAlgorithmBlockLz4::Unpack(const PkgStreamPtr inStream, const PkgStreamPtr outStream, in Unpack() argument
113 …PKG_CHECK(inStream != nullptr && outStream != nullptr, return PKG_INVALID_PARAM, "Param context nu… in Unpack()
130 int32_t ret = ReadData(inStream, srcOffset, inBuffer, remainSize, readLen); in Unpack()
142 ret = ReadData(inStream, srcOffset, inBuffer, remainSize, readLen); in Unpack()
197 int32_t PkgAlgorithmLz4::Pack(const PkgStreamPtr inStream, const PkgStreamPtr outStream, in Pack() argument
200 …PKG_CHECK(inStream != nullptr && outStream != nullptr, return PKG_INVALID_PARAM, "Param context nu… in Pack()
225 ret = ReadData(inStream, srcOffset, inBuffer, remainSize, dataLen); in Pack()
[all …]
Dpkg_algorithm.cpp25 int32_t PkgAlgorithm::ReadData(const PkgStreamPtr inStream, size_t offset, PkgBuffer &buffer, in ReadData() argument
31 int32_t ret = inStream->Read(buffer, offset, remainBytes, readBytes); in ReadData()
59 int32_t PkgAlgorithm::Pack(const PkgStreamPtr inStream, const PkgStreamPtr outStream, in Pack() argument
76 ret = ReadData(inStream, srcOffset, buffer, remainSize, readLen); in Pack()
106 int32_t PkgAlgorithm::Unpack(const PkgStreamPtr inStream, const PkgStreamPtr outStream, in Unpack() argument
122 ret = ReadData(inStream, srcOffset, buffer, remainSize, readLen); in Unpack()
Dpkg_algo_deflate.cpp55 int32_t PkgAlgoDeflate::Pack(const PkgStreamPtr inStream, const PkgStreamPtr outStream, in Pack() argument
60 …PKG_CHECK(inStream != nullptr && outStream != nullptr, return PKG_INVALID_PARAM, "Param context nu… in Pack()
76 ret = ReadData(inStream, srcOffset, inBuffer, remainSize, readLen); in Pack()
96 int32_t PkgAlgoDeflate::UnpackCalculate(PkgAlgorithmContext &context, const PkgStreamPtr inStream, in UnpackCalculate() argument
115 ret = ReadData(inStream, srcOffset, inBuffer, remainCompressedSize, readLen); in UnpackCalculate()
149 int32_t PkgAlgoDeflate::Unpack(const PkgStreamPtr inStream, const PkgStreamPtr outStream, in Unpack() argument
157 if (inStream == nullptr || outStream == nullptr) { in Unpack()
162 return UnpackCalculate(context, inStream, outStream, algorithm); in Unpack()
Dpkg_algorithm.h71 virtual int32_t Pack(const PkgStreamPtr inStream, const PkgStreamPtr outStream,
73 virtual int32_t Unpack(const PkgStreamPtr inStream, const PkgStreamPtr outStream,
83 int32_t ReadData(const PkgStreamPtr inStream,
/base/security/crypto_framework/plugin/openssl_plugin/certificate/inc/
Dx509_crl_openssl.h28 HcfResult HcfCX509CrlSpiCreate(const HcfEncodingBlob *inStream, HcfX509CrlSpi **spi);
Dx509_certificate_openssl.h25 HcfResult OpensslX509CertSpiCreate(const HcfEncodingBlob *inStream, HcfX509CertificateSpi **spi);
/base/security/crypto_framework/frameworks/certificate/
Dx509_crl.c311 HcfResult HcfX509CrlCreate(const HcfEncodingBlob *inStream, HcfX509Crl **returnObj) in HcfX509CrlCreate() argument
313 …if ((inStream == NULL) || (inStream->data == NULL) || (inStream->len > HCF_MAX_BUFFER_LEN) || (ret… in HcfX509CrlCreate()
322 HcfResult res = funcSet->createFunc(inStream, &spiObj); in HcfX509CrlCreate()
Dx509_certificate.c343 HcfResult HcfX509CertificateCreate(const HcfEncodingBlob *inStream, HcfX509Certificate **returnObj) in HcfX509CertificateCreate() argument
345 if ((inStream == NULL) || (inStream->len > HCF_MAX_BUFFER_LEN) || (returnObj == NULL)) { in HcfX509CertificateCreate()
353 HcfResult res = funcSet->createFunc(inStream, &spiObj); in HcfX509CertificateCreate()
/base/security/crypto_framework/plugin/openssl_plugin/certificate/src/
Dx509_crl_openssl.c732 static X509_CRL *ParseX509CRL(const HcfEncodingBlob *inStream) in ParseX509CRL() argument
734 if ((inStream->data == NULL) || (inStream->len <= 0)) { in ParseX509CRL()
738 BIO *bio = BIO_new_mem_buf(inStream->data, inStream->len); in ParseX509CRL()
745 switch (inStream->encodingFormat) { in ParseX509CRL()
765 HcfResult HcfCX509CrlSpiCreate(const HcfEncodingBlob *inStream, HcfX509CrlSpi **spi) in HcfCX509CrlSpiCreate() argument
767 if ((inStream == NULL) || (inStream->data == NULL) || (spi == NULL)) { in HcfCX509CrlSpiCreate()
776 X509_CRL *crl = ParseX509CRL(inStream); in HcfCX509CrlSpiCreate()
/base/security/crypto_framework/interfaces/innerkits/certificate/
Dx509_crl.h79 HcfResult HcfX509CrlCreate(const HcfEncodingBlob *inStream, HcfX509Crl **returnObj);
Dx509_certificate.h92 HcfResult HcfX509CertificateCreate(const HcfEncodingBlob *inStream, HcfX509Certificate **returnObj);

12