diff --git a/frameworks/native/executors/src/framework/framework_executor_callback.cpp b/frameworks/native/executors/src/framework/framework_executor_callback.cpp index 43db9e7fa23870a6002692e875125e3762e66dd7..f371c3ca6aeb9c30bb1c72011eb4f8ffc1aba666 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 e7d2df8cba39c88362b42ef48ce2f33c2a4cb0ee..a1eea5065a5925ecb862c505bdb8e9095777b3fd 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 963459e07446ed3ba7c19df1cdbcaf1b968b3cb5..9e2919fac4770fa149fef4ed94371be1b30469a9 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 960891ec79f0e7df83df7eecc0c5f9a3fc69a466..59ba015bf2dbac55e37b333ae6dad6c702c8612e 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 ae57999584af9248d0ea12367fc80df29efd7b81..b161bdee60a22922a2d81ed2a185eee32d0c12c6 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; } }