diff --git a/services/key_enable/cfg/key_enable.enable_xpm.cfg b/services/key_enable/cfg/key_enable.enable_xpm.cfg index 6b6a6dc515fbb3c93af5caed0a0a60d1f7996ce4..ce26224ed3a8c2769e92cc7397ee093aaedf8a92 100644 --- a/services/key_enable/cfg/key_enable.enable_xpm.cfg +++ b/services/key_enable/cfg/key_enable.enable_xpm.cfg @@ -15,7 +15,7 @@ }, { "name" : "pre-init", "cmds" : [ - "write /proc/sys/kernel/xpm/xpm_mode 1", + "write /proc/sys/kernel/xpm/xpm_mode 1" ] } ], diff --git a/utils/include/cs_hisysevent.h b/utils/include/cs_hisysevent.h index f8da38b03093f17673fd943732663b70b6cd33e8..b0e948587afffdbc66e110d22603888b3b069794 100644 --- a/utils/include/cs_hisysevent.h +++ b/utils/include/cs_hisysevent.h @@ -41,7 +41,7 @@ inline void ReportInvalidCaller(const std::string &interfaceType, uint32_t token HiviewDFX::HiSysEvent::EventType::SECURITY, "INTERFACE", interfaceType, "TOKEN_ID", tokenId); } -inline void ReportParseCodeSig(const std::string &fileInfo, uint32_t errCode) +inline void ReportParseCodeSig(const std::string &fileInfo, int32_t errCode) { HiSysEventWrite(HiviewDFX::HiSysEvent::Domain::CODE_SIGN, "CS_PARSE_CODE_SIG", HiviewDFX::HiSysEvent::EventType::FAULT, diff --git a/utils/include/fsverity_utils_helper.h b/utils/include/fsverity_utils_helper.h index 51602c36d210294484b02e71d3233b9393b30de0..b55b254b8729d9b7aeabfef7805b3da8542342ec 100644 --- a/utils/include/fsverity_utils_helper.h +++ b/utils/include/fsverity_utils_helper.h @@ -104,7 +104,7 @@ private: return CS_ERR_FILE_READ; } buf += bytesRead; - count -= bytesRead; + count -= static_cast(bytesRead); } return CS_SUCCESS; } diff --git a/utils/src/code_sign_block.cpp b/utils/src/code_sign_block.cpp index 887169fb4ca7db9e004908010cefb4149fff06c3..bb3942f8d5cf095c7cc5848429242f4643259f1e 100644 --- a/utils/src/code_sign_block.cpp +++ b/utils/src/code_sign_block.cpp @@ -34,7 +34,13 @@ namespace CodeSign { constexpr uint32_t HAP_CODE_SIGN_BLOCK_ID = 0x30000001; constexpr uint32_t CSB_PROPERTY_BLOB = 0x20000003; -CodeSignBlock::CodeSignBlock() { } +CodeSignBlock::CodeSignBlock() +{ + signatureInfo_.hapSigningBlockOffset = 0; + signatureInfo_.hapCentralDirOffset = 0; + signatureInfo_.hapEocdOffset = 0; + signatureInfo_.version = 0; +} CodeSignBlock::~CodeSignBlock() { } @@ -194,7 +200,7 @@ int32_t CodeSignBlock::GetCodeSignBlockBuffer(const std::string &path, ReadBuffe } blobBuffer = value.optionalBlockValue.GetBufferPtr(); - blobSize = value.optionalBlockValue.GetCapacity(); + blobSize = static_cast(value.optionalBlockValue.GetCapacity()); break; } diff --git a/utils/src/pkcs7_data.cpp b/utils/src/pkcs7_data.cpp index afbfc46db48b160ae183c010e359744fac13d14e..4de0d56d79835dd71908799da4eaef7fd9883eec 100644 --- a/utils/src/pkcs7_data.cpp +++ b/utils/src/pkcs7_data.cpp @@ -43,14 +43,14 @@ PKCS7Data::~PKCS7Data() bool PKCS7Data::InitPKCS7Data(const std::vector &certChain) { - int flags = PKCS7_BINARY | PKCS7_DETACHED | PKCS7_NOATTR | PKCS7_PARTIAL; + uint32_t flags = PKCS7_BINARY | PKCS7_DETACHED | PKCS7_NOATTR | PKCS7_PARTIAL; STACK_OF(X509) *certs = nullptr; if (certChain.empty()) { flags = flags | PKCS7_NOCERTS; } else { certs = MakeStackOfCerts(certChain); } - p7_ = PKCS7_sign(nullptr, nullptr, certs, nullptr, flags); + p7_ = PKCS7_sign(nullptr, nullptr, certs, nullptr, static_cast(flags)); if (p7_ == nullptr) { sk_X509_pop_free(certs, X509_free); return false; diff --git a/utils/src/signer_info.cpp b/utils/src/signer_info.cpp index dc08d93eabf0e2f35047a59e2a63a7aa6367ddf8..ea2d00abbd2938389bf964d681de5669ff151ad6 100644 --- a/utils/src/signer_info.cpp +++ b/utils/src/signer_info.cpp @@ -143,7 +143,7 @@ uint8_t *SignerInfo::GetDataToSign(uint32_t &len) if (itemLen < 0) { return nullptr; } - len = itemLen; + len = static_cast(itemLen); } else { if (unsignedData_ == nullptr) { return nullptr;