From d593f653117f82bfd73794ace7121b2668daf25b Mon Sep 17 00:00:00 2001 From: liuhu Date: Tue, 13 May 2025 11:34:42 +0800 Subject: [PATCH] =?UTF-8?q?pin=E7=A0=81=E5=A2=9E=E5=8A=A0=E5=87=AD?= =?UTF-8?q?=E6=8D=AE=E9=95=BF=E5=BA=A6=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liuhu Change-Id: I93090099c68c075bedc6d9302d86e4e46ab8c61a --- .../src/framework/framework_executor_callback.cpp | 8 ++++++++ interfaces/inner_api/attributes.h | 2 ++ interfaces/inner_api/iam_common_defines.h | 2 ++ .../inner_api/iam_executor/iam_executor_framework_types.h | 3 +++ services/ipc/src/user_auth_service.cpp | 3 ++- 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/frameworks/native/executors/src/framework/framework_executor_callback.cpp b/frameworks/native/executors/src/framework/framework_executor_callback.cpp index 43db9e7fa..f371c3ca6 100644 --- a/frameworks/native/executors/src/framework/framework_executor_callback.cpp +++ b/frameworks/native/executors/src/framework/framework_executor_callback.cpp @@ -393,6 +393,14 @@ ResultCode FrameworkExecutorCallback::FillPropertyToAttribute(const std::vector< IF_FALSE_LOGE_AND_RETURN_VAL(setNextFailLockoutDurationRet == true, ResultCode::GENERAL_ERROR); break; } + case Attributes::ATTR_CREDENTIAL_LENGTH: { + if (property.credentialLength != 0) { + bool setCredentialLengthRet = values->SetUint32Value(Attributes::ATTR_CREDENTIAL_LENGTH, + property.credentialLength); + IF_FALSE_LOGE_AND_RETURN_VAL(setCredentialLengthRet == true, ResultCode::GENERAL_ERROR); + } + break; + } default: IAM_LOGE("key %{public}d is not recognized", key); return ResultCode::GENERAL_ERROR; diff --git a/interfaces/inner_api/attributes.h b/interfaces/inner_api/attributes.h index e7d2df8cb..a1eea5065 100644 --- a/interfaces/inner_api/attributes.h +++ b/interfaces/inner_api/attributes.h @@ -203,6 +203,8 @@ public: ATTR_TOKEN_TYPE = 100090, /* Token time interval between sign and verify, the value type is int64_t. */ ATTR_TOKEN_TIME_INTERVAL = 100091, + /* credential length, the value type is uint32_t. */ + ATTR_CREDENTIAL_LENGTH = 100092, }; /** diff --git a/interfaces/inner_api/iam_common_defines.h b/interfaces/inner_api/iam_common_defines.h index 963459e07..9e2919fac 100644 --- a/interfaces/inner_api/iam_common_defines.h +++ b/interfaces/inner_api/iam_common_defines.h @@ -159,6 +159,8 @@ enum PropertyMode : uint32_t { PROPERTY_MODE_SET_CACHED_TEMPLATES = 7, /** The property mode is notify collector ready. */ PROPERTY_MODE_NOTIFY_COLLECTOR_READY = 8, + /** The property mode is reset lockout duration. */ + PROPERTY_RESET_LOCKOUT_DURATION = 9, }; /** diff --git a/interfaces/inner_api/iam_executor/iam_executor_framework_types.h b/interfaces/inner_api/iam_executor/iam_executor_framework_types.h index 960891ec7..59ba015bf 100644 --- a/interfaces/inner_api/iam_executor/iam_executor_framework_types.h +++ b/interfaces/inner_api/iam_executor/iam_executor_framework_types.h @@ -122,6 +122,9 @@ struct Property { std::string sensorInfo; /** Next fail lockout duration. */ int32_t nextFailLockoutDuration; + /** credential length. */ + uint32_t credentialLength; + }; } // namespace UserAuth diff --git a/services/ipc/src/user_auth_service.cpp b/services/ipc/src/user_auth_service.cpp index ae5799958..b161bdee6 100644 --- a/services/ipc/src/user_auth_service.cpp +++ b/services/ipc/src/user_auth_service.cpp @@ -87,7 +87,8 @@ bool IsTemplateIdListRequired(const std::vector &keys) if (key == Attributes::AttributeKey::ATTR_PIN_SUB_TYPE || key == Attributes::AttributeKey::ATTR_REMAIN_TIMES || key == Attributes::AttributeKey::ATTR_FREEZING_TIME || - key == Attributes::AttributeKey::ATTR_NEXT_FAIL_LOCKOUT_DURATION) { + key == Attributes::AttributeKey::ATTR_NEXT_FAIL_LOCKOUT_DURATION || + key == Attributes::AttributeKey::ATTR_CREDENTIAL_LENGTH) { return true; } } -- Gitee