Home
last modified time | relevance | path

Searched refs:eocd (Results 1 - 14 of 14) sorted by relevance

/developtools/hapsigner/hapsigntool_cpp/zip/src/
H A Dendof_central_directory.cpp30 EndOfCentralDirectory* eocd = new EndOfCentralDirectory(); in GetEOCDByBytes() local
33 delete eocd; in GetEOCDByBytes()
44 delete eocd; in GetEOCDByBytes()
48 SetEndOfCentralDirectoryValues(bf, eocd); in GetEOCDByBytes()
50 uint16_t commentLength = eocd->GetCommentLength(); in GetEOCDByBytes()
52 delete eocd; in GetEOCDByBytes()
60 eocd->SetComment(readComment); in GetEOCDByBytes()
62 eocd->SetLength(EOCD_LENGTH + commentLength); in GetEOCDByBytes()
64 delete eocd; in GetEOCDByBytes()
68 return std::make_optional(eocd); in GetEOCDByBytes()
71 SetEndOfCentralDirectoryValues(ByteBuffer& bf, EndOfCentralDirectory* eocd) SetEndOfCentralDirectoryValues() argument
[all...]
H A Dzip_utils.cpp25 bool ZipUtils::SetCentralDirectoryOffset(ByteBuffer& eocd, int64_t offset) in SetCentralDirectoryOffset() argument
27 if (!SetUInt32ToBuffer(eocd, eocd.GetPosition() + ZIP_CENTRAL_DIR_OFFSET_IN_EOCD, offset)) { in SetCentralDirectoryOffset()
/developtools/hapsigner/hapsigntool/hap_sign_tool_lib/src/main/java/com/ohos/hapsigntool/zip/
H A DEndOfCentralDirectory.java113 EndOfCentralDirectory eocd = new EndOfCentralDirectory(); in getEOCDByBytes()
123 eocd.setDiskNum(UnsignedDecimalUtil.getUnsignedShort(bf)); in getEOCDByBytes()
124 eocd.setcDStartDiskNum(UnsignedDecimalUtil.getUnsignedShort(bf)); in getEOCDByBytes()
125 eocd.setThisDiskCDNum(UnsignedDecimalUtil.getUnsignedShort(bf)); in getEOCDByBytes()
126 eocd.setCDTotal(UnsignedDecimalUtil.getUnsignedShort(bf)); in getEOCDByBytes()
127 eocd.setCDSize(UnsignedDecimalUtil.getUnsignedInt(bf)); in getEOCDByBytes()
128 eocd.setOffset(UnsignedDecimalUtil.getUnsignedInt(bf)); in getEOCDByBytes()
129 eocd.setCommentLength(UnsignedDecimalUtil.getUnsignedShort(bf)); in getEOCDByBytes()
130 if (bf.remaining() != eocd.getCommentLength()) { in getEOCDByBytes()
133 if (eocd in getEOCDByBytes()
[all...]
H A DZipUtils.java121 * @param eocd buffer of End of Central Directory Record
124 public static long getCentralDirectoryOffset(ByteBuffer eocd) { in getCentralDirectoryOffset() argument
125 checkBufferIsLittleEndian(eocd); in getCentralDirectoryOffset()
126 return getUInt32FromBuffer(eocd, eocd.position() + ZIP_CENTRAL_DIR_OFFSET_IN_EOCD); in getCentralDirectoryOffset()
132 * @param eocd buffer of End of Central Directory Record.
135 public static void setCentralDirectoryOffset(ByteBuffer eocd, long offset) { in setCentralDirectoryOffset() argument
136 checkBufferIsLittleEndian(eocd); in setCentralDirectoryOffset()
137 setUInt32ToBuffer(eocd, eocd in setCentralDirectoryOffset()
146 getCentralDirectorySize(ByteBuffer eocd) getCentralDirectorySize() argument
157 getCentralDirectoryCount(ByteBuffer eocd) getCentralDirectoryCount() argument
[all...]
H A DZipFileInfo.java30 private final ByteBuffer eocd; field in ZipFileInfo
33 long eocdOffset, ByteBuffer eocd) { in ZipFileInfo()
38 this.eocd = eocd; in ZipFileInfo()
58 return eocd; in getEocd()
32 ZipFileInfo(long centralDirectoryOffset, int centralDirectorySize, int centralDirectoryEntryCount, long eocdOffset, ByteBuffer eocd) ZipFileInfo() argument
/developtools/hapsigner/hapsigntool_cpp_test/fuzztest/zip/zipsigner_fuzzer/
H A Dzipsigner_fuzzer.cpp170 auto eocd = zip->GetEndOfCentralDirectory(); in EndOfCentralDirectoryInfoFunc() local
171 eocd->GetLength(); in EndOfCentralDirectoryInfoFunc()
172 eocd->GetEocdLength(); in EndOfCentralDirectoryInfoFunc()
173 eocd->GetSIGNATURE(); in EndOfCentralDirectoryInfoFunc()
174 eocd->GetDiskNum(); in EndOfCentralDirectoryInfoFunc()
175 eocd->GetcDStartDiskNum(); in EndOfCentralDirectoryInfoFunc()
176 eocd->GetThisDiskCDNum(); in EndOfCentralDirectoryInfoFunc()
179 eocd->SetComment(comment); in EndOfCentralDirectoryInfoFunc()
181 eocd->GetComment(); in EndOfCentralDirectoryInfoFunc()
/developtools/hapsigner/hapsigntool_cpp/utils/src/
H A Dhap_signer_block_utils.cpp83 bool HapSignerBlockUtils::FindEocdInHap(RandomAccessFile& hapFile, std::pair<ByteBuffer, int64_t>& eocd) in FindEocdInHap() argument
90 if (FindEocdInHap(hapFile, 0, eocd)) { in FindEocdInHap()
98 return FindEocdInHap(hapFile, USHRT_MAX, eocd); in FindEocdInHap()
102 std::pair<ByteBuffer, int64_t>& eocd) in FindEocdInHap()
126 SIGNATURE_TOOLS_LOGE("eocd is not found"); in FindEocdInHap()
132 eocd.first = searchEocdBuffer; in FindEocdInHap()
133 eocd.second = searchRangeOffset + eocdOffsetInSearchBuffer; in FindEocdInHap()
179 bool HapSignerBlockUtils::GetCentralDirectoryOffset(ByteBuffer& eocd, int64_t eocdOffset, in GetCentralDirectoryOffset() argument
184 if (!eocd.GetUInt32(ZIP_CD_OFFSET_IN_EOCD, offsetValue) || in GetCentralDirectoryOffset()
185 !eocd in GetCentralDirectoryOffset()
101 FindEocdInHap(RandomAccessFile& hapFile, unsigned short maxCommentSize, std::pair<ByteBuffer, int64_t>& eocd) FindEocdInHap() argument
207 GetCentralDirectorySize(ByteBuffer& eocd, long& centralDirectorySize) GetCentralDirectorySize() argument
[all...]
/developtools/hapsigner/hapsigntool_cpp/utils/include/
H A Dhap_signer_block_utils.h86 DLL_EXPORT static bool FindEocdInHap(RandomAccessFile& hapFile, std::pair<ByteBuffer, int64_t>& eocd);
88 std::pair<ByteBuffer, int64_t>& eocd);
90 DLL_EXPORT static bool GetCentralDirectoryOffset(ByteBuffer& eocd, int64_t eocdOffset,
92 DLL_EXPORT static bool GetCentralDirectorySize(ByteBuffer& eocd, long& centralDirectorySize);
/developtools/hapsigner/hapsigntool_cpp_test/unittest/zip/
H A Dzip_signer_test.cpp165 * @tc.expected: step3. make the hap file is ONLY have the eocd block, the return will be false. in HWTEST_F()
168 char eocd[] = {0x50, 0x4b, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x40, 0x00, 0x00, 0x00, in HWTEST_F() local
170 eocdOutput.write(eocd, sizeof(eocd) / sizeof(eocd[0])); in HWTEST_F()
397 * @tc.expected: step1. make the eocd bytes is empty, the return will be nullopt. in HWTEST_F()
414 * @tc.expected: step1. make the eocd bytes is all of zero, the return will be nullopt. in HWTEST_F()
423 * @tc.desc: Test function of EndOfCentralDirectory::GetEOCDByBytes() interface for FAIL with eocd length is wrong
481 EndOfCentralDirectory* eocd = zip->GetEndOfCentralDirectory(); in HWTEST_F() local
482 std::string eocdBytes = eocd in HWTEST_F()
501 EndOfCentralDirectory* eocd = zip->GetEndOfCentralDirectory(); HWTEST_F() local
[all...]
/developtools/hapsigner/hapsigntool_cpp_test/unittest/hapVerify/
H A Dhap_signer_block_utils_test.cpp195 ByteBuffer eocd(TEST_ZIP_EOCD_SIZE); in HWTEST_F()
196 EXPECT_GT(hapTestFile.ReadFileFullyFromOffset(eocd, sumLen - TEST_ZIP_EOCD_SIZE), 0); in HWTEST_F()
197 ByteBuffer buff(eocd); in HWTEST_F()
202 * @tc.steps: step4. make eocd comment error, and test FindHapSignature function in HWTEST_F()
203 * @tc.expected: step4. can not find eocd, the return will be false. in HWTEST_F()
205 ByteBuffer buff2(eocd); in HWTEST_F()
241 std::pair<ByteBuffer, int64_t> eocd; in HWTEST_F() local
243 ASSERT_FALSE(HapSignerBlockUtils::FindEocdInHap(hapTestFile, eocd)); in HWTEST_F()
251 ASSERT_FALSE(HapSignerBlockUtils::FindEocdInHap(hapTestFile, maxCommentSize, eocd)); in HWTEST_F()
253 ASSERT_FALSE(HapSignerBlockUtils::FindEocdInHap(hapTestFile, maxCommentSize, eocd)); in HWTEST_F()
[all...]
/developtools/hapsigner/hapsigntool_cpp/zip/include/
H A Dzip_utils.h33 * @param eocd buffer of End of Central Directory Record.
36 static bool SetCentralDirectoryOffset(ByteBuffer& eocd, int64_t offset);
H A Dendof_central_directory.h117 static void SetEndOfCentralDirectoryValues(ByteBuffer& bf, EndOfCentralDirectory* eocd);
/developtools/hapsigner/hapsigntool/hap_sign_tool_lib/src/main/java/com/ohos/hapsigntool/hap/verify/
H A DHapVerify.java84 private ZipDataInput eocd; field in HapVerify
102 * @param eocd eocd
109 ZipDataInput eocd, in HapVerify()
114 this.eocd = eocd; in HapVerify()
376 keySet, new ZipDataInput[]{beforeApkSigningBlock, centralDirectoryBlock, eocd}, optionalBlocks); in parserContentinfo()
105 HapVerify( ZipDataInput beforeApkSigningBlock, ByteBuffer signatureSchemeBlock, ZipDataInput centralDirectoryBlock, ZipDataInput eocd, List<SigningBlock> optionalBlocks) HapVerify() argument
/developtools/hapsigner/hapsigntool/hap_sign_tool_lib/src/main/java/com/ohos/hapsigntool/hap/provider/
H A DSignProvider.java348 ZipDataInput eocd = new ByteBufferZipDataInput(eocdBuffer); in sign()
354 ZipDataInput[] contents = {beforeCentralDir, centralDirectory, eocd}; in sign()

Completed in 8 milliseconds