From c2c6acf4e760cb6f4d2c3e58c575f0e14b016c3b Mon Sep 17 00:00:00 2001 From: Tianshi Liu Date: Mon, 15 Apr 2024 18:11:55 +0800 Subject: [PATCH] support remote auth Change-Id: I09ca31774bebe3afcc94e200a4ceb8e6aae78304 Signed-off-by: Tianshi Liu --- user_auth/v2_0/IUserAuthInterface.idl | 41 ++++++++++++++++++++++----- user_auth/v2_0/UserAuthTypes.idl | 18 ++++++------ 2 files changed, 44 insertions(+), 15 deletions(-) diff --git a/user_auth/v2_0/IUserAuthInterface.idl b/user_auth/v2_0/IUserAuthInterface.idl index fffd393e..77ced1e5 100644 --- a/user_auth/v2_0/IUserAuthInterface.idl +++ b/user_auth/v2_0/IUserAuthInterface.idl @@ -51,13 +51,15 @@ interface IUserAuthInterface { /** * @brief Initializes the cache information of the user_auth driver. * + * @param deviceUdid Indicates the device udid. + * * @return Returns 0 if the operation is successful. * @return Returns a non-zero value if the operation fails. * * @since 3.2 - * @version 1.0 + * @version 2.0 */ - Init(); + Init([in] String deviceUdid); /** * @brief Adds an authentication executor to obtain the authentication capability. * @@ -426,10 +428,22 @@ interface IUserAuthInterface { * @version 1.0 */ RegisterMessageCallback([in] IMessageCallback messageCallback); + /** + * @brief Prepare remote auth. + * + * @param remoteUdid Indicates the remote device udid. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + PrepareRemoteAuth([in] String remoteUdid); /** * @brief Get local schedule from message. * - * @param remoteDeviceId Indicates the remote device id. + * @param remoteUdid Indicates the remote device udid. * @param message is message received. * @param scheduleInfo is schedule info. See {@link ScheduleInfo}. * @@ -439,14 +453,13 @@ interface IUserAuthInterface { * @since 5.0 * @version 1.0 */ - GetLocalScheduleFromMessage([in] unsigned char[] remoteDeviceId, [in] unsigned char[] message, - [out] ScheduleInfo scheduleInfo); + GetLocalScheduleFromMessage([in] String remoteUdid, [in] unsigned char[] message, [out] ScheduleInfo scheduleInfo); /** * @brief Get signed executor info. * * @param authTypes Indicates the auth types. See @{AuthType}. * @param executorRole Indicates the role of executor. See {@link ExecutorRole}. - * @param remoteDeviceId Indicates the remote device id. + * @param remoteUdid Indicates the remote device udid. * @param signedExecutorInfo Indicates the signed executor info. * * @return Returns 0 if the operation is successful. @@ -455,7 +468,7 @@ interface IUserAuthInterface { * @since 5.0 * @version 1.0 */ - GetSignedExecutorInfo([in] int[] authTypes, [in] int executorRole, [in] unsigned char[] remoteDeviceId, + GetSignedExecutorInfo([in] int[] authTypes, [in] int executorRole, [in] String remoteUdid, [out] unsigned char[] signedExecutorInfo); /** * @brief Set global config param. @@ -467,5 +480,19 @@ interface IUserAuthInterface { * @version 1.0 */ SetGlobalConfigParam([in] GlobalConfigParam param); + /** + * @brief Get auth result from message. + * + * @param remoteUdid Indicates the remote device udid. + * @param message is message received. + * @param authResultInfo Indicates authentication result information. See {@link AuthResultInfo}. + * + * @return Returns 0 if the operation is successful. + * @return Returns a non-zero value if the operation fails. + * + * @since 5.0 + * @version 1.0 + */ + GetAuthResultFromMessage([in] String remoteUdid, [in] unsigned char[] message, [out] struct AuthResultInfo authResultInfo); } /** @} */ diff --git a/user_auth/v2_0/UserAuthTypes.idl b/user_auth/v2_0/UserAuthTypes.idl index 46af1598..f37ac603 100644 --- a/user_auth/v2_0/UserAuthTypes.idl +++ b/user_auth/v2_0/UserAuthTypes.idl @@ -184,6 +184,10 @@ struct ExecutorRegisterInfo { int esl; /**< Public key of the executor. */ unsigned char[] publicKey; + /**< Device udid. */ + String deviceUdid; + /**< signed remote executor info. */ + unsigned char[] signedRemoteExecutorInfo; }; /** @@ -239,6 +243,8 @@ struct AuthResultInfo { unsigned long credentialId; /**< Pin expired info. */ long pinExpiredInfo; + /**< Remote auth result message. */ + unsigned char[] remoteAuthResultMsg; }; /** @@ -326,12 +332,10 @@ struct ScheduleInfo { unsigned int executorMatcher; /**< Operation to perform. See @{scheduleMode}*/ int scheduleMode; - /**< Executor information. See @{ExecutorInfo}. */ - struct ExecutorInfo[] executors; + /**< Executor indexes. */ + unsigned long [] executorIndexes; /**< Executor messages. */ unsigned char[][] executorMessages; - /**< Remote message. */ - unsigned char[] remoteMessage; }; /** @@ -400,10 +404,8 @@ struct AuthParam { int authIntent; /**< Is os account verified. */ boolean isOsAccountVerified; - /**< Remote device id. */ - unsigned char[] remoteDeviceId; - /**< Remote executor info. */ - unsigned char[] remoteExecutorInfo; + /**< Collector udid. */ + String collectorUdid; }; /** -- Gitee