From 7219a949131bf2186a5006ae4f5d603dbc4af53d Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Mon, 1 Aug 2022 11:48:34 +0800 Subject: [PATCH] IssueNo: #I5JUXK:add hqf Description: add hqf Sig:SIG_ApplicaitonFramework Feature or Bugfix:Feature Binary Source:No Signed-off-by: wangtiantian --- .../innerkits/appverify/include/verify/hap_verify_v2.h | 1 + interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/interfaces/innerkits/appverify/include/verify/hap_verify_v2.h b/interfaces/innerkits/appverify/include/verify/hap_verify_v2.h index 9b6b993..7ee0b30 100644 --- a/interfaces/innerkits/appverify/include/verify/hap_verify_v2.h +++ b/interfaces/innerkits/appverify/include/verify/hap_verify_v2.h @@ -58,6 +58,7 @@ private: static const int DIGEST_LEN_OFFSET; static const int DIGEST_OFFSET_IN_CONTENT; static const std::string HAP_APP_PATTERN; + static const std::string HQF_APP_PATTERN; }; } // namespace Verify } // namespace Security diff --git a/interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp b/interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp index 2be1572..8dd1332 100644 --- a/interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp +++ b/interfaces/innerkits/appverify/src/verify/hap_verify_v2.cpp @@ -38,6 +38,7 @@ const int HapVerifyV2::DIGEST_ALGORITHM_OFFSET = 12; const int HapVerifyV2::DIGEST_LEN_OFFSET = 16; const int HapVerifyV2::DIGEST_OFFSET_IN_CONTENT = 20; const std::string HapVerifyV2::HAP_APP_PATTERN = "[^]*.hap$"; +const std::string HapVerifyV2::HQF_APP_PATTERN = "[^]*.hqf$"; int HapVerifyV2::Verify(const std::string& filePath, HapVerifyResult& hapVerifyV1Result) { @@ -65,8 +66,9 @@ bool HapVerifyV2::CheckFilePath(const std::string& filePath, std::string& standa return false; } standardFilePath = std::string(path); - if (!std::regex_match(standardFilePath, std::regex(HAP_APP_PATTERN))) { - HAPVERIFY_LOG_ERROR(LABEL, "file is not hap package"); + if (!std::regex_match(standardFilePath, std::regex(HAP_APP_PATTERN)) && + !std::regex_match(standardFilePath, std::regex(HQF_APP_PATTERN))) { + HAPVERIFY_LOG_ERROR(LABEL, "file is not hap or hqf package"); return false; } return true; -- Gitee