Home
last modified time | relevance | path

Searched refs:hapFile (Results 1 - 10 of 10) sorted by relevance

/base/security/appverify/interfaces/innerkits/appverify/test/unittest/src/
H A Dhap_signing_block_utils_test.cpp49 std::ofstream hapFile(pathFile.c_str(), std::ios::binary | std::ios::out | std::ios::trunc); in CreatTestZipFile()
50 if (!hapFile.is_open()) { in CreatTestZipFile()
55 hapFile.seekp(0, std::ios_base::beg); in CreatTestZipFile()
56 hapFile.write(block, sizeof(block)); in CreatTestZipFile()
62 hapFile.write(reinterpret_cast<char*>(&signBlob), sizeof(signBlob)); in CreatTestZipFile()
63 hapFile.write(reinterpret_cast<char*>(&profileBlob), sizeof(profileBlob)); in CreatTestZipFile()
64 hapFile.write(reinterpret_cast<char*>(&propertyBlob), sizeof(propertyBlob)); in CreatTestZipFile()
66 hapFile.write(block, sizeof(block)); in CreatTestZipFile()
69 hapFile.write(reinterpret_cast<char*>(&blockCount), sizeof(blockCount)); in CreatTestZipFile()
72 hapFile in CreatTestZipFile()
163 std::ofstream hapFile; HWTEST_F() local
220 std::ofstream hapFile; HWTEST_F() local
[all...]
H A Dhap_verify_test.cpp98 std::ofstream hapFile; in HWTEST_F() local
99 hapFile.open(rightFile.c_str(), std::ios::binary | std::ios::out | std::ios::trunc); in HWTEST_F()
100 ASSERT_TRUE(hapFile.is_open()); in HWTEST_F()
101 hapFile.seekp(0, std::ios_base::beg); in HWTEST_F()
102 hapFile.write(miniHapFile, TEST_MINI_HAP_FILE_LENGTH); in HWTEST_F()
103 hapFile.close(); in HWTEST_F()
147 std::ofstream hapFile; in HWTEST_F() local
148 hapFile.open(filePath.c_str(), std::ios::binary | std::ios::out | std::ios::trunc); in HWTEST_F()
149 ASSERT_TRUE(hapFile.is_open()); in HWTEST_F()
150 hapFile in HWTEST_F()
175 std::ofstream hapFile; HWTEST_F() local
245 std::ofstream hapFile; HWTEST_F() local
[all...]
/base/security/appverify/interfaces/innerkits/appverify_lite/src/
H A Dapp_centraldirectory.c96 static bool GetEocd(const FileRead *hapFile, HapEocd *hapEocd, int32_t *eocdOffset) in GetEocd() argument
99 if (hapFile->len <= sizeof(MinEocd)) { in GetEocd()
102 int32_t ret = HapMMap(hapFile->len, 0, &mmapInfo, hapFile); in GetEocd()
108 if (HapGetShort((unsigned char*)fileStart + hapFile->len - sizeof(short), sizeof(short)) == 0 && in GetEocd()
109 HapGetInt((unsigned char*)fileStart + hapFile->len - sizeof(MinEocd), sizeof(int)) == HAP_EOCD_MAGIC) { in GetEocd()
111 fileStart + hapFile->len - sizeof(MinEocd), sizeof(MinEocd)) != EOK) { in GetEocd()
117 *eocdOffset = hapFile->len - sizeof(MinEocd); in GetEocd()
121 int32_t maxReadLen = ((unsigned int)(hapFile->len - sizeof(MinEocd)) > UINT16_MAX_VALUE) ? in GetEocd()
122 UINT16_MAX_VALUE : (hapFile in GetEocd()
146 FindSignature(const FileRead *hapFile, SignatureInfo *signInfo) FindSignature() argument
[all...]
/base/security/appverify/interfaces/innerkits/appverify/include/util/
H A Dhap_signing_block_utils.h58 DLL_EXPORT static bool FindHapSignature(RandomAccessFile& hapFile, SignatureInfo& signInfo);
60 DLL_EXPORT static bool VerifyHapIntegrity(Pkcs7Context& digestInfo, RandomAccessFile& hapFile,
85 DLL_EXPORT static bool FindEocdInHap(RandomAccessFile& hapFile, std::pair<HapByteBuffer, long long>& eocd);
86 DLL_EXPORT static bool FindEocdInHap(RandomAccessFile& hapFile, unsigned short maxCommentSize,
91 static bool FindHapSigningBlock(RandomAccessFile& hapFile, long long centralDirOffset,
93 static bool FindHapSubSigningBlock(RandomAccessFile& hapFile, int32_t blockCount,
/base/security/appverify/interfaces/innerkits/appverify/src/util/
H A Dhap_signing_block_utils.cpp58 bool HapSigningBlockUtils::FindHapSignature(RandomAccessFile& hapFile, SignatureInfo& signInfo) in FindHapSignature() argument
61 if (!FindEocdInHap(hapFile, eocdAndOffsetInFile)) { in FindHapSignature()
73 if (!FindHapSigningBlock(hapFile, signInfo.hapCentralDirOffset, signInfo)) { in FindHapSignature()
80 bool HapSigningBlockUtils::FindEocdInHap(RandomAccessFile& hapFile, std::pair<HapByteBuffer, long long>& eocd) in FindEocdInHap() argument
87 if (FindEocdInHap(hapFile, 0, eocd)) { in FindEocdInHap()
95 return FindEocdInHap(hapFile, USHRT_MAX, eocd); in FindEocdInHap()
98 bool HapSigningBlockUtils::FindEocdInHap(RandomAccessFile& hapFile, unsigned short maxCommentSize, in FindEocdInHap() argument
101 long long fileLength = hapFile.GetLength(); in FindEocdInHap()
115 long long ret = hapFile.ReadFileFullyFromOffset(searchEocdBuffer, searchRangeOffset); in FindEocdInHap()
213 bool HapSigningBlockUtils::FindHapSigningBlock(RandomAccessFile& hapFile, lon argument
316 FindHapSubSigningBlock(RandomAccessFile& hapFile, int32_t blockCount, long long blockArrayLen, long long hapSignBlockOffset, SignatureInfo& signInfo) FindHapSubSigningBlock() argument
423 VerifyHapIntegrity( Pkcs7Context& digestInfo, RandomAccessFile& hapFile, SignatureInfo& signInfo) VerifyHapIntegrity() argument
[all...]
/base/security/appverify/interfaces/innerkits/appverify/src/common/
H A Dhap_file_data_source.cpp23 HapFileDataSource::HapFileDataSource(RandomAccessFile& hapFile, in HapFileDataSource() argument
25 : DataSource(), hapFileRandomAccess(hapFile), fileOffset(offset), sourceSize(size), sourcePosition(position) in HapFileDataSource()
/base/security/appverify/interfaces/innerkits/appverify/src/verify/
H A Dhap_verify_v2.cpp52 RandomAccessFile hapFile; in Verify() local
53 if (!hapFile.Init(standardFilePath)) { in Verify()
58 int32_t resultCode = Verify(hapFile, hapVerifyV1Result); in Verify()
87 int32_t HapVerifyV2::Verify(RandomAccessFile& hapFile, HapVerifyResult& hapVerifyV1Result) in Verify() argument
90 if (!HapSigningBlockUtils::FindHapSignature(hapFile, hapSignInfo)) { in Verify()
127 if (!HapSigningBlockUtils::VerifyHapIntegrity(pkcs7Context, hapFile, hapSignInfo)) { in Verify()
441 RandomAccessFile hapFile; in ParseHapProfile() local
442 if (!hapFile.Init(standardFilePath)) { in ParseHapProfile()
448 if (!HapSigningBlockUtils::FindHapSignature(hapFile, hapSignInfo)) { in ParseHapProfile()
488 RandomAccessFile hapFile; in ParseHapSignatureInfo() local
[all...]
/base/security/appverify/interfaces/innerkits/appverify/include/common/
H A Dhap_file_data_source.h27 HapFileDataSource(RandomAccessFile& hapFile, long long offset, long long size, long long position);
/base/security/appverify/interfaces/innerkits/appverify/include/verify/
H A Dhap_verify_v2.h37 int32_t Verify(RandomAccessFile& hapFile, HapVerifyResult& hapVerifyV1Result);
/base/security/appverify/interfaces/innerkits/appverify_lite/include/
H A Dapp_centraldirectory.h88 bool FindSignature(const FileRead *hapFile, SignatureInfo *signInfo);

Completed in 5 milliseconds