mirror of
https://gitee.com/openharmony/useriam_user_auth_framework
synced 2024-11-23 07:39:51 +00:00
commit
6982c7de53
@ -19,6 +19,14 @@ namespace OHOS {
|
||||
namespace UserIam {
|
||||
namespace UserAuth {
|
||||
const int32_t INVALID_AUTH_TYPE = -1;
|
||||
#define IAM_TRY(action0, action1) \
|
||||
do { \
|
||||
try { \
|
||||
action0; \
|
||||
} catch (...) { \
|
||||
action1; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
enum OperationType : uint32_t {
|
||||
TRACE_ADD_CREDENTIAL = 0,
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "iam_logger.h"
|
||||
#include "iam_defines.h"
|
||||
#include "nocopyable.h"
|
||||
|
||||
namespace OHOS {
|
||||
@ -34,7 +35,7 @@ public:
|
||||
~IamScopeGuard() override
|
||||
{
|
||||
if (action_ != nullptr) {
|
||||
action_();
|
||||
IAM_TRY(action_(), return);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ const std::string GetNowTimeString()
|
||||
struct tm curr;
|
||||
char timeStr[buffSize + 1] = {0};
|
||||
localtime_r(&tt, &curr);
|
||||
int32_t len = snprintf_s(timeStr, sizeof(timeStr), dataLen, "%04d-%02d-%02d %02d:%02d:%02d",
|
||||
int32_t len = snprintf_s(timeStr, sizeof(timeStr), dataLen, "%04u-%02d-%02d %02d:%02d:%02d",
|
||||
curr.tm_year + startYear, curr.tm_mon + 1, curr.tm_mday, curr.tm_hour, curr.tm_min, curr.tm_sec);
|
||||
if (len < 0) {
|
||||
return std::string();
|
||||
|
@ -113,7 +113,7 @@ bool AuthenticationImpl::Update(const std::vector<uint8_t> &scheduleResult, Auth
|
||||
ResourceNodeUtils::SendMsgToExecutor(executorIndex, msg);
|
||||
}
|
||||
|
||||
resultInfo.result = info.result;
|
||||
resultInfo.result = static_cast<decltype(resultInfo.result)>(info.result);
|
||||
resultInfo.freezingTime = info.freezingTime;
|
||||
resultInfo.remainTimes = info.remainTimes;
|
||||
resultInfo.token = info.token;
|
||||
|
Loading…
Reference in New Issue
Block a user