diff --git a/services/ca_mock/src/buffer.cpp b/services/ca_mock/src/buffer.cpp index e75dc9436b325ed264c07be8a4cdced4187b08eb..0893a7a6f79b8e814c2185be776de0cde3ba40df 100644 --- a/services/ca_mock/src/buffer.cpp +++ b/services/ca_mock/src/buffer.cpp @@ -123,6 +123,7 @@ void DestoryBuffer(Buffer *buffer) { if (buffer != nullptr) { if (buffer->buf != nullptr) { + // tianshi:处于避免泄露信息的考虑,应对MaxSize,清零 if (memset_s(buffer->buf, buffer->contentSize, 0, buffer->contentSize) != EOK) { FACEAUTH_HILOGE(MODULE_SERVICE, "DestoryBuffer memset fail!"); } diff --git a/services/ca_mock/src/face_auth_ca.cpp b/services/ca_mock/src/face_auth_ca.cpp index 55c04125d9801da9ea6e1e4ece6b8ee7f2bbf6cb..9ff7e5142b6414f1615a52b4e68a38f134ad9fd2 100644 --- a/services/ca_mock/src/face_auth_ca.cpp +++ b/services/ca_mock/src/face_auth_ca.cpp @@ -324,6 +324,7 @@ FIRetCode FaceAuthCA::GetState(int32_t &resultCode, int32_t param[RESULT_MAX_SIZ if (resultNum_ < (int)resultInfos_.size()) { resultCode = resultInfos_[resultNum_].resultCode; FACEAUTH_HILOGI(MODULE_SERVICE, "memcpy length is %{public}d", sizeof(int32_t) * RESULT_MAX_SIZE); + // tianshi: 未使用安全函数 if (memcpy(param, resultInfos_[resultNum_].param, sizeof(int32_t) * RESULT_MAX_SIZE) != nullptr) { return FIRetCode::FI_RC_ERROR; diff --git a/services/common/include/face_auth_defines.h b/services/common/include/face_auth_defines.h index df7fbcf6fe3383c9df3534d814c19a98b7e2e6b2..a2d36dee21dd2ae2a815a5c003f41537920c4018 100644 --- a/services/common/include/face_auth_defines.h +++ b/services/common/include/face_auth_defines.h @@ -104,6 +104,7 @@ static const int32_t FACE_COMMAND_INIT_ALGORITHM = 5; static const int32_t FACE_COMMAND_RELEASE_ALGORITHM = 6; // command from Co-Auth(OnGetProperty) static const int32_t FACE_COMMAND_GET = 1; +// tianshi: 拼写错误 // alogrithm state from FaceAuth CA static const int32_t FACE_ALOGRITHM_OPERATION_CONTINUE = 0; static const int32_t FACE_ALOGRITHM_OPERATION_BREAK = 1; diff --git a/services/faceauth/src/face_auth_common_event_subscriber.cpp b/services/faceauth/src/face_auth_common_event_subscriber.cpp index 116101e4098b931fce40452e8aa0f9827ef64743..b2beccc7db2cb3ddbd0623d58e46446fd14074c7 100644 --- a/services/faceauth/src/face_auth_common_event_subscriber.cpp +++ b/services/faceauth/src/face_auth_common_event_subscriber.cpp @@ -34,6 +34,7 @@ void FaceAuthCommonEventSubscriber::OnReceiveEvent(const CommonEventData &data) FACEAUTH_HILOGI(MODULE_SERVICE, "OnReceiveEvent enter"); OHOS::EventFwk::Want want = data.GetWant(); std::string action = want.GetAction(); + // tianshi:拼写错误 FACEAUTH_HILOGD(MODULE_SERVICE, "Recieved common event:%{public}s", action.c_str()); if (action == REGISTER_NOTIFICATION) { callback_->Start(); diff --git a/services/faceauth/src/face_auth_manager.cpp b/services/faceauth/src/face_auth_manager.cpp index 371f5038e7d911e080fce81e23a5fd37be577eef..947ee94aa511eb1f2bc8a6e98cebedce196d03c9 100644 --- a/services/faceauth/src/face_auth_manager.cpp +++ b/services/faceauth/src/face_auth_manager.cpp @@ -459,6 +459,7 @@ FIRetCode FaceAuthManager::OperForAlgorithm(uint64_t scheduleID) std::unique_ptr token_ptr = std::make_unique(TOKEN_NUM); GetAuthToken(token_ptr, len); uint8_t token[TOKEN_NUM]; + // tianshi: 未使用安全函数 if (memcpy(token, token_ptr.get(), len) != nullptr) { FACEAUTH_HILOGE(MODULE_SERVICE, "GetAuthToken memcpy fail"); return FI_RC_ERROR; @@ -752,6 +753,7 @@ FIRetCode FaceAuthManager::DoWaitInitAlgorithm(std::future futureobj) int32_t FaceAuthManager::GetAuthToken(std::unique_ptr &authToken, uint32_t &len) { uint8_t at[] = {'A', 'u', 't', 'h', 'T', 'o', 'k', 'e', 'n', '\0'}; + // tianshi: 未使用安全函数 if (memcpy(authToken.get(), at, sizeof(at)) != nullptr) { FACEAUTH_HILOGE(MODULE_SERVICE, "GetAuthToken memcpy fail"); return FA_RET_ERROR;