Home
last modified time | relevance | path

Searched refs:readLen (Results 1 – 25 of 49) sorted by relevance

12

/base/update/updater/services/script/script_interpreter/
Dscript_scanner.cpp24 size_t readLen = 0; in LexerInput() local
26 (void)pkgStream_->Read(data, currPos, maxSize, readLen); in LexerInput()
27 memcpy_s(reinterpret_cast<uint8_t*>(buf), maxSize, data.buffer, readLen); in LexerInput()
28 currPos += readLen; in LexerInput()
29 return readLen; in LexerInput()
/base/update/updater/services/package/pkg_algorithm/
Dpkg_algorithm.cpp26 size_t &remainSize, size_t &readLen) const in ReadData()
38 readLen = readBytes; in ReadData()
74 size_t readLen = 0; in Pack() local
76 ret = ReadData(inStream, srcOffset, buffer, remainSize, readLen); in Pack()
82 ret = outStream->Write(buffer, readLen, destOffset); in Pack()
88 algorithm->Update(buffer, readLen); in Pack()
89 srcOffset += readLen; in Pack()
90 destOffset += readLen; in Pack()
120 size_t readLen = 0; in Unpack() local
122 ret = ReadData(inStream, srcOffset, buffer, remainSize, readLen); in Unpack()
[all …]
Dpkg_algo_lz4.cpp66 size_t readLen = 0; in PackCalculate() local
77 ret = ReadData(inStream, srcOffset, inBuffer, remainSize, readLen); in PackCalculate()
85 outBuffer.buffer + LZ4B_REVERSED_LEN, readLen, outBuffer.length - LZ4B_REVERSED_LEN); in PackCalculate()
100 srcOffset += readLen; in PackCalculate()
144 size_t readLen = 0; in UnpackCalculate() local
150 … int32_t ret = ReadData(inStream, unpackText.srcOffset, inBuffer, unpackText.packedSize, readLen); in UnpackCalculate()
155 if (readLen == 0) { in UnpackCalculate()
167 ret = ReadData(inStream, unpackText.srcOffset, inBuffer, unpackText.packedSize, readLen); in UnpackCalculate()
175 outBuffer.buffer, readLen, LZ4B_BLOCK_SIZE); in UnpackCalculate()
188 unpackText.srcOffset += readLen; in UnpackCalculate()
[all …]
Dpkg_algo_deflate.cpp74 size_t readLen = 0; in PackCalculate() local
76 ret = ReadData(inStream, srcOffset, inBuffer, remainSize, readLen); in PackCalculate()
82 zstream.avail_in = readLen; in PackCalculate()
83 srcOffset += readLen; in PackCalculate()
85 algorithm->Calculate(crcResult, inBuffer, readLen); in PackCalculate()
123 z_stream &zstream, PkgAlgorithmContext &context, size_t &readLen) in ReadUnpackData() argument
126 int32_t ret = ReadData(inStream, context.srcOffset, inBuffer, context.packedSize, readLen); in ReadUnpackData()
132 zstream.avail_in = readLen; in ReadUnpackData()
133 context.srcOffset += readLen; in ReadUnpackData()
168 size_t readLen = 0; in UnpackCalculate() local
[all …]
/base/update/updater/services/package/pkg_manager/
Dpkg_stream.cpp75 int32_t FileStream::Read(PkgBuffer &data, size_t start, size_t needRead, size_t &readLen) in Read() argument
88 readLen = 0; in Read()
103 readLen = fread(data.buffer, 1, needRead, stream_); in Read()
104 if (readLen == 0) { in Read()
209 int32_t MemoryMapStream::Read(PkgBuffer &data, size_t start, size_t needRead, size_t &readLen) in Read() argument
224 readLen = ((copyLen > needRead) ? needRead : copyLen); in Read()
228 if (memcpy_s(data.buffer, needRead, memMap_ + start, readLen) != EOK) { in Read()
229 … PKG_LOGE("Memcpy failed size:%zu, start:%zu copyLen:%zu %zu", needRead, start, copyLen, readLen); in Read()
295 int32_t FlowDataStream::Read(PkgBuffer &data, size_t start, size_t needRead, size_t &readLen) in Read() argument
312 readLen = 0; in Read()
[all …]
Dpkg_stream.h33 int32_t Read(PkgBuffer &data, size_t start, size_t needRead, size_t &readLen) override in Read() argument
37 UNUSED(readLen); in Read()
96 int32_t Read(PkgBuffer &data, size_t start, size_t needRead, size_t &readLen) override;
124 int32_t Read(PkgBuffer &data, size_t start, size_t needRead, size_t &readLen) override;
174 int32_t Read(PkgBuffer &data, size_t start, size_t needRead, size_t &readLen) override in Read() argument
178 UNUSED(readLen); in Read()
237 … int32_t Read(Hpackage::PkgBuffer &data, size_t start, size_t needRead, size_t &readLen) override;
270 int32_t ReadFromRingBuf(uint8_t *&buff, const uint32_t needLen, uint32_t &readLen);
/base/security/appverify/interfaces/innerkits/appverify_lite/src/
Dapp_verify_hap.c45 int32_t ret, readLen, rawBufLen; in ComputeBlockHash() local
55 readLen = (rawBufLen > HASH_BLOB_LEN) ? HASH_BLOB_LEN : rawBufLen; in ComputeBlockHash()
65 …if (memcpy_s((chunkContentPrefix + 1), HAP_DIGEST_PRIFIX_LEN - 1, (&readLen), sizeof(int)) != EOK)… in ComputeBlockHash()
72 ret = mbedtls_md_update(mdCtx, (unsigned char *)block + pos, readLen); in ComputeBlockHash()
74 rawBufLen -= readLen; in ComputeBlockHash()
75 pos += readLen; in ComputeBlockHash()
114 int32_t ret, readLen; in ComputeDigestsWithOptionalBlock() local
135 readLen = chunkDigest->len; in ComputeDigestsWithOptionalBlock()
136 LOG_INFO("readLen %d", readLen); in ComputeDigestsWithOptionalBlock()
137 ret = mbedtls_md_update(mdCtx, chunkDigest->buffer, readLen); in ComputeDigestsWithOptionalBlock()
[all …]
Dapp_centraldirectory.c177 int32_t readLen = read(file->fp, buffer->buffer, buffer->len); in ReadFileFullyFromOffset() local
178 if (readLen != buffer->len) { in ReadFileFullyFromOffset()
179 LOG_ERROR("file read error %d --- %d", readLen, buffer->len); in ReadFileFullyFromOffset()
/base/security/access_token/services/accesstokenmanager/main/cpp/src/permission/
Ddlp_permission_set_parser.cpp107 ssize_t readLen = 0; in ReadCfgFile() local
108 while ((readLen = read(fd, buff, MAX_BUFFER_SIZE)) > 0) { in ReadCfgFile()
109 dlpPermsRawData.append(buff, readLen); in ReadCfgFile()
113 if (readLen == 0) { in ReadCfgFile()
/base/update/updater/services/package/pkg_verify/
Dzip_pkg_parse.cpp52 size_t &readLen, const uint16_t &signCommentAppendLen, uint16_t &signCommentTotalLen) const in DoParseZipPkg() argument
64 int32_t ret = pkgStream->Read(zipEocd, zipEocdStart, eocdTotalLen, readLen); in DoParseZipPkg()
103 size_t readLen = 0; in ParseZipPkg() local
105 int32_t ret = pkgStream->Read(footer, footerStart, footerSize, readLen); in ParseZipPkg()
120 …return DoParseZipPkg(pkgStream, pkgSignComment, readLen, signCommentAppendLen, signCommentTotalLen… in ParseZipPkg()
Dopenssl_util.cpp212 size_t readLen = 0; in CalcSha256Digest() local
215 ret = srcData->Read(buffer, offset, blockLen, readLen); in CalcSha256Digest()
222 offset += readLen; in CalcSha256Digest()
223 remainLen -= readLen; in CalcSha256Digest()
226 ret = srcData->Read(buffer, offset, remainLen, readLen); in CalcSha256Digest()
232 SHA256_Update(&ctx, buffer.buffer, readLen); in CalcSha256Digest()
Dpkg_verify_util.cpp77 size_t readLen = 0; in GetSignature() local
78 ret = pkgStream->Read(signData, signatureStart, signDataLen, readLen); in GetSignature()
84 signature.assign(signData.buffer, signData.buffer + readLen); in GetSignature()
/base/update/updater/services/package/pkg_package/
Dpkg_zipfile.cpp119 uint32_t endDirLen, size_t endDirPos, size_t &readLen) in LoadPackage() argument
145 sizeof(Zip64EndCentralDirLocator), readLen); in LoadPackage()
151 ret = pkgStream_->Read(buffer, currentPos, sizeof(Zip64EndCentralDirRecord), readLen); in LoadPackage()
205 size_t readLen = 0; in LoadPackage() local
207 ret = pkgStream_->Read(buffer, endDirPos, sizeof(EndCentralDir), readLen); in LoadPackage()
226 ret = pkgStream_->Read(buffer, endDirPos, sizeof(EndCentralDir), readLen); in LoadPackage()
234 return LoadPackage(fileNames, buffer, endDirLen, endDirPos, readLen); in LoadPackage()
513 size_t readLen = buffer.length; in DecodeCentralDirEntry() local
514 if (readLen < sizeof(CentralDirEntry)) { in DecodeCentralDirEntry()
515 PKG_LOGE("data not not enough %zu", readLen); in DecodeCentralDirEntry()
[all …]
Dpkg_gzipfile.cpp173 size_t readLen = 0; in CheckFileInfo() local
176 … = inStream->Read(buffer, context.packedSize + fileInfo_.fileInfo.dataOffset, BLOCK_SIZE, readLen); in CheckFileInfo()
293 size_t readLen = 0; in DecodeHeader() local
295 int32_t ret = inStream->Read(buffer, blockOffset, buffer.length, readLen); in DecodeHeader()
365 size_t readLen = 0; in LoadPackage() local
367 int32_t ret = pkgStream_->Read(buffer, srcOffset, buffer.length, readLen); in LoadPackage()
394 ret = entry->DecodeHeader(buffer, srcOffset, srcOffset, readLen); in LoadPackage()
395 srcOffset += readLen; in LoadPackage()
/base/update/sys_installer/test/fuzztest/
Dsys_installer_fuzzer.cpp72 size_t readLen = 0; in BuildFileDigest() local
74 ret = stream->Read(buff, offset, buffSize, readLen); in BuildFileDigest()
81 algorithm->Update(buff, readLen); in BuildFileDigest()
83 offset += readLen; in BuildFileDigest()
84 readLen = 0; in BuildFileDigest()
/base/update/updater/test/fuzztest/UpdaterStartUpdaterProc_fuzzer/
DUpdaterStartUpdaterProc_fuzzer.cpp82 size_t readLen = 0; in BuildFileDigest() local
84 ret = stream->Read(buff, offset, buffSize, readLen); in BuildFileDigest()
91 algorithm->Update(buff, readLen); in BuildFileDigest()
93 offset += readLen; in BuildFileDigest()
94 readLen = 0; in BuildFileDigest()
/base/startup/init/services/modules/bootchart/
Dbootchart.c49 ssize_t readLen = 0; in ReadFileToBuffer() local
55 readLen = read(fd, buffer, bufferSize - 1); in ReadFileToBuffer()
57 …PLUGIN_CHECK(readLen >= 0, break, "Failed to read data for %s %d readLen %d", fileName, errno, rea… in ReadFileToBuffer()
58 buffer[readLen] = '\0'; in ReadFileToBuffer()
63 return (readLen > 0) ? buffer : NULL; in ReadFileToBuffer()
/base/security/dlp_permission_service/interfaces/inner_api/dlp_parse/src/
Ddlp_file.cpp610 …uint32_t readLen = ((inFileLen - inOffset) < DLP_BUFF_LEN) ? (inFileLen - inOffset) : DLP_BUFF_LEN; in DoDlpContentCryptyOperation() local
613 if (read(inFd, message.data, readLen) != (ssize_t)readLen) { in DoDlpContentCryptyOperation()
619 message.size = readLen; in DoDlpContentCryptyOperation()
620 outMessage.size = readLen; in DoDlpContentCryptyOperation()
628 if (write(outFd, outMessage.data, readLen) != (ssize_t)readLen) { in DoDlpContentCryptyOperation()
633 inOffset += readLen; in DoDlpContentCryptyOperation()
654 …uint32_t readLen = ((inFileLen - inOffset) < DLP_BUFF_LEN) ? (inFileLen - inOffset) : DLP_BUFF_LEN; in DoDlpContentCopyOperation() local
657 if (read(inFd, data, readLen) != (ssize_t)readLen) { in DoDlpContentCopyOperation()
663 if (write(outFd, data, readLen) != (ssize_t)readLen) { in DoDlpContentCopyOperation()
668 inOffset += readLen; in DoDlpContentCopyOperation()
[all …]
/base/update/updater/test/unittest/package/
Dpkg_test.h98 size_t readLen = 0; in BuildFileDigest() local
100 ret = stream->Read(buff, offset, buffSize, readLen); in BuildFileDigest()
106 algorithm->Update(buff, readLen); in BuildFileDigest()
108 offset += readLen; in BuildFileDigest()
109 readLen = 0; in BuildFileDigest()
/base/update/updater/test/unittest/updater_binary/
Dupdater_binary_unittest.cpp105 size_t readLen = 0; in BuildFileDigest() local
107 ret = stream->Read(buff, offset, buffSize, readLen); in BuildFileDigest()
114 algorithm->Update(buff, readLen); in BuildFileDigest()
115 offset += readLen; in BuildFileDigest()
116 readLen = 0; in BuildFileDigest()
/base/update/updater/services/diffpatch/bzip2/
Dbzip2_adapter.cpp226 size_t readLen = 0; in ReadData() local
232 readLen = info.length - stream_.avail_out; in ReadData()
240 readLen = info.length; in ReadData()
248 if (readLen < info.length) { in ReadData()
249 PATCH_LOGE("Failed to read mem ret %zu length %zu", readLen, info.length); in ReadData()
/base/startup/init/services/loopevent/task/
Dle_streamtask.c53 int readLen = 0; in HandleRecvMsg_() local
55 readLen = recv(GetSocketFd(taskHandle), buffer->data, LOOP_DEFAULT_BUFFER, 0); in HandleRecvMsg_()
56 LE_LOGV("HandleRecvMsg fd:%d read msg len %d", GetSocketFd(taskHandle), readLen); in HandleRecvMsg_()
57 if (readLen < 0) { in HandleRecvMsg_()
63 } else if (readLen == 0) { in HandleRecvMsg_()
76 recvMessage(taskHandle, buffer->data, readLen); in HandleRecvMsg_()
/base/update/updater/test/fuzztest/extractandexecutescript_fuzzer/
Dextractandexecutescript_fuzzer.cpp214 size_t readLen = 0; in BuildFileDigest() local
216 ret = stream->Read(buff, offset, buffSize, readLen); in BuildFileDigest()
222 algorithm->Update(buff, readLen); in BuildFileDigest()
224 offset += readLen; in BuildFileDigest()
225 readLen = 0; in BuildFileDigest()
/base/security/access_token/services/accesstokenmanager/main/cpp/src/token/
Dnative_token_receptor.cpp206 ssize_t readLen = 0; in ReadCfgFile() local
207 while ((readLen = read(fd, buff, BUFFER_SIZE)) > 0) { in ReadCfgFile()
208 nativeRawData.append(buff, readLen); in ReadCfgFile()
212 if (readLen == 0) { in ReadCfgFile()
/base/security/appverify/interfaces/innerkits/appverify/src/init/
Dhap_crl_manager.cpp126 long long readLen = crlRandomAccess.ReadFileFullyFromOffset(crlsBuffer, 0); in ReadCrls() local
127 if (readLen != fileLen) { in ReadCrls()
128 …RIFY_LOG_ERROR(LABEL, "read file len: %{public}lld is not same as %{public}lld", readLen, fileLen); in ReadCrls()

12