Add result param into response callback (#26)
author강용구/Security Assurance Lab(SR)/삼성전자 <ygace.kang@samsung.com>
Tue, 5 Dec 2023 07:52:41 +0000 (16:52 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Tue, 5 Dec 2023 07:52:41 +0000 (16:52 +0900)
* Add result into response callback
* Minor fix on doc
* Drop "NONE" from name of cancelled

include/webauthn-types.h

index 8ecb96e59e57aaf5e93e4a196204e72cd1698e82..e17c58a5902ccad5c394c6fe5ae6f57d422164f1 100644 (file)
@@ -54,6 +54,7 @@ typedef enum {
     WAUTHN_ERROR_NO_SUCH_SERVICE            = -0x09, /**< Socket operation on non-socket error */
     WAUTHN_ERROR_ACCESS_DENIED              = -0x0A, /**< Socket access denied */
     WAUTHN_ERROR_MEMORY                     = -0x0B, /**< Memory error */
+    WAUTHN_ERROR_CANCELLED                  = -0x0C, /**< Cancelled by cancel request */
 } wauthn_error_e;
 
 /**
@@ -561,24 +562,34 @@ typedef void wauthn_cb_display_qrcode(const char *qr_contents, void *user_data);
 /**
  * @brief Invoked when the response for the make credential request need to be returned.
  * @since_tizen 9.0
- * @param[in] pubkey_cred The publickey credential contains response data
+ * @param[in] pubkey_cred The publickey credential contains response data.
+ * @param[in] result The result of the #wauthn_make_credential reqeust.
+ *                   #WAUTHN_ERROR_NONE if the request is completed well,
+ *                   #WAUTHN_ERROR_CANCELLED if the request is cancelled by #wauthn_cancel request.
  * @param[in] user_data The user data passed from the callback structure, #wauthn_mc_callbacks_s.
 
  * @see #wauthn_mc_callbacks_s
  * @see #wauthn_pubkey_credential_attestaion_s
  */
-typedef void wauthn_cb_mc_on_response(const wauthn_pubkey_credential_attestaion_s *pubkey_cred, void *user_data);
+typedef void wauthn_cb_mc_on_response(const wauthn_pubkey_credential_attestaion_s *pubkey_cred,
+                                      wauthn_error_e result,
+                                      void *user_data);
 
 /**
  * @brief Invoked when the response for the get assertion request need to be returned.
  * @since_tizen 9.0
- * @param[in] pubkey_cred The publickey credential contains response data
+ * @param[in] pubkey_cred The publickey credential contains response data.
+ * @param[in] result The result of the reqeust.
+ *                   #WAUTHN_ERROR_NONE if the request is completed well,
+ *                   #WAUTHN_ERROR_CANCELLED if the request is cancelled by #wauthn_cancel request.
  * @param[in] user_data The user data passed from the callback structure, #wauthn_ga_callbacks_s.
 
  * @see #wauthn_ga_callbacks_s
  * @see #wauthn_pubkey_credential_assertion_s
  */
-typedef void wauthn_cb_ga_on_response(const wauthn_pubkey_credential_assertion_s *pubkey_cred, void *user_data);
+typedef void wauthn_cb_ga_on_response(const wauthn_pubkey_credential_assertion_s *pubkey_cred,
+                                      wauthn_error_e result,
+                                      void *user_data);
 
 /**
  * @brief The structure for callback function list used to make credential.