From 0451c23669280e4689a890b453a96ac227888c0f Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Tue, 7 Jan 2025 22:45:47 +0800 Subject: [PATCH] IssueNo:IBGC0P Description:fix bug Sig:SIG_ApplicaitonFramework Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangtiantian --- .../innerkits/appverify/include/interfaces/hap_verify.h | 3 ++- interfaces/innerkits/appverify/include/verify/hap_verify_v2.h | 2 +- interfaces/innerkits/appverify/src/interfaces/hap_verify.cpp | 4 ++-- interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/interfaces/innerkits/appverify/include/interfaces/hap_verify.h b/interfaces/innerkits/appverify/include/interfaces/hap_verify.h index 9197675..c775291 100644 --- a/interfaces/innerkits/appverify/include/interfaces/hap_verify.h +++ b/interfaces/innerkits/appverify/include/interfaces/hap_verify.h @@ -27,7 +27,8 @@ namespace Verify { DLL_EXPORT bool EnableDebugMode(); DLL_EXPORT void DisableDebugMode(); DLL_EXPORT int32_t HapVerify(const std::string& filePath, HapVerifyResult& hapVerifyResult, bool readFile = false); -DLL_EXPORT int32_t ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result); +DLL_EXPORT int32_t ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result, + bool readFile = false); DLL_EXPORT int32_t ParseHapSignatureInfo(const std::string& filePath, SignatureInfo &hapSignInfo); extern "C" DLL_EXPORT int32_t ParseBundleNameAndAppIdentifier(const int32_t fileFd, std::string &bundleName, std::string &appIdentifier); diff --git a/interfaces/innerkits/appverify/include/verify/hap_verify_v2.h b/interfaces/innerkits/appverify/include/verify/hap_verify_v2.h index c2aabbb..bbac732 100644 --- a/interfaces/innerkits/appverify/include/verify/hap_verify_v2.h +++ b/interfaces/innerkits/appverify/include/verify/hap_verify_v2.h @@ -31,7 +31,7 @@ class HapVerifyV2 { public: int32_t Verify(const std::string& filePath, HapVerifyResult& hapVerifyV1Result, bool readFile = false); int32_t Verify(const int32_t fileFd, HapVerifyResult& hapVerifyV1Result); - int32_t ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result); + int32_t ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result, bool readFile = false); int32_t ParseHapSignatureInfo(const std::string& filePath, SignatureInfo &hapSignInfo); private: diff --git a/interfaces/innerkits/appverify/src/interfaces/hap_verify.cpp b/interfaces/innerkits/appverify/src/interfaces/hap_verify.cpp index e0b3bed..ec713ab 100644 --- a/interfaces/innerkits/appverify/src/interfaces/hap_verify.cpp +++ b/interfaces/innerkits/appverify/src/interfaces/hap_verify.cpp @@ -93,10 +93,10 @@ int32_t HapVerify(const std::string& filePath, HapVerifyResult& hapVerifyResult, return hapVerifyV2.Verify(filePath, hapVerifyResult, readFile); } -int32_t ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result) +int32_t ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result, bool readFile = false) { HapVerifyV2 hapVerifyV2; - return hapVerifyV2.ParseHapProfile(filePath, hapVerifyV1Result); + return hapVerifyV2.ParseHapProfile(filePath, hapVerifyV1Result, readFile); } int32_t ParseHapSignatureInfo(const std::string& filePath, SignatureInfo &hapSignInfo) diff --git a/interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp b/interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp index a1193f8..06a4c09 100644 --- a/interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp +++ b/interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp @@ -439,7 +439,7 @@ bool HapVerifyV2::GetDigestAndAlgorithm(Pkcs7Context& digest) return true; } -int32_t HapVerifyV2::ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result) +int32_t HapVerifyV2::ParseHapProfile(const std::string& filePath, HapVerifyResult& hapVerifyV1Result, bool readFile) { HAPVERIFY_LOG_INFO("start to ParseHapProfile"); std::string standardFilePath; @@ -448,7 +448,7 @@ int32_t HapVerifyV2::ParseHapProfile(const std::string& filePath, HapVerifyResul } RandomAccessFile hapFile; - if (!hapFile.Init(standardFilePath)) { + if (!hapFile.Init(standardFilePath, readFile)) { HAPVERIFY_LOG_ERROR("open standard file failed"); return OPEN_FILE_ERROR; } -- Gitee