add wauthn_cb_update_linked_data to support 2 min wait 35/309635/12
authorDongsun Lee <ds73.lee@samsung.com>
Mon, 15 Apr 2024 01:11:30 +0000 (10:11 +0900)
committerDongsun Lee <ds73.lee@samsung.com>
Mon, 15 Apr 2024 09:23:15 +0000 (18:23 +0900)
Change-Id: Ic6f6600f2ba1abf597fd7d14216c2580029f65fd

include/webauthn-types.h

index ec2c212cd6ed5f57b2e6dd3eec6f3a12b65c1492..2a24fc8516ffa99dd6d73730d5abc8f32e3e08c6 100644 (file)
@@ -43,6 +43,7 @@ extern "C" {
  */
 typedef enum {
     WAUTHN_ERROR_NONE                       = 0x00,  /**< Successful */
+    WAUTHN_ERROR_NONE_AND_WAIT              = 0x01,  /**< Successful and needs to wait for other result*/
     WAUTHN_ERROR_UNKNOWN                    = -0x01, /**< Unknown error */
     WAUTHN_ERROR_INVALID_PARAMETER          = -0x02, /**< Invalid function parameter */
     WAUTHN_ERROR_PERMISSION_DENIED          = -0x03, /**< Permission denied */
@@ -530,7 +531,8 @@ typedef struct __wauthn_pubkey_cred_creation_options {
         indicates no preference (optional) */
     wauthn_authentication_exts_s *extensions; /**< The Relying Party MAY use this member to provide
         client extension inputs requesting additional processing by the client and authenticator.(optional) */
-    wauthn_hybrid_linked_data_s *linked_device; /**< Linked Device Connection Info (optional) */
+    wauthn_hybrid_linked_data_s *linked_device; /**< Linked Device Connection Info. Optional.
+        If not null, the state assisted transaction will start.*/
 } wauthn_pubkey_cred_creation_options_s;
 
 /**
@@ -574,7 +576,8 @@ typedef struct __wauthn_pubkey_cred_request_options {
     wauthn_authentication_exts_s *extensions; /**<
         The Relying Party MAY use this member to provide client extension inputs requesting
         additional processing by the client and authenticator.(optional) */
-    wauthn_hybrid_linked_data_s *linked_device; /**< Linked Device Connection Info (optional) */
+    wauthn_hybrid_linked_data_s *linked_device; /**< Linked Device Connection Info. Optional.
+        If not null, the state assisted transaction will start.*/
 } wauthn_pubkey_cred_request_options_s;
 
 /**
@@ -607,7 +610,9 @@ typedef struct __wauthn_pubkey_credential_attestation {
         the results of processing client extensions requested by the Relying Party
         upon the Relying Party's invocation of #wauthn_make_credential(). (optional)*/
     wauthn_hybrid_linked_data_s *linked_device; /**<
-        Linked Device Connection Info (optional) */
+        Linked Device Connection Info (optional).
+        If not null, the caller has to store this value and use this
+        in the next transaction to invoke state assisted transaction. */
 } wauthn_pubkey_credential_attestation_s;
 
 /**
@@ -640,7 +645,9 @@ typedef struct __wauthn_pubkey_credential_assertion {
         The results of processing client extensions requested by the Relying Party
         upon the Relying Party's invocation of #wauthn_get_assertion(). (optional)*/
     wauthn_hybrid_linked_data_s *linked_device; /**<
-        Linked Device Connection Info (optional) */
+        Linked Device Connection Info (optional).
+        If not null, the caller has to store this value and use this
+        in the next transaction to invoke state assisted transaction. */
 } wauthn_pubkey_credential_assertion_s;
 
 /**
@@ -737,6 +744,29 @@ typedef void (*wauthn_cb_ga_on_response)(const wauthn_pubkey_credential_assertio
                                       wauthn_error_e result,
                                       void *user_data);
 
+/**
+ * @brief Invoked when the authenticator needs to update its inked device data.
+ *
+ * @remarks This callback is only used in state assisted transaction.
+ * @remarks if the result is WAUTHN_ERROR_NONE_AND_WAIT, the client must wait
+ *              for the result WAUTHN_ERROR_NONE to arrive for at least 2 minutes.
+ *
+ * @since_tizen 9.0
+ * @param[in] linked_data The Linked Device Connection Info.
+ *                   If this is not null, the client has to update the data for next use.
+ * @param[in] result The result of the request.
+ *                   #WAUTHN_ERROR_NONE_AND_WAIT if a update message has arrived and
+ *                       the client needs to wait for another message to arrive.
+ *                   #WAUTHN_ERROR_NONE if the client doesn't have to to wait for another message.
+ * @param[in] user_data The user data passed from the callback structure, #wauthn_ga_callbacks_s.
+
+ * @see #wauthn_ga_callbacks_s
+ * @see #wauthn_hybrid_linked_data_s
+ */
+typedef void (*wauthn_cb_update_linked_data)(const wauthn_hybrid_linked_data_s *linked_data,
+                                      wauthn_error_e result,
+                                      void *user_data);
+
 /**
  * @brief The structure for callback function list used to make credential.
  * @since_tizen 9.0
@@ -749,6 +779,8 @@ typedef struct __wauthn_mc_callbacks {
         call back function for displaying QR code*/
     wauthn_cb_mc_on_response response_callback; /**<
         call back function for getting the final response*/
+    wauthn_cb_update_linked_data linked_data_callback; /**<
+        call back function for getting the updated linked device data*/
     void *user_data; /**< user data to be passed to qrcode_callback and response_callback*/
 } wauthn_mc_callbacks_s;
 
@@ -764,6 +796,8 @@ typedef struct __wauthn_ga_callbacks {
         call back function for displaying QR code*/
     wauthn_cb_ga_on_response response_callback; /**<
         call back function for getting the final response*/
+    wauthn_cb_update_linked_data linked_data_callback; /**<
+        call back function for getting the updated linked device data*/
     void *user_data; /**<
         user data to be passed to qrcode_callback and response_callback*/
 } wauthn_ga_callbacks_s;