diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-08-02 15:58:53 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-08-02 15:58:53 +0200 |
commit | f3ed6ea694e83e45d257fb64b5ae23e73bc81465 (patch) | |
tree | b48275a94cef9962f144bfef9e299c971248b85a | |
parent | ed7b39b035fa18b777b71ddc568deff2f7977c82 (diff) | |
download | anastasis-f3ed6ea694e83e45d257fb64b5ae23e73bc81465.tar.gz anastasis-f3ed6ea694e83e45d257fb64b5ae23e73bc81465.zip |
misc doxygen fixes
41 files changed, 136 insertions, 660 deletions
diff --git a/src/authorization/anastasis_authorization_plugin_email.c b/src/authorization/anastasis_authorization_plugin_email.c index 3e13625..bcee662 100644 --- a/src/authorization/anastasis_authorization_plugin_email.c +++ b/src/authorization/anastasis_authorization_plugin_email.c | |||
@@ -177,7 +177,7 @@ get_message (const json_t *messages, | |||
177 | * | 177 | * |
178 | * @param cls closure | 178 | * @param cls closure |
179 | * @param connection HTTP client request (for queuing response) | 179 | * @param connection HTTP client request (for queuing response) |
180 | * @param truth_mime mime type of @e data | 180 | * @param mime_type mime type of @e data |
181 | * @param data input to validate (i.e. is it a valid phone number, etc.) | 181 | * @param data input to validate (i.e. is it a valid phone number, etc.) |
182 | * @param data_length number of bytes in @a data | 182 | * @param data_length number of bytes in @a data |
183 | * @return #GNUNET_OK if @a data is valid, | 183 | * @return #GNUNET_OK if @a data is valid, |
@@ -229,6 +229,7 @@ email_validate (void *cls, | |||
229 | * @param code secret code that the user has to provide back to satisfy the challenge in | 229 | * @param code secret code that the user has to provide back to satisfy the challenge in |
230 | * the main anastasis protocol | 230 | * the main anastasis protocol |
231 | * @param data input to validate (i.e. is it a valid phone number, etc.) | 231 | * @param data input to validate (i.e. is it a valid phone number, etc.) |
232 | * @param data_length number of bytes in @a data | ||
232 | * @return state to track progress on the authorization operation, NULL on failure | 233 | * @return state to track progress on the authorization operation, NULL on failure |
233 | */ | 234 | */ |
234 | static struct ANASTASIS_AUTHORIZATION_State * | 235 | static struct ANASTASIS_AUTHORIZATION_State * |
diff --git a/src/authorization/anastasis_authorization_plugin_file.c b/src/authorization/anastasis_authorization_plugin_file.c index 9b18d38..9f7eba6 100644 --- a/src/authorization/anastasis_authorization_plugin_file.c +++ b/src/authorization/anastasis_authorization_plugin_file.c | |||
@@ -110,6 +110,7 @@ file_validate (void *cls, | |||
110 | * @param code secret code that the user has to provide back to satisfy the challenge in | 110 | * @param code secret code that the user has to provide back to satisfy the challenge in |
111 | * the main anastasis protocol | 111 | * the main anastasis protocol |
112 | * @param data input to validate (i.e. is it a valid phone number, etc.) | 112 | * @param data input to validate (i.e. is it a valid phone number, etc.) |
113 | * @param data_length number of bytes in @a data | ||
113 | * @return state to track progress on the authorization operation, NULL on failure | 114 | * @return state to track progress on the authorization operation, NULL on failure |
114 | */ | 115 | */ |
115 | static struct ANASTASIS_AUTHORIZATION_State * | 116 | static struct ANASTASIS_AUTHORIZATION_State * |
diff --git a/src/authorization/anastasis_authorization_plugin_post.c b/src/authorization/anastasis_authorization_plugin_post.c index 8fa5979..3664776 100644 --- a/src/authorization/anastasis_authorization_plugin_post.c +++ b/src/authorization/anastasis_authorization_plugin_post.c | |||
@@ -172,7 +172,7 @@ get_message (const json_t *messages, | |||
172 | * | 172 | * |
173 | * @param cls closure | 173 | * @param cls closure |
174 | * @param connection HTTP client request (for queuing response) | 174 | * @param connection HTTP client request (for queuing response) |
175 | * @param truth_mime mime type of @e data | 175 | * @param mime_type mime type of @e data |
176 | * @param data input to validate (i.e. is it a valid phone number, etc.) | 176 | * @param data input to validate (i.e. is it a valid phone number, etc.) |
177 | * @param data_length number of bytes in @a data | 177 | * @param data_length number of bytes in @a data |
178 | * @return #GNUNET_OK if @a data is valid, | 178 | * @return #GNUNET_OK if @a data is valid, |
@@ -256,6 +256,7 @@ post_validate (void *cls, | |||
256 | * @param code secret code that the user has to provide back to satisfy the challenge in | 256 | * @param code secret code that the user has to provide back to satisfy the challenge in |
257 | * the main anastasis protocol | 257 | * the main anastasis protocol |
258 | * @param data input to validate (i.e. is it a valid phone number, etc.) | 258 | * @param data input to validate (i.e. is it a valid phone number, etc.) |
259 | * @param data_length number of bytes in @a data | ||
259 | * @return state to track progress on the authorization operation, NULL on failure | 260 | * @return state to track progress on the authorization operation, NULL on failure |
260 | */ | 261 | */ |
261 | static struct ANASTASIS_AUTHORIZATION_State * | 262 | static struct ANASTASIS_AUTHORIZATION_State * |
diff --git a/src/authorization/anastasis_authorization_plugin_sms.c b/src/authorization/anastasis_authorization_plugin_sms.c index 6421884..0d69e77 100644 --- a/src/authorization/anastasis_authorization_plugin_sms.c +++ b/src/authorization/anastasis_authorization_plugin_sms.c | |||
@@ -228,6 +228,7 @@ sms_validate (void *cls, | |||
228 | * @param code secret code that the user has to provide back to satisfy the challenge in | 228 | * @param code secret code that the user has to provide back to satisfy the challenge in |
229 | * the main anastasis protocol | 229 | * the main anastasis protocol |
230 | * @param data input to validate (i.e. is it a valid phone number, etc.) | 230 | * @param data input to validate (i.e. is it a valid phone number, etc.) |
231 | * @param data_length number of bytes in @a data | ||
231 | * @return state to track progress on the authorization operation, NULL on failure | 232 | * @return state to track progress on the authorization operation, NULL on failure |
232 | */ | 233 | */ |
233 | static struct ANASTASIS_AUTHORIZATION_State * | 234 | static struct ANASTASIS_AUTHORIZATION_State * |
diff --git a/src/backend/anastasis-httpd.c b/src/backend/anastasis-httpd.c index ee7aea7..7c4b068 100644 --- a/src/backend/anastasis-httpd.c +++ b/src/backend/anastasis-httpd.c | |||
@@ -127,12 +127,12 @@ static struct MHD_Daemon *mhd; | |||
127 | struct ANASTASIS_DatabasePlugin *db; | 127 | struct ANASTASIS_DatabasePlugin *db; |
128 | 128 | ||
129 | /** | 129 | /** |
130 | * Reschedule context for #SH_ctx. | 130 | * Reschedule context for #AH_ctx. |
131 | */ | 131 | */ |
132 | static struct GNUNET_CURL_RescheduleContext *rc; | 132 | static struct GNUNET_CURL_RescheduleContext *rc; |
133 | 133 | ||
134 | /** | 134 | /** |
135 | * Set if we should immediately #MHD_run again. | 135 | * Set if we should immediately MHD_run() again. |
136 | */ | 136 | */ |
137 | static int triggered; | 137 | static int triggered; |
138 | 138 | ||
@@ -232,24 +232,25 @@ AH_trigger_curl (void) | |||
232 | 232 | ||
233 | /** | 233 | /** |
234 | * A client has requested the given url using the given method | 234 | * A client has requested the given url using the given method |
235 | * (#MHD_HTTP_METHOD_GET, #MHD_HTTP_METHOD_PUT, | 235 | * (MHD_HTTP_METHOD_GET, MHD_HTTP_METHOD_PUT, |
236 | * #MHD_HTTP_METHOD_DELETE, #MHD_HTTP_METHOD_POST, etc). The callback | 236 | * MHD_HTTP_METHOD_DELETE, MHD_HTTP_METHOD_POST, etc). The callback |
237 | * must call MHD callbacks to provide content to give back to the | 237 | * must call MHD callbacks to provide content to give back to the |
238 | * client and return an HTTP status code (i.e. #MHD_HTTP_OK, | 238 | * client and return an HTTP status code (i.e. MHD_HTTP_OK, |
239 | * #MHD_HTTP_NOT_FOUND, etc.). | 239 | * MHD_HTTP_NOT_FOUND, etc.). |
240 | * | 240 | * |
241 | * @param cls argument given together with the function | 241 | * @param cls argument given together with the function |
242 | * pointer when the handler was registered with MHD | 242 | * pointer when the handler was registered with MHD |
243 | * @param connection MHD connection handle with further request details | ||
243 | * @param url the requested url | 244 | * @param url the requested url |
244 | * @param method the HTTP method used (#MHD_HTTP_METHOD_GET, | 245 | * @param method the HTTP method used (MHD_HTTP_METHOD_GET, |
245 | * #MHD_HTTP_METHOD_PUT, etc.) | 246 | * MHD_HTTP_METHOD_PUT, etc.) |
246 | * @param version the HTTP version string (i.e. | 247 | * @param version the HTTP version string (i.e. |
247 | * #MHD_HTTP_VERSION_1_1) | 248 | * MHD_HTTP_VERSION_1_1) |
248 | * @param upload_data the data being uploaded (excluding HEADERS, | 249 | * @param upload_data the data being uploaded (excluding HEADERS, |
249 | * for a POST that fits into memory and that is encoded | 250 | * for a POST that fits into memory and that is encoded |
250 | * with a supported encoding, the POST data will NOT be | 251 | * with a supported encoding, the POST data will NOT be |
251 | * given in upload_data and is instead available as | 252 | * given in upload_data and is instead available as |
252 | * part of #MHD_get_connection_values; very large POST | 253 | * part of MHD_get_connection_values(); very large POST |
253 | * data *will* be made available incrementally in | 254 | * data *will* be made available incrementally in |
254 | * @a upload_data) | 255 | * @a upload_data) |
255 | * @param upload_data_size set initially to the size of the | 256 | * @param upload_data_size set initially to the size of the |
@@ -262,8 +263,8 @@ AH_trigger_curl (void) | |||
262 | * with plenty of upload data) this allows the application | 263 | * with plenty of upload data) this allows the application |
263 | * to easily associate some request-specific state. | 264 | * to easily associate some request-specific state. |
264 | * If necessary, this state can be cleaned up in the | 265 | * If necessary, this state can be cleaned up in the |
265 | * global #MHD_RequestCompletedCallback (which | 266 | * global MHD_RequestCompletedCallback (which |
266 | * can be set with the #MHD_OPTION_NOTIFY_COMPLETED). | 267 | * can be set with the MHD_OPTION_NOTIFY_COMPLETED). |
267 | * Initially, `*con_cls` will be NULL. | 268 | * Initially, `*con_cls` will be NULL. |
268 | * @return #MHD_YES if the connection was handled successfully, | 269 | * @return #MHD_YES if the connection was handled successfully, |
269 | * #MHD_NO if the socket must be closed due to a serious | 270 | * #MHD_NO if the socket must be closed due to a serious |
@@ -537,7 +538,7 @@ handle_mhd_completion_callback (void *cls, | |||
537 | * Function that queries MHD's select sets and | 538 | * Function that queries MHD's select sets and |
538 | * starts the task waiting for them. | 539 | * starts the task waiting for them. |
539 | * | 540 | * |
540 | * @param daemon_handle HTTP server to prepare to run | 541 | * @return task handle for the daemon |
541 | */ | 542 | */ |
542 | static struct GNUNET_SCHEDULER_Task * | 543 | static struct GNUNET_SCHEDULER_Task * |
543 | prepare_daemon (void) | 544 | prepare_daemon (void) |
diff --git a/src/backend/anastasis-httpd_mhd.c b/src/backend/anastasis-httpd_mhd.c index c39a54c..6d2d898 100644 --- a/src/backend/anastasis-httpd_mhd.c +++ b/src/backend/anastasis-httpd_mhd.c | |||
@@ -27,14 +27,6 @@ | |||
27 | #include "anastasis-httpd_mhd.h" | 27 | #include "anastasis-httpd_mhd.h" |
28 | 28 | ||
29 | 29 | ||
30 | /** | ||
31 | * Function to call to handle the request by sending | ||
32 | * back static data from the @a rh. | ||
33 | * | ||
34 | * @param rh context of the handler | ||
35 | * @param connection the MHD connection to handle | ||
36 | * @return MHD result code | ||
37 | */ | ||
38 | MHD_RESULT | 30 | MHD_RESULT |
39 | TMH_MHD_handler_static_response (struct AH_RequestHandler *rh, | 31 | TMH_MHD_handler_static_response (struct AH_RequestHandler *rh, |
40 | struct MHD_Connection *connection) | 32 | struct MHD_Connection *connection) |
@@ -49,21 +41,13 @@ TMH_MHD_handler_static_response (struct AH_RequestHandler *rh, | |||
49 | } | 41 | } |
50 | 42 | ||
51 | 43 | ||
52 | /** | ||
53 | * Function to call to handle the request by sending | ||
54 | * back a redirect to the AGPL source code. | ||
55 | * | ||
56 | * @param rh context of the handler | ||
57 | * @param connection the MHD connection to handle | ||
58 | * @return MHD result code | ||
59 | */ | ||
60 | MHD_RESULT | 44 | MHD_RESULT |
61 | TMH_MHD_handler_agpl_redirect (struct AH_RequestHandler *rh, | 45 | TMH_MHD_handler_agpl_redirect (struct AH_RequestHandler *rh, |
62 | struct MHD_Connection *connection) | 46 | struct MHD_Connection *connection) |
63 | { | 47 | { |
64 | (void) rh; | 48 | (void) rh; |
65 | return TALER_MHD_reply_agpl (connection, | 49 | return TALER_MHD_reply_agpl (connection, |
66 | "http://www.git.taler.net/anastasis.git"); | 50 | "https://git.taler.net/anastasis.git"); |
67 | } | 51 | } |
68 | 52 | ||
69 | 53 | ||
diff --git a/src/backend/anastasis-httpd_mhd.h b/src/backend/anastasis-httpd_mhd.h index 628abfa..2aa9b28 100644 --- a/src/backend/anastasis-httpd_mhd.h +++ b/src/backend/anastasis-httpd_mhd.h | |||
@@ -34,10 +34,6 @@ | |||
34 | * | 34 | * |
35 | * @param rh context of the handler | 35 | * @param rh context of the handler |
36 | * @param connection the MHD connection to handle | 36 | * @param connection the MHD connection to handle |
37 | * @param[in,out] connection_cls the connection's closure (can be updated) | ||
38 | * @param upload_data upload data | ||
39 | * @param[in,out] upload_data_size number of bytes (left) in @a upload_data | ||
40 | * @param mi merchant backend instance, NULL is allowed in this case! | ||
41 | * @return MHD result code | 37 | * @return MHD result code |
42 | */ | 38 | */ |
43 | MHD_RESULT | 39 | MHD_RESULT |
diff --git a/src/backend/anastasis-httpd_policy.c b/src/backend/anastasis-httpd_policy.c index 2417e15..0b6597a 100644 --- a/src/backend/anastasis-httpd_policy.c +++ b/src/backend/anastasis-httpd_policy.c | |||
@@ -43,7 +43,7 @@ | |||
43 | * using @a default_http_status on success. | 43 | * using @a default_http_status on success. |
44 | * | 44 | * |
45 | * @param connection MHD connection to use | 45 | * @param connection MHD connection to use |
46 | * @param account account to query | 46 | * @param account_pub account to query |
47 | * @return MHD result code | 47 | * @return MHD result code |
48 | */ | 48 | */ |
49 | static MHD_RESULT | 49 | static MHD_RESULT |
diff --git a/src/backend/anastasis-httpd_policy.h b/src/backend/anastasis-httpd_policy.h index 9fb630d..e40ade9 100644 --- a/src/backend/anastasis-httpd_policy.h +++ b/src/backend/anastasis-httpd_policy.h | |||
@@ -48,7 +48,7 @@ AH_policy_get (struct MHD_Connection *connection, | |||
48 | * Handle POST /policy/$ACCOUNT_PUB request. | 48 | * Handle POST /policy/$ACCOUNT_PUB request. |
49 | * | 49 | * |
50 | * @param connection the MHD connection to handle | 50 | * @param connection the MHD connection to handle |
51 | * @param con_cls the connection's closure | 51 | * @param hc request context |
52 | * @param account_pub public key of the account | 52 | * @param account_pub public key of the account |
53 | * @param upload_data upload data | 53 | * @param upload_data upload data |
54 | * @param upload_data_size number of bytes (left) in @a upload_data | 54 | * @param upload_data_size number of bytes (left) in @a upload_data |
diff --git a/src/backend/anastasis-httpd_policy_upload.c b/src/backend/anastasis-httpd_policy_upload.c index bff6028..68eb509 100644 --- a/src/backend/anastasis-httpd_policy_upload.c +++ b/src/backend/anastasis-httpd_policy_upload.c | |||
@@ -227,8 +227,7 @@ cleanup_ctx (struct TM_HandlerContext *hc) | |||
227 | /** | 227 | /** |
228 | * Transmit a payment request for @a order_id on @a connection | 228 | * Transmit a payment request for @a order_id on @a connection |
229 | * | 229 | * |
230 | * @param connection MHD connection | 230 | * @param[in,out] puc details about the operation |
231 | * @param order_id our backend's order ID | ||
232 | * @return #GNUNET_OK on success | 231 | * @return #GNUNET_OK on success |
233 | */ | 232 | */ |
234 | static int | 233 | static int |
@@ -507,7 +506,6 @@ check_payment_cb (void *cls, | |||
507 | * a payment for the user's account. | 506 | * a payment for the user's account. |
508 | * | 507 | * |
509 | * @param puc context to begin payment for. | 508 | * @param puc context to begin payment for. |
510 | * @param timeout when to give up trying | ||
511 | */ | 509 | */ |
512 | static void | 510 | static void |
513 | await_payment (struct PolicyUploadContext *puc) | 511 | await_payment (struct PolicyUploadContext *puc) |
diff --git a/src/backend/anastasis-httpd_truth.c b/src/backend/anastasis-httpd_truth.c index b0b6530..f8962b4 100644 --- a/src/backend/anastasis-httpd_truth.c +++ b/src/backend/anastasis-httpd_truth.c | |||
@@ -277,9 +277,8 @@ AH_truth_shutdown (void) | |||
277 | /** | 277 | /** |
278 | * Callback to process a POST /orders/ID/refund request | 278 | * Callback to process a POST /orders/ID/refund request |
279 | * | 279 | * |
280 | * @param cls closure | 280 | * @param cls closure with a `struct RefundEntry *` |
281 | * @param http_status HTTP status code for this request | 281 | * @param hr HTTP response details |
282 | * @param ec taler-specific error code | ||
283 | * @param taler_refund_uri the refund uri offered to the wallet | 282 | * @param taler_refund_uri the refund uri offered to the wallet |
284 | * @param h_contract hash of the contract a Browser may need to authorize | 283 | * @param h_contract hash of the contract a Browser may need to authorize |
285 | * obtaining the HTTP response. | 284 | * obtaining the HTTP response. |
@@ -876,12 +875,6 @@ run_authorization_process (struct MHD_Connection *connection, | |||
876 | } | 875 | } |
877 | 876 | ||
878 | 877 | ||
879 | /** | ||
880 | * @param connection the MHD connection to handle | ||
881 | * @param url handles a URL of the format "/truth/$UUID[&response=$RESPONSE]" | ||
882 | * @param hc | ||
883 | * @return MHD result code | ||
884 | */ | ||
885 | MHD_RESULT | 878 | MHD_RESULT |
886 | AH_handler_truth_get ( | 879 | AH_handler_truth_get ( |
887 | struct MHD_Connection *connection, | 880 | struct MHD_Connection *connection, |
diff --git a/src/backend/anastasis-httpd_truth.h b/src/backend/anastasis-httpd_truth.h index 7a1b95f..c0ee474 100644 --- a/src/backend/anastasis-httpd_truth.h +++ b/src/backend/anastasis-httpd_truth.h | |||
@@ -44,7 +44,7 @@ AH_truth_upload_shutdown (void); | |||
44 | * | 44 | * |
45 | * @param connection the MHD connection to handle | 45 | * @param connection the MHD connection to handle |
46 | * @param truth_uuid the truth UUID | 46 | * @param truth_uuid the truth UUID |
47 | * @param con_cls | 47 | * @param hc connection context |
48 | * @return MHD result code | 48 | * @return MHD result code |
49 | */ | 49 | */ |
50 | MHD_RESULT | 50 | MHD_RESULT |
@@ -58,13 +58,13 @@ AH_handler_truth_get ( | |||
58 | * Handle a POST to /truth/$UUID. | 58 | * Handle a POST to /truth/$UUID. |
59 | * | 59 | * |
60 | * @param connection the MHD connection to handle | 60 | * @param connection the MHD connection to handle |
61 | * @param con_cls the connection's closure | 61 | * @param hc connection context |
62 | * @param truth_uuid the truth UUID | 62 | * @param truth_uuid the truth UUID |
63 | * @param truth_data truth data | 63 | * @param truth_data truth data |
64 | * @param truth_data_size number of bytes (left) in @a truth_data | 64 | * @param truth_data_size number of bytes (left) in @a truth_data |
65 | * @return MHD result code | 65 | * @return MHD result code |
66 | */ | 66 | */ |
67 | int | 67 | MHD_RESULT |
68 | AH_handler_truth_post ( | 68 | AH_handler_truth_post ( |
69 | struct MHD_Connection *connection, | 69 | struct MHD_Connection *connection, |
70 | struct TM_HandlerContext *hc, | 70 | struct TM_HandlerContext *hc, |
diff --git a/src/backend/anastasis-httpd_truth_upload.c b/src/backend/anastasis-httpd_truth_upload.c index 130876f..30bd8e6 100644 --- a/src/backend/anastasis-httpd_truth_upload.c +++ b/src/backend/anastasis-httpd_truth_upload.c | |||
@@ -508,7 +508,7 @@ begin_payment (struct TruthUploadContext *tuc) | |||
508 | } | 508 | } |
509 | 509 | ||
510 | 510 | ||
511 | int | 511 | MHD_RESULT |
512 | AH_handler_truth_post ( | 512 | AH_handler_truth_post ( |
513 | struct MHD_Connection *connection, | 513 | struct MHD_Connection *connection, |
514 | struct TM_HandlerContext *hc, | 514 | struct TM_HandlerContext *hc, |
diff --git a/src/cli/anastasis-cli-redux.c b/src/cli/anastasis-cli-redux.c index 7b533c2..409b0ed 100644 --- a/src/cli/anastasis-cli-redux.c +++ b/src/cli/anastasis-cli-redux.c | |||
@@ -124,12 +124,11 @@ persist_new_state (json_t *state, | |||
124 | 124 | ||
125 | 125 | ||
126 | /** | 126 | /** |
127 | * Function called with the results of #ANASTASIS_backup_action | 127 | * Function called with the results of #ANASTASIS_redux_action(). |
128 | * or #ANASTASIS_recovery_action. | ||
129 | * | 128 | * |
130 | * @param cls closure | 129 | * @param cls closure |
131 | * @param error_code Error code | 130 | * @param error_code Error code |
132 | * @param new_state new state as result | 131 | * @param result_state new state as result |
133 | */ | 132 | */ |
134 | static void | 133 | static void |
135 | action_cb (void *cls, | 134 | action_cb (void *cls, |
diff --git a/src/include/anastasis.h b/src/include/anastasis.h index 1591106..d253868 100644 --- a/src/include/anastasis.h +++ b/src/include/anastasis.h | |||
@@ -613,6 +613,7 @@ typedef void | |||
613 | * | 613 | * |
614 | * @param ctx the CURL context used to connect to the backend | 614 | * @param ctx the CURL context used to connect to the backend |
615 | * @param user_id user identifier derived from user data and backend salt | 615 | * @param user_id user identifier derived from user data and backend salt |
616 | * @param provider_url base URL of the provider to upload to | ||
616 | * @param type defines the type of the challenge (secure question, sms, email) | 617 | * @param type defines the type of the challenge (secure question, sms, email) |
617 | * @param instructions depending on @a type! usually only for security question/answer! | 618 | * @param instructions depending on @a type! usually only for security question/answer! |
618 | * @param mime_type format of the challenge | 619 | * @param mime_type format of the challenge |
@@ -648,6 +649,7 @@ ANASTASIS_truth_upload ( | |||
648 | * | 649 | * |
649 | * @param ctx the CURL context used to connect to the backend | 650 | * @param ctx the CURL context used to connect to the backend |
650 | * @param user_id user identifier derived from user data and backend salt | 651 | * @param user_id user identifier derived from user data and backend salt |
652 | * @param provider_url base URL of the provider to upload to | ||
651 | * @param type defines the type of the challenge (secure question, sms, email) | 653 | * @param type defines the type of the challenge (secure question, sms, email) |
652 | * @param instructions depending on @a type! usually only for security question/answer! | 654 | * @param instructions depending on @a type! usually only for security question/answer! |
653 | * @param mime_type format of the challenge | 655 | * @param mime_type format of the challenge |
@@ -946,11 +948,9 @@ struct ANASTASIS_ProviderDetails | |||
946 | * @param providers array of providers with URLs to upload the policies to | 948 | * @param providers array of providers with URLs to upload the policies to |
947 | * @param pss_length length of the @a providers array | 949 | * @param pss_length length of the @a providers array |
948 | * @param policies list of policies which are included in this recovery document | 950 | * @param policies list of policies which are included in this recovery document |
949 | * @param policies_length length of the @a policies array | 951 | * @param policies_len length of the @a policies array |
950 | * @param payment_years_requested for how many years would the client like the service to store the truth? | 952 | * @param payment_years_requested for how many years would the client like the service to store the truth? |
951 | * @param pay_timeout how long to wait for payment | 953 | * @param pay_timeout how long to wait for payment |
952 | * @param spc payment callback is opened to pay the upload | ||
953 | * @param spc_cls closure for the @a spc payment callback | ||
954 | * @param src callback for the upload process | 954 | * @param src callback for the upload process |
955 | * @param src_cls closure for the @a src upload callback | 955 | * @param src_cls closure for the @a src upload callback |
956 | * @param secret_name name of the core secret | 956 | * @param secret_name name of the core secret |
diff --git a/src/include/anastasis_authorization_lib.h b/src/include/anastasis_authorization_lib.h index 80740be..99a4602 100644 --- a/src/include/anastasis_authorization_lib.h +++ b/src/include/anastasis_authorization_lib.h | |||
@@ -30,7 +30,7 @@ | |||
30 | * | 30 | * |
31 | * @param method name of the method to load | 31 | * @param method name of the method to load |
32 | * @param AH_cfg configuration to use | 32 | * @param AH_cfg configuration to use |
33 | * @param[out] set to the cost for using the plugin during recovery | 33 | * @param[out] cost set to the cost for using the plugin during recovery |
34 | * @return #GNUNET_OK on success | 34 | * @return #GNUNET_OK on success |
35 | */ | 35 | */ |
36 | struct ANASTASIS_AuthorizationPlugin * | 36 | struct ANASTASIS_AuthorizationPlugin * |
@@ -41,9 +41,7 @@ ANASTASIS_authorization_plugin_load ( | |||
41 | 41 | ||
42 | 42 | ||
43 | /** | 43 | /** |
44 | * shutdown all loaded plugins. | 44 | * Shutdown all loaded plugins. |
45 | * | ||
46 | * @param void | ||
47 | */ | 45 | */ |
48 | void | 46 | void |
49 | ANASTASIS_authorization_plugin_shutdown (void); | 47 | ANASTASIS_authorization_plugin_shutdown (void); |
diff --git a/src/include/anastasis_json.h b/src/include/anastasis_json.h deleted file mode 100644 index d2523a2..0000000 --- a/src/include/anastasis_json.h +++ /dev/null | |||
@@ -1,410 +0,0 @@ | |||
1 | /* | ||
2 | This file is part of Anastasis | ||
3 | Copyright (C) 2020 Taler Systems SA | ||
4 | |||
5 | Anastasis is free software; you can redistribute it and/or modify it under the | ||
6 | terms of the GNU Lesser General Public License as published by the Free Software | ||
7 | Foundation; either version 3, or (at your option) any later version. | ||
8 | |||
9 | Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY | ||
10 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||
11 | A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||
12 | |||
13 | You should have received a copy of the GNU General Public License along with | ||
14 | Anastasis; see the file COPYING.GPL. If not, see <http://www.gnu.org/licenses/> | ||
15 | */ | ||
16 | /** | ||
17 | * @file include/anastasis_json.h | ||
18 | * @brief anastasis de-/serialization api | ||
19 | * @author Christian Grothoff | ||
20 | * @author Dominik Meister | ||
21 | * @author Dennis Neufeld | ||
22 | */ | ||
23 | #ifndef ANASTASIS_JSON_H | ||
24 | #define ANASTASIS_JSON_H | ||
25 | |||
26 | #include <jansson.h> | ||
27 | #include <gnunet/gnunet_util_lib.h> | ||
28 | #include "anastasis_error_codes.h" | ||
29 | |||
30 | /** | ||
31 | * Enumeration of possible backup process status. | ||
32 | */ | ||
33 | enum ANASTASIS_BackupStatus | ||
34 | { | ||
35 | ANASTASIS_BS_INITIAL, | ||
36 | ANASTASIS_BS_SELECT_CONTINENT, | ||
37 | ANASTASIS_BS_SELECT_COUNTRY, | ||
38 | ANASTASIS_BS_ENTER_USER_ATTRIBUTES, | ||
39 | ANASTASIS_BS_ADD_AUTHENTICATION_METHOD, | ||
40 | ANASTASIS_BS_ADD_POLICY, | ||
41 | ANASTASIS_BS_PAY | ||
42 | }; | ||
43 | |||
44 | /** | ||
45 | * Enumeration of possible recovery process status. | ||
46 | */ | ||
47 | enum ANASTASIS_RecoveryStatus | ||
48 | { | ||
49 | ANASTASIS_RS_INITIAL, | ||
50 | ANASTASIS_RS_SELECT_CONTINENT, | ||
51 | ANASTASIS_RS_SELECT_COUNTRY, | ||
52 | ANASTASIS_RS_ENTER_USER_ATTRIBUTES, | ||
53 | ANASTASIS_RS_SOLVE_CHALLENGE | ||
54 | }; | ||
55 | |||
56 | // A state for the backup process. | ||
57 | struct ANASTASIS_BackupState | ||
58 | { | ||
59 | enum ANASTASIS_BackupStatus status; | ||
60 | |||
61 | union | ||
62 | { | ||
63 | |||
64 | struct | ||
65 | { | ||
66 | // empty! | ||
67 | } select_continent; | ||
68 | |||
69 | struct | ||
70 | { | ||
71 | const char *continent; | ||
72 | } select_country; | ||
73 | |||
74 | struct | ||
75 | { | ||
76 | const char *continent; | ||
77 | const char *country; | ||
78 | const char *currency; // derived or per manual override! | ||
79 | json_t *user_attributes; | ||
80 | } enter_attributes; | ||
81 | |||
82 | struct | ||
83 | { | ||
84 | const char *continent; | ||
85 | const char *country; | ||
86 | const char *currency; | ||
87 | json_t *user_attributes; | ||
88 | |||
89 | struct AuthenticationDetails | ||
90 | { | ||
91 | enum AuthenticationMethod | ||
92 | { | ||
93 | SMS, | ||
94 | VIDEO, | ||
95 | SECQUEST, | ||
96 | EMAIL, | ||
97 | SNAILMAIL | ||
98 | }; | ||
99 | char *provider_url; | ||
100 | union Truth | ||
101 | { | ||
102 | |||
103 | struct | ||
104 | { | ||
105 | char *phone_number; | ||
106 | } sms; | ||
107 | |||
108 | struct | ||
109 | { | ||
110 | char *question; | ||
111 | char *answer; // FIXME: Reasonable to store answer in clear text here? | ||
112 | } secquest; | ||
113 | |||
114 | struct | ||
115 | { | ||
116 | char *mailaddress; | ||
117 | } email; | ||
118 | |||
119 | struct | ||
120 | { | ||
121 | char *full_name; | ||
122 | char *street; // street name + number | ||
123 | char *postal_code; | ||
124 | char *city; | ||
125 | char *country; | ||
126 | } snailmail; | ||
127 | |||
128 | struct | ||
129 | { | ||
130 | char *path_to_picture; | ||
131 | } video; | ||
132 | } truth; | ||
133 | }*ad; // array | ||
134 | size_t ad_length; | ||
135 | } add_authentication; | ||
136 | struct | ||
137 | { | ||
138 | const char *continent; | ||
139 | const char *country; | ||
140 | const char *currency; | ||
141 | json_t *user_attributes; | ||
142 | |||
143 | struct AuthenticationDetails | ||
144 | { | ||
145 | enum AuthenticationMethod | ||
146 | { | ||
147 | SMS, | ||
148 | VIDEO, | ||
149 | SECQUEST, | ||
150 | EMAIL, | ||
151 | SNAILMAIL | ||
152 | }; | ||
153 | char *provider_url; | ||
154 | union Truth | ||
155 | { | ||
156 | |||
157 | struct | ||
158 | { | ||
159 | char *phone_number; | ||
160 | } sms; | ||
161 | |||
162 | struct | ||
163 | { | ||
164 | char *question; | ||
165 | char *answer; // FIXME: Reasonable to store answer in clear text here? | ||
166 | } secquest; | ||
167 | |||
168 | struct | ||
169 | { | ||
170 | char *mailaddress; | ||
171 | } email; | ||
172 | |||
173 | struct | ||
174 | { | ||
175 | char *full_name; | ||
176 | char *street; // street name + number | ||
177 | char *postal_code; | ||
178 | char *city; | ||
179 | char *country; | ||
180 | } snailmail; | ||
181 | |||
182 | struct | ||
183 | { | ||
184 | char *path_to_picture; | ||
185 | } video; | ||
186 | } truth; | ||
187 | }*ad; // array | ||
188 | size_t ad_length; | ||
189 | |||
190 | struct PolicyDetails | ||
191 | { | ||
192 | struct AuthenticationDetails *ad; // array | ||
193 | }*pd; // array | ||
194 | size_t pd_length; | ||
195 | } add_policy; | ||
196 | // FIXME: add_payment | ||
197 | } details; | ||
198 | }; | ||
199 | |||
200 | |||
201 | // A state for the recovery process. | ||
202 | struct ANASTASIS_RecoveryState | ||
203 | { | ||
204 | enum ANASTASIS_RecoveryStatus status; | ||
205 | |||
206 | struct | ||
207 | { | ||
208 | // empty! | ||
209 | } select_continent; | ||
210 | |||
211 | struct | ||
212 | { | ||
213 | const char *continent; | ||
214 | } select_country; | ||
215 | |||
216 | struct | ||
217 | { | ||
218 | const char *continent; | ||
219 | const char *country; | ||
220 | const char *currency; // derived or per manual override! | ||
221 | json_t *user_attributes; | ||
222 | } enter_attributes; | ||
223 | |||
224 | struct | ||
225 | { | ||
226 | const char *continent; | ||
227 | const char *country; | ||
228 | const char *currency; | ||
229 | json_t *user_attributes; | ||
230 | |||
231 | struct ChallengeDetails | ||
232 | { | ||
233 | enum AuthenticationMethod | ||
234 | { | ||
235 | SMS, | ||
236 | VIDEO, | ||
237 | SECQUEST, | ||
238 | EMAIL, | ||
239 | SNAILMAIL | ||
240 | }; | ||
241 | char *provider_url; | ||
242 | union Challenge | ||
243 | { | ||
244 | |||
245 | struct | ||
246 | { | ||
247 | char *phone_number; | ||
248 | char *code; | ||
249 | } sms; | ||
250 | |||
251 | struct | ||
252 | { | ||
253 | char *question; | ||
254 | char *answer; // FIXME: Reasonable to store answer in clear text here? | ||
255 | } secquest; | ||
256 | |||
257 | struct | ||
258 | { | ||
259 | char *mailaddress; | ||
260 | char *code; | ||
261 | } email; | ||
262 | |||
263 | struct | ||
264 | { | ||
265 | char *full_name; | ||
266 | char *street; // street name + number | ||
267 | char *postal_code; | ||
268 | char *city; | ||
269 | char *country; | ||
270 | char *code; | ||
271 | } snailmail; | ||
272 | |||
273 | struct | ||
274 | { | ||
275 | char *path_to_picture; | ||
276 | char *code; | ||
277 | } video; | ||
278 | } truth; | ||
279 | }*cd; // array | ||
280 | size_t cd_length; | ||
281 | } solve_challenge; | ||
282 | }; | ||
283 | |||
284 | /** | ||
285 | * Definition of actions on ANASTASIS_BackupState. | ||
286 | */ | ||
287 | struct ANASTASIS_BackupAction | ||
288 | { | ||
289 | enum action | ||
290 | { | ||
291 | ANASTASIS_BA_GET_SELECT_CONTINENT, | ||
292 | ANASTASIS_BA_GET_SELECT_COUNTRY, | ||
293 | ANASTASIS_BA_GET_ENTER_USER_ATTRIBUTES, | ||
294 | ANASTASIS_BA_GET_ADD_AUTHENTICATION_METHOD, | ||
295 | ANASTASIS_BA_GET_ADD_POLICY, | ||
296 | ANASTASIS_BA_GET_PAY, | ||
297 | ANASTASIS_BA_SET_SELECT_CONTINENT, | ||
298 | ANASTASIS_BA_SET_SELECT_COUNTRY, | ||
299 | ANASTASIS_BA_SET_ENTER_USER_ATTRIBUTES, | ||
300 | ANASTASIS_BA_SET_ADD_AUTHENTICATION_METHOD, | ||
301 | ANASTASIS_BA_SET_ADD_POLICY, | ||
302 | ANASTASIS_BA_SET_PAY | ||
303 | }; | ||
304 | }; | ||
305 | |||
306 | /** | ||
307 | * Definition of actions on ANASTASIS_RecoveryState. | ||
308 | */ | ||
309 | struct ANASTASIS_RecoveryAction | ||
310 | { | ||
311 | enum action | ||
312 | { | ||
313 | ANASTASIS_RS_GET_SELECT_CONTINENT, | ||
314 | ANASTASIS_RS_GET_SELECT_COUNTRY, | ||
315 | ANASTASIS_RS_GET_ENTER_USER_ATTRIBUTES, | ||
316 | ANASTASIS_RS_GET_SOLVE_CHALLENGE, | ||
317 | ANASTASIS_RS_SET_SELECT_CONTINENT, | ||
318 | ANASTASIS_RS_SET_SELECT_COUNTRY, | ||
319 | ANASTASIS_RS_SET_ENTER_USER_ATTRIBUTES, | ||
320 | ANASTASIS_RS_SET_SOLVE_CHALLENGE | ||
321 | }; | ||
322 | }; | ||
323 | |||
324 | |||
325 | /** | ||
326 | * Signature of the callback bassed to #ANASTASIS_apply_anastasis_backup_action | ||
327 | * for asynchronous actions on a #ANASTASIS_BackupState. | ||
328 | * | ||
329 | * @param cls closure | ||
330 | * @param new_bs the new #ANASTASIS_BackupState | ||
331 | * @param error error code | ||
332 | */ | ||
333 | typedef void | ||
334 | (*ANASTASIS_BackupApplyActionCallback)( | ||
335 | void *cls, | ||
336 | const struct ANASTASIS_BackupState *new_bs, | ||
337 | enum TALER_ErrorCode error); | ||
338 | |||
339 | |||
340 | /** | ||
341 | * Signature of the callback bassed to #ANASTASIS_apply_anastasis_recovery_action | ||
342 | * for asynchronous actions on a #ANASTASIS_RecoveryState. | ||
343 | * | ||
344 | * @param cls closure | ||
345 | * @param new_bs the new #ANASTASIS_RecoveryState | ||
346 | * @param error error code | ||
347 | */ | ||
348 | typedef void | ||
349 | (*ANASTASIS_RecoveryApplyActionCallback)( | ||
350 | void *cls, | ||
351 | const struct ANASTASIS_RecoveryState *new_rs, | ||
352 | enum TALER_ErrorCode error); | ||
353 | |||
354 | |||
355 | /** | ||
356 | * Returns an initial ANASTASIS_BackupState. | ||
357 | * | ||
358 | * @return initial ANASTASIS_BackupState | ||
359 | */ | ||
360 | struct ANASTASIS_BackupState * | ||
361 | ANASTASIS_get_initial_backup_state (); | ||
362 | |||
363 | |||
364 | /** | ||
365 | * Returns an initial ANASTASIS_RecoveryState. | ||
366 | * | ||
367 | * @return initial ANASTASIS_RecoveryState | ||
368 | */ | ||
369 | struct ANASTASIS_RecoveryState * | ||
370 | ANASTASIS_get_initial_recovery_state (); | ||
371 | |||
372 | |||
373 | /** | ||
374 | * Operates on a backup state depending on given #ANASTASIS_BackupState | ||
375 | * and #ANASTASIS_BackupAction. The new #ANASTASIS_BackupState is returned | ||
376 | * by a callback function. | ||
377 | * This function can do network access to talk to anastasis service providers. | ||
378 | * | ||
379 | * @param ctx url context for the event loop | ||
380 | * @param bs the previous *ANASTASIS_BackupState | ||
381 | * @param ba the action to do on #ANASTASIS_BackupState | ||
382 | * @param cb callback function to call with the action | ||
383 | */ | ||
384 | void | ||
385 | ANASTASIS_apply_anastasis_backup_action ( | ||
386 | struct GNUNET_CURL_Context *ctx, | ||
387 | struct ANASTASIS_BackupState *bs, | ||
388 | struct ANASTASIS_BackupAction *ba, | ||
389 | ANASTASIS_BackupApplyActionCallback cb); | ||
390 | |||
391 | |||
392 | /** | ||
393 | * Operates on a recovery state depending on given #ANASTASIS_RecoveryState | ||
394 | * and #ANASTASIS_RecoveryAction. The new #ANASTASIS_RecoveryState is returned | ||
395 | * by a callback function. | ||
396 | * This function can do network access to talk to anastasis service providers. | ||
397 | * | ||
398 | * @param ctx url context for the event loop | ||
399 | * @param bs the previous *ANASTASIS_RecoveryState | ||
400 | * @param ba the action to do on #ANASTASIS_RecoveryState | ||
401 | * @param cb callback function to call with the action | ||
402 | */ | ||
403 | void | ||
404 | ANASTASIS_apply_anastasis_recovery_action ( | ||
405 | struct GNUNET_CURL_Context *ctx, | ||
406 | struct ANASTASIS_RecoveryState *rs, | ||
407 | struct ANASTASIS_RecoveryAction *ra, | ||
408 | ANASTASIS_RecoveryApplyActionCallback cb); | ||
409 | |||
410 | #endif /* _ANASTASIS_JSON_H */ | ||
diff --git a/src/include/anastasis_redux.h b/src/include/anastasis_redux.h index 7a0ff53..3a0b3f1 100644 --- a/src/include/anastasis_redux.h +++ b/src/include/anastasis_redux.h | |||
@@ -73,8 +73,7 @@ ANASTASIS_recovery_start (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
73 | 73 | ||
74 | 74 | ||
75 | /** | 75 | /** |
76 | * Signature of the callback passed to #ANASTASIS_backup_action and | 76 | * Signature of the callback passed to #ANASTASIS_redux_action() |
77 | * #ANASTASIS_recover_action. | ||
78 | * | 77 | * |
79 | * @param cls closure | 78 | * @param cls closure |
80 | * @param error error code, #TALER_EC_NONE if @a new_bs is the new successful state | 79 | * @param error error code, #TALER_EC_NONE if @a new_bs is the new successful state |
@@ -93,12 +92,9 @@ struct ANASTASIS_ReduxAction; | |||
93 | 92 | ||
94 | 93 | ||
95 | /** | 94 | /** |
96 | * Operates on a state depending on given #ANASTASIS_BackupState | 95 | * Operates on a state. The new state is returned by a callback |
97 | * or #ANASTASIS_RecoveryState and #ANASTASIS_BackupAction or | 96 | * function. This function can do network access to talk to Anastasis |
98 | * #ANASTASIS_RecoveryAction. | 97 | * service providers. |
99 | * The new #ANASTASIS_BackupState or #ANASTASIS_RecoveryState is returned | ||
100 | * by a callback function. | ||
101 | * This function can do network access to talk to anastasis service providers. | ||
102 | * | 98 | * |
103 | * @param state input state | 99 | * @param state input state |
104 | * @param action what action to perform | 100 | * @param action what action to perform |
diff --git a/src/include/anastasis_service.h b/src/include/anastasis_service.h index 9069035..8e12b02 100644 --- a/src/include/anastasis_service.h +++ b/src/include/anastasis_service.h | |||
@@ -661,7 +661,6 @@ typedef void | |||
661 | * @param ctx the CURL context used to connect to the backend | 661 | * @param ctx the CURL context used to connect to the backend |
662 | * @param backend_url backend's base URL, including final "/" | 662 | * @param backend_url backend's base URL, including final "/" |
663 | * @param uuid unique identfication of the Truth Upload | 663 | * @param uuid unique identfication of the Truth Upload |
664 | * @param prev_truth_data_hash hash of the previous truth upload, NULL for the first upload ever | ||
665 | * @param type type of the authorization method | 664 | * @param type type of the authorization method |
666 | * @param encrypted_keyshare key material to return to the client upon authorization | 665 | * @param encrypted_keyshare key material to return to the client upon authorization |
667 | * @param truth_mime mime type of @e encrypted_truth (after decryption) | 666 | * @param truth_mime mime type of @e encrypted_truth (after decryption) |
diff --git a/src/include/anastasis_testing_lib.h b/src/include/anastasis_testing_lib.h index 80018d9..ba6f801 100644 --- a/src/include/anastasis_testing_lib.h +++ b/src/include/anastasis_testing_lib.h | |||
@@ -38,16 +38,10 @@ | |||
38 | #define ANASTASIS_TESTING_TRAIT_HASH_CURRENT 0 | 38 | #define ANASTASIS_TESTING_TRAIT_HASH_CURRENT 0 |
39 | 39 | ||
40 | /** | 40 | /** |
41 | * Index used in #SYNC_TESTING_get_trait_hash() for the previous hash. | ||
42 | */ | ||
43 | #define ANASTASIS_TESTING_TRAIT_HASH_PREVIOUS 1 | ||
44 | |||
45 | /** | ||
46 | * Obtain a hash from @a cmd. | 41 | * Obtain a hash from @a cmd. |
47 | * | 42 | * |
48 | * @param cmd command to extract the number from. | 43 | * @param cmd command to extract the number from. |
49 | * @param index the number's index number, #ANASTASIS_TESTING_TRAIT_HASH_CURRENT or | 44 | * @param index the number's index number, use #ANASTASIS_TESTING_TRAIT_HASH_CURRENT |
50 | * #SYNC_TESTING_TRAIT_HASH_PREVIOUS | ||
51 | * @param[out] h set to the hash coming from @a cmd. | 45 | * @param[out] h set to the hash coming from @a cmd. |
52 | * @return #GNUNET_OK on success. | 46 | * @return #GNUNET_OK on success. |
53 | */ | 47 | */ |
@@ -107,8 +101,7 @@ ANASTASIS_TESTING_make_trait_truth_key ( | |||
107 | */ | 101 | */ |
108 | int | 102 | int |
109 | ANASTASIS_TESTING_get_trait_account_pub ( | 103 | ANASTASIS_TESTING_get_trait_account_pub ( |
110 | const struct | 104 | const struct TALER_TESTING_Command *cmd, |
111 | TALER_TESTING_Command *cmd, | ||
112 | unsigned int index, | 105 | unsigned int index, |
113 | const struct ANASTASIS_CRYPTO_AccountPublicKeyP **pub); | 106 | const struct ANASTASIS_CRYPTO_AccountPublicKeyP **pub); |
114 | 107 | ||
@@ -216,7 +209,7 @@ ANASTASIS_TESTING_make_trait_truth_uuid ( | |||
216 | * | 209 | * |
217 | * @param cmd command to extract the number from. | 210 | * @param cmd command to extract the number from. |
218 | * @param index the number's index number. | 211 | * @param index the number's index number. |
219 | * @param[out] uuid set to the number coming from @a cmd. | 212 | * @param[out] eks set to the key share coming from @a cmd. |
220 | * @return #GNUNET_OK on success. | 213 | * @return #GNUNET_OK on success. |
221 | */ | 214 | */ |
222 | int | 215 | int |
@@ -255,10 +248,10 @@ ANASTASIS_TESTING_get_trait_code ( | |||
255 | 248 | ||
256 | 249 | ||
257 | /** | 250 | /** |
258 | * Offer a filename. | 251 | * Offer an authentication code. |
259 | * | 252 | * |
260 | * @param index the number's index number. | 253 | * @param index the number's index number. |
261 | * @param tpk the public key to offer. | 254 | * @param code the code to offer. |
262 | * @return trait on success | 255 | * @return trait on success |
263 | */ | 256 | */ |
264 | struct TALER_TESTING_Trait | 257 | struct TALER_TESTING_Trait |
@@ -300,7 +293,7 @@ TALER_TESTING_run_merchant (const char *config_filename, | |||
300 | * anastasis" function to do such tasks. | 293 | * anastasis" function to do such tasks. |
301 | * | 294 | * |
302 | * @param config_filename configuration filename. | 295 | * @param config_filename configuration filename. |
303 | * | 296 | * @param anastasis_url URL to use to confirm service running |
304 | * @return the process, or NULL if the process could not | 297 | * @return the process, or NULL if the process could not |
305 | * be started. | 298 | * be started. |
306 | */ | 299 | */ |
@@ -383,20 +376,33 @@ ANASTASIS_TESTING_cmd_policy_store ( | |||
383 | * Make the "policy lookup" command. | 376 | * Make the "policy lookup" command. |
384 | * | 377 | * |
385 | * @param label command label | 378 | * @param label command label |
386 | * @param ANASTASIS_url base URL of the ANASTASIS serving | 379 | * @param anastasis_url base URL of the ANASTASIS serving |
387 | * the policy lookup request. | 380 | * the policy store request. |
388 | * @param http_status expected HTTP status. | 381 | * @param http_status expected HTTP status. |
389 | * @param upload_ref reference to upload command | 382 | * @param upload_ref reference to upload command |
390 | * @return the command | 383 | * @return the command |
391 | */ | 384 | */ |
392 | struct TALER_TESTING_Command | 385 | struct TALER_TESTING_Command |
393 | ANASTASIS_TESTING_cmd_policy_lookup (const char *label, | 386 | ANASTASIS_TESTING_cmd_policy_lookup (const char *label, |
394 | const char *ANASTASIS_url, | 387 | const char *anastasis_url, |
395 | unsigned int http_status, | 388 | unsigned int http_status, |
396 | const char *upload_ref); | 389 | const char *upload_ref); |
397 | 390 | ||
398 | 391 | ||
399 | /** | 392 | /** |
393 | * Make the "policy lookup" command for a non-existent upload. | ||
394 | * | ||
395 | * @param label command label | ||
396 | * @param anastasis_url base URL of the ANASTASIS serving | ||
397 | * the policy lookup request. | ||
398 | * @return the command | ||
399 | */ | ||
400 | struct TALER_TESTING_Command | ||
401 | ANASTASIS_TESTING_cmd_policy_nx (const char *label, | ||
402 | const char *anastasis_url); | ||
403 | |||
404 | |||
405 | /** | ||
400 | * Types of options for performing the upload. Used as a bitmask. | 406 | * Types of options for performing the upload. Used as a bitmask. |
401 | */ | 407 | */ |
402 | enum ANASTASIS_TESTING_TruthStoreOption | 408 | enum ANASTASIS_TESTING_TruthStoreOption |
@@ -482,6 +488,8 @@ ANASTASIS_TESTING_cmd_truth_question ( | |||
482 | * @param answer (response to challenge) | 488 | * @param answer (response to challenge) |
483 | * @param payment_ref reference to the payment request | 489 | * @param payment_ref reference to the payment request |
484 | * @param upload_ref reference to upload command | 490 | * @param upload_ref reference to upload command |
491 | * @param lookup_mode 0 for security question, 1 for | ||
492 | * code-based | ||
485 | * @param ksdd expected status | 493 | * @param ksdd expected status |
486 | * @return the command | 494 | * @return the command |
487 | */ | 495 | */ |
diff --git a/src/include/platform.h b/src/include/platform.h index d4b8bbe..a44a4a6 100644 --- a/src/include/platform.h +++ b/src/include/platform.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of TALER | 2 | This file is part of TALER |
3 | Copyright (C) 2014, 2015, 2016 GNUnet e.V. and INRIA | 3 | Copyright (C) 2014, 2015, 2016, 2021 Anastasis SARL |
4 | 4 | ||
5 | TALER is free software; you can redistribute it and/or modify it under the | 5 | TALER is free software; you can redistribute it and/or modify it under the |
6 | terms of the GNU Affero General Public License as published by the Free Software | 6 | terms of the GNU Affero General Public License as published by the Free Software |
diff --git a/src/lib/anastasis_backup.c b/src/lib/anastasis_backup.c index d97bdae..47017f2 100644 --- a/src/lib/anastasis_backup.c +++ b/src/lib/anastasis_backup.c | |||
@@ -611,8 +611,7 @@ struct ANASTASIS_SecretShare | |||
611 | * Callback to process a POST /policy request | 611 | * Callback to process a POST /policy request |
612 | * | 612 | * |
613 | * @param cls closure | 613 | * @param cls closure |
614 | * @param ec anastasis-specific error code | 614 | * @param ud the decoded response body |
615 | * @param obj the decoded response body | ||
616 | */ | 615 | */ |
617 | static void | 616 | static void |
618 | policy_store_cb (void *cls, | 617 | policy_store_cb (void *cls, |
diff --git a/src/lib/anastasis_recovery.c b/src/lib/anastasis_recovery.c index 2a606d2..e921cb1 100644 --- a/src/lib/anastasis_recovery.c +++ b/src/lib/anastasis_recovery.c | |||
@@ -236,8 +236,7 @@ struct ANASTASIS_Recovery | |||
236 | * Function called with the results of a #ANASTASIS_keyshare_lookup(). | 236 | * Function called with the results of a #ANASTASIS_keyshare_lookup(). |
237 | * | 237 | * |
238 | * @param cls closure | 238 | * @param cls closure |
239 | * @param http_status HTTP status of the request | 239 | * @param dd details about the lookup operation |
240 | * @param ud details about the lookup operation | ||
241 | */ | 240 | */ |
242 | static void | 241 | static void |
243 | keyshare_lookup_cb (void *cls, | 242 | keyshare_lookup_cb (void *cls, |
@@ -536,11 +535,11 @@ ANASTASIS_challenge_abort (struct ANASTASIS_Challenge *c) | |||
536 | 535 | ||
537 | 536 | ||
538 | /** | 537 | /** |
539 | * Function called with the results of a ANASTASIS_policy_lookup | 538 | * Function called with the results of a #ANASTASIS_policy_lookup() |
540 | * | 539 | * |
541 | * @param cls closure | 540 | * @param cls closure |
542 | * @param http_status HTTP status of the request | 541 | * @param http_status HTTp status code. |
543 | * @param ud details about the lookup operation | 542 | * @param dd details about the lookup operation |
544 | */ | 543 | */ |
545 | static void | 544 | static void |
546 | policy_lookup_cb (void *cls, | 545 | policy_lookup_cb (void *cls, |
diff --git a/src/reducer/anastasis_api_backup_redux.c b/src/reducer/anastasis_api_backup_redux.c index 2f44688..cfe9f31 100644 --- a/src/reducer/anastasis_api_backup_redux.c +++ b/src/reducer/anastasis_api_backup_redux.c | |||
@@ -1388,7 +1388,7 @@ find_best_map (struct PolicyBuilder *pb, | |||
1388 | * Select cheapest policy combinations and add them to the JSON ``policies`` | 1388 | * Select cheapest policy combinations and add them to the JSON ``policies`` |
1389 | * array in @a pb | 1389 | * array in @a pb |
1390 | * | 1390 | * |
1391 | * @param[in,out] policy builder with our state | 1391 | * @param[in,out] pb policy builder with our state |
1392 | */ | 1392 | */ |
1393 | static void | 1393 | static void |
1394 | select_policies (struct PolicyBuilder *pb) | 1394 | select_policies (struct PolicyBuilder *pb) |
@@ -3383,7 +3383,7 @@ truth_upload_cb (void *cls, | |||
3383 | * @a truth for policy reference @a pmr. If such a truth object | 3383 | * @a truth for policy reference @a pmr. If such a truth object |
3384 | * already exists, append @a pmr to its list of reasons. | 3384 | * already exists, append @a pmr to its list of reasons. |
3385 | * | 3385 | * |
3386 | * @param[in,out] our upload context | 3386 | * @param[in,out] uc our upload context |
3387 | * @param pmr policy method combination that requires the truth | 3387 | * @param pmr policy method combination that requires the truth |
3388 | * @param provider_url the URL of the Anastasis provider to upload | 3388 | * @param provider_url the URL of the Anastasis provider to upload |
3389 | * the truth to, used to check for existing entries | 3389 | * the truth to, used to check for existing entries |
@@ -3556,7 +3556,7 @@ add_truth_object (struct UploadContext *uc, | |||
3556 | * policy reference @a pmr. If the upload is already queued, | 3556 | * policy reference @a pmr. If the upload is already queued, |
3557 | * append @a pmr to its list of reasons. | 3557 | * append @a pmr to its list of reasons. |
3558 | * | 3558 | * |
3559 | * @param[in,out] our upload context | 3559 | * @param[in,out] uc our upload context |
3560 | * @param pmr policy method combination that requires the truth | 3560 | * @param pmr policy method combination that requires the truth |
3561 | * @param provider_url the URL of the Anastasis provider to upload | 3561 | * @param provider_url the URL of the Anastasis provider to upload |
3562 | * the truth to, used to check for existing entries | 3562 | * the truth to, used to check for existing entries |
@@ -3755,7 +3755,6 @@ check_truth_upload (struct UploadContext *uc, | |||
3755 | * and change providers/policies), or payment, or finished. | 3755 | * and change providers/policies), or payment, or finished. |
3756 | * | 3756 | * |
3757 | * @param state state to operate on | 3757 | * @param state state to operate on |
3758 | * @param truth_indices indices of truths to upload explicitly | ||
3759 | * @param cb callback (#ANASTASIS_ActionCallback) to call after upload | 3758 | * @param cb callback (#ANASTASIS_ActionCallback) to call after upload |
3760 | * @param cb_cls callback closure | 3759 | * @param cb_cls callback closure |
3761 | */ | 3760 | */ |
@@ -4482,18 +4481,6 @@ typedef struct ANASTASIS_ReduxAction * | |||
4482 | void *cb_cls); | 4481 | void *cb_cls); |
4483 | 4482 | ||
4484 | 4483 | ||
4485 | /** | ||
4486 | * Operates on a backup state depending on given #ANASTASIS_BackupState | ||
4487 | * and #ANASTASIS_BackupAction. The new #ANASTASIS_BackupState is returned | ||
4488 | * by a callback function. | ||
4489 | * This function can do network access to talk to anastasis service providers. | ||
4490 | * | ||
4491 | * @param[in,out] state input/output state (to be modified) | ||
4492 | * @param action what action to perform | ||
4493 | * @param arguments data for the @a action | ||
4494 | * @param cb function to call with the result | ||
4495 | * @param cb_cls closure for @a cb | ||
4496 | */ | ||
4497 | struct ANASTASIS_ReduxAction * | 4484 | struct ANASTASIS_ReduxAction * |
4498 | ANASTASIS_backup_action_ (json_t *state, | 4485 | ANASTASIS_backup_action_ (json_t *state, |
4499 | const char *action, | 4486 | const char *action, |
diff --git a/src/reducer/anastasis_api_recovery_redux.c b/src/reducer/anastasis_api_recovery_redux.c index 0d395bc..84db8fe 100644 --- a/src/reducer/anastasis_api_recovery_redux.c +++ b/src/reducer/anastasis_api_recovery_redux.c | |||
@@ -261,7 +261,7 @@ update_state_by_error (json_t *state, | |||
261 | * On success, the secret is returned in @a secret. | 261 | * On success, the secret is returned in @a secret. |
262 | * | 262 | * |
263 | * @param cls handle for the callback | 263 | * @param cls handle for the callback |
264 | * @param ec error code | 264 | * @param rc error code |
265 | * @param secret contains the core secret which is passed to the user | 265 | * @param secret contains the core secret which is passed to the user |
266 | * @param secret_size defines the size of the core secret | 266 | * @param secret_size defines the size of the core secret |
267 | */ | 267 | */ |
@@ -1655,18 +1655,6 @@ typedef struct ANASTASIS_ReduxAction * | |||
1655 | void *cb_cls); | 1655 | void *cb_cls); |
1656 | 1656 | ||
1657 | 1657 | ||
1658 | /** | ||
1659 | * Operates on a recovery state depending on given #ANASTASIS_RecoveryState | ||
1660 | * and #ANASTASIS_RecoveryAction. The new #ANASTASIS_RecoveryState is returned | ||
1661 | * by a callback function. | ||
1662 | * This function can do network access to talk to anastasis service providers. | ||
1663 | * | ||
1664 | * @param[in,out] state input/output state (to be modified) | ||
1665 | * @param action what action to perform | ||
1666 | * @param arguments data for the @a action | ||
1667 | * @param cb function to call with the result | ||
1668 | * @param cb_cls closure for @a cb | ||
1669 | */ | ||
1670 | struct ANASTASIS_ReduxAction * | 1658 | struct ANASTASIS_ReduxAction * |
1671 | ANASTASIS_recovery_action_ (json_t *state, | 1659 | ANASTASIS_recovery_action_ (json_t *state, |
1672 | const char *action, | 1660 | const char *action, |
@@ -1919,9 +1907,9 @@ struct RecoverSecretState | |||
1919 | 1907 | ||
1920 | 1908 | ||
1921 | /** | 1909 | /** |
1922 | * Function to free a #RecoverSecretState. | 1910 | * Function to free a `struct RecoverSecretState` |
1923 | * | 1911 | * |
1924 | * @param cls closure for a #RecoverSecretState. | 1912 | * @param cls must be a `struct RecoverSecretState` |
1925 | */ | 1913 | */ |
1926 | static void | 1914 | static void |
1927 | free_rss (void *cls) | 1915 | free_rss (void *cls) |
@@ -1967,7 +1955,7 @@ free_rss (void *cls) | |||
1967 | * we are called, it is because of some fatal error. | 1955 | * we are called, it is because of some fatal error. |
1968 | * | 1956 | * |
1969 | * @param cls a `struct PolicyDownloadEntry` | 1957 | * @param cls a `struct PolicyDownloadEntry` |
1970 | * @param ec error code | 1958 | * @param rc error code |
1971 | * @param secret contains the core secret which is passed to the user | 1959 | * @param secret contains the core secret which is passed to the user |
1972 | * @param secret_size defines the size of the core secret | 1960 | * @param secret_size defines the size of the core secret |
1973 | */ | 1961 | */ |
diff --git a/src/reducer/anastasis_api_redux.c b/src/reducer/anastasis_api_redux.c index 41b3fd7..c41d801 100644 --- a/src/reducer/anastasis_api_redux.c +++ b/src/reducer/anastasis_api_redux.c | |||
@@ -332,7 +332,7 @@ ANASTASIS_redux_init (struct GNUNET_CURL_Context *ctx) | |||
332 | 332 | ||
333 | 333 | ||
334 | /** | 334 | /** |
335 | * Function to free a #ConfigRequest, an async operation. | 335 | * Function to free a `struct ConfigRequest`, an async operation. |
336 | * | 336 | * |
337 | * @param cr state for a "get config" operation | 337 | * @param cr state for a "get config" operation |
338 | */ | 338 | */ |
diff --git a/src/reducer/anastasis_api_redux.h b/src/reducer/anastasis_api_redux.h index b388fd3..ef0962b 100644 --- a/src/reducer/anastasis_api_redux.h +++ b/src/reducer/anastasis_api_redux.h | |||
@@ -100,6 +100,8 @@ ANASTASIS_redux_done (void); | |||
100 | /** | 100 | /** |
101 | * Produce an initial state with an initialized list of | 101 | * Produce an initial state with an initialized list of |
102 | * continents. | 102 | * continents. |
103 | * | ||
104 | * @return list of continents | ||
103 | */ | 105 | */ |
104 | json_t * | 106 | json_t * |
105 | ANASTASIS_REDUX_load_continents_ (void); | 107 | ANASTASIS_REDUX_load_continents_ (void); |
@@ -108,8 +110,8 @@ ANASTASIS_REDUX_load_continents_ (void); | |||
108 | /** | 110 | /** |
109 | * Returns the enum value to a string value of a state. | 111 | * Returns the enum value to a string value of a state. |
110 | * | 112 | * |
111 | * @param state_string | 113 | * @param state_string string to convert |
112 | * @return #ANASTASIS_GENERIC_STATE_ERROR on error | 114 | * @return ANASTASIS_GENERIC_STATE_ERROR on error |
113 | */ | 115 | */ |
114 | enum ANASTASIS_GenericState | 116 | enum ANASTASIS_GenericState |
115 | ANASTASIS_generic_state_from_string_ (const char *state_string); | 117 | ANASTASIS_generic_state_from_string_ (const char *state_string); |
@@ -118,7 +120,7 @@ ANASTASIS_generic_state_from_string_ (const char *state_string); | |||
118 | /** | 120 | /** |
119 | * Returns the string value of a state. | 121 | * Returns the string value of a state. |
120 | * | 122 | * |
121 | * @param state_string | 123 | * @param gs state value to convert |
122 | * @return NULL on error | 124 | * @return NULL on error |
123 | */ | 125 | */ |
124 | const char * | 126 | const char * |
@@ -128,8 +130,8 @@ ANASTASIS_generic_state_to_string_ (enum ANASTASIS_GenericState gs); | |||
128 | /** | 130 | /** |
129 | * Returns the enum value to a string value of a state. | 131 | * Returns the enum value to a string value of a state. |
130 | * | 132 | * |
131 | * @param state_string | 133 | * @param state_string string to convert |
132 | * @return #ANASTASIS_BACKUP_STATE_ERROR on error | 134 | * @return ANASTASIS_BACKUP_STATE_ERROR on error |
133 | */ | 135 | */ |
134 | enum ANASTASIS_BackupState | 136 | enum ANASTASIS_BackupState |
135 | ANASTASIS_backup_state_from_string_ (const char *state_string); | 137 | ANASTASIS_backup_state_from_string_ (const char *state_string); |
@@ -138,7 +140,7 @@ ANASTASIS_backup_state_from_string_ (const char *state_string); | |||
138 | /** | 140 | /** |
139 | * Returns the string value of a state. | 141 | * Returns the string value of a state. |
140 | * | 142 | * |
141 | * @param state_string | 143 | * @param bs state to convert to a string |
142 | * @return NULL on error | 144 | * @return NULL on error |
143 | */ | 145 | */ |
144 | const char * | 146 | const char * |
@@ -148,8 +150,8 @@ ANASTASIS_backup_state_to_string_ (enum ANASTASIS_BackupState bs); | |||
148 | /** | 150 | /** |
149 | * Returns the enum value to a string value of a state. | 151 | * Returns the enum value to a string value of a state. |
150 | * | 152 | * |
151 | * @param state_string | 153 | * @param state_string value to convert |
152 | * @return XXX on error | 154 | * @return ANASTASIS_RECOVERY_STATE_ERROR on error |
153 | */ | 155 | */ |
154 | enum ANASTASIS_RecoveryState | 156 | enum ANASTASIS_RecoveryState |
155 | ANASTASIS_recovery_state_from_string_ (const char *state_string); | 157 | ANASTASIS_recovery_state_from_string_ (const char *state_string); |
@@ -158,7 +160,7 @@ ANASTASIS_recovery_state_from_string_ (const char *state_string); | |||
158 | /** | 160 | /** |
159 | * Returns the string value of a state. | 161 | * Returns the string value of a state. |
160 | * | 162 | * |
161 | * @param state_string | 163 | * @param rs value to convert |
162 | * @return NULL on error | 164 | * @return NULL on error |
163 | */ | 165 | */ |
164 | const char * | 166 | const char * |
@@ -205,7 +207,7 @@ ANASTASIS_add_provider_ (json_t *state, | |||
205 | * imports it into @a state. If not, queries the provider, | 207 | * imports it into @a state. If not, queries the provider, |
206 | * generating a success or failure outcome asynchronously. | 208 | * generating a success or failure outcome asynchronously. |
207 | * | 209 | * |
208 | * @param cr the config request | 210 | * @param url the provider's base URL to add |
209 | * @param[in,out] state the json state to operate on | 211 | * @param[in,out] state the json state to operate on |
210 | * @param cb callback to call during/after operation | 212 | * @param cb callback to call during/after operation |
211 | * @param cb_cls callback closure | 213 | * @param cb_cls callback closure |
@@ -223,10 +225,10 @@ ANASTASIS_REDUX_add_provider_to_state_ (const char *url, | |||
223 | * A generic DispatchHandler/Callback function which is called for a | 225 | * A generic DispatchHandler/Callback function which is called for a |
224 | * "back" action. | 226 | * "back" action. |
225 | * | 227 | * |
226 | * @param state state to operate on | 228 | * @param[in,out] state state to operate on |
227 | * @param arguments arguments to use for operation on state | 229 | * @param arguments arguments to use for operation on state |
228 | * @param cb callback to call during/after operation | 230 | * @param cb callback to call during/after operation |
229 | * @param cb_cls callback closure | 231 | * @param cb_cls callback closure for @a cb |
230 | * @return NULL (no asynchronous action) | 232 | * @return NULL (no asynchronous action) |
231 | */ | 233 | */ |
232 | struct ANASTASIS_ReduxAction * | 234 | struct ANASTASIS_ReduxAction * |
@@ -240,19 +242,17 @@ ANASTASIS_back_generic_decrement_ (json_t *state, | |||
240 | * Function to load json containing all countries. | 242 | * Function to load json containing all countries. |
241 | * Returns the countries. | 243 | * Returns the countries. |
242 | * | 244 | * |
243 | * @return json_t * | 245 | * @return list of countries |
244 | */ | 246 | */ |
245 | const json_t * | 247 | const json_t * |
246 | ANASTASIS_redux_countries_init_ (void); | 248 | ANASTASIS_redux_countries_init_ (void); |
247 | 249 | ||
248 | 250 | ||
249 | /** | 251 | /** |
250 | * Operates on a recovery state depending on given #ANASTASIS_RecoveryState | 252 | * Operates on a recovery state. The new state is returned |
251 | * and #ANASTASIS_RecoveryAction. The new #ANASTASIS_RecoveryState is returned | ||
252 | * by a callback function. | 253 | * by a callback function. |
253 | * This function can do network access to talk to anastasis service providers. | 254 | * This function can do network access to talk to anastasis service providers. |
254 | * | 255 | * |
255 | * @param ctx the CURL context used to connect to the backend | ||
256 | * @param[in,out] state input/output state (to be modified) | 256 | * @param[in,out] state input/output state (to be modified) |
257 | * @param action what action to perform | 257 | * @param action what action to perform |
258 | * @param arguments data for the @a action | 258 | * @param arguments data for the @a action |
@@ -276,8 +276,9 @@ ANASTASIS_recovery_action_ (json_t *state, | |||
276 | * Returns an #ANASTASIS_ReduxAction. | 276 | * Returns an #ANASTASIS_ReduxAction. |
277 | * | 277 | * |
278 | * @param state state to operate on | 278 | * @param state state to operate on |
279 | * @param arguments data for the operation | ||
279 | * @param cb callback to call during/after operation | 280 | * @param cb callback to call during/after operation |
280 | * @param cb_cls callback closure | 281 | * @param cb_cls callback closure for @a cb |
281 | * @return NULL | 282 | * @return NULL |
282 | */ | 283 | */ |
283 | struct ANASTASIS_ReduxAction * | 284 | struct ANASTASIS_ReduxAction * |
@@ -293,9 +294,10 @@ ANASTASIS_REDUX_recovery_challenge_begin_ (json_t *state, | |||
293 | * arguments provided were OK and the state transition was | 294 | * arguments provided were OK and the state transition was |
294 | * initiated. Begins the actual backup logic. | 295 | * initiated. Begins the actual backup logic. |
295 | * | 296 | * |
296 | * Returns an #ANASTASIS_ReduxAction. | 297 | * Returns a `struct ANASTASIS_ReduxAction`. |
297 | * | 298 | * |
298 | * @param state state to operate on | 299 | * @param state state to operate on |
300 | * @param arguments data for the operation | ||
299 | * @param cb callback to call during/after operation | 301 | * @param cb callback to call during/after operation |
300 | * @param cb_cls callback closure | 302 | * @param cb_cls callback closure |
301 | */ | 303 | */ |
@@ -307,12 +309,10 @@ ANASTASIS_REDUX_backup_begin_ (json_t *state, | |||
307 | 309 | ||
308 | 310 | ||
309 | /** | 311 | /** |
310 | * Operates on a backup state depending on given #ANASTASIS_BackupState | 312 | * Operates on a backup state and returns the new state via a |
311 | * and #ANASTASIS_BackupAction. The new #ANASTASIS_BackupState is returned | 313 | * callback function. |
312 | * by a callback function. | ||
313 | * This function can do network access to talk to anastasis service providers. | 314 | * This function can do network access to talk to anastasis service providers. |
314 | * | 315 | * |
315 | * @param ctx the CURL context used to connect to the backend | ||
316 | * @param[in,out] state input/output state (to be modified) | 316 | * @param[in,out] state input/output state (to be modified) |
317 | * @param action what action to perform | 317 | * @param action what action to perform |
318 | * @param arguments data for the @a action | 318 | * @param arguments data for the @a action |
diff --git a/src/reducer/validation_CH_AHV.c b/src/reducer/validation_CH_AHV.c index 5bf6fb3..5f852ad 100644 --- a/src/reducer/validation_CH_AHV.c +++ b/src/reducer/validation_CH_AHV.c | |||
@@ -26,7 +26,7 @@ | |||
26 | /** | 26 | /** |
27 | * Function to validate a Swiss AHV number. | 27 | * Function to validate a Swiss AHV number. |
28 | * | 28 | * |
29 | * @param avh_number ahv number to validate (input) | 29 | * @param ahv_number ahv number to validate (input) |
30 | * @return true if validation passed, else false | 30 | * @return true if validation passed, else false |
31 | */ | 31 | */ |
32 | bool | 32 | bool |
diff --git a/src/reducer/validation_DE_SVN.c b/src/reducer/validation_DE_SVN.c index 0bfe02e..81faf43 100644 --- a/src/reducer/validation_DE_SVN.c +++ b/src/reducer/validation_DE_SVN.c | |||
@@ -47,7 +47,7 @@ q (unsigned int v) | |||
47 | * and https://de.wikipedia.org/wiki/Versicherungsnummer | 47 | * and https://de.wikipedia.org/wiki/Versicherungsnummer |
48 | * for the structure! | 48 | * for the structure! |
49 | * | 49 | * |
50 | * @param avh_number ahv number to validate (input) | 50 | * @param ssn_number social security number to validate (input) |
51 | * @return true if validation passed, else false | 51 | * @return true if validation passed, else false |
52 | */ | 52 | */ |
53 | bool | 53 | bool |
diff --git a/src/reducer/validation_IN_AADHAR.c b/src/reducer/validation_IN_AADHAR.c index ee38f3f..8ce2bc2 100644 --- a/src/reducer/validation_IN_AADHAR.c +++ b/src/reducer/validation_IN_AADHAR.c | |||
@@ -58,7 +58,7 @@ static int p[10][10] = { | |||
58 | * Converts a string to a reversed integer array. | 58 | * Converts a string to a reversed integer array. |
59 | * | 59 | * |
60 | * @param input The numeric string data converted to reversed int array. | 60 | * @param input The numeric string data converted to reversed int array. |
61 | * @param[out] Integer array containing the digits in the numeric string | 61 | * @param[out] output array containing the digits in the numeric string |
62 | * in reverse order | 62 | * in reverse order |
63 | */ | 63 | */ |
64 | static bool | 64 | static bool |
diff --git a/src/testing/testing_api_cmd_config.c b/src/testing/testing_api_cmd_config.c index 7ff42c9..cf6979c 100644 --- a/src/testing/testing_api_cmd_config.c +++ b/src/testing/testing_api_cmd_config.c | |||
@@ -14,12 +14,11 @@ | |||
14 | TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> | 14 | TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> |
15 | */ | 15 | */ |
16 | /** | 16 | /** |
17 | * @file testing/testing_api_cmd_config.c | 17 | * @file anastasis/src/testing/testing_api_cmd_config.c |
18 | * @brief command to obtain the configuration of an anastasis backend service. | 18 | * @brief command to obtain the configuration of an anastasis backend service. |
19 | * @author Dennis Neufeld | 19 | * @author Dennis Neufeld |
20 | * @author Dominik Meister | 20 | * @author Dominik Meister |
21 | */ | 21 | */ |
22 | |||
23 | #include "platform.h" | 22 | #include "platform.h" |
24 | #include "anastasis_testing_lib.h" | 23 | #include "anastasis_testing_lib.h" |
25 | #include <taler/taler_util.h> | 24 | #include <taler/taler_util.h> |
@@ -59,7 +58,7 @@ struct ConfigState | |||
59 | 58 | ||
60 | 59 | ||
61 | /** | 60 | /** |
62 | * Function called with the results of a #ANASTASIS_config(). | 61 | * Function called with the results of a #ANASTASIS_get_config(). |
63 | * | 62 | * |
64 | * @param cls closure | 63 | * @param cls closure |
65 | * @param http_status HTTP status of the request | 64 | * @param http_status HTTP status of the request |
@@ -156,7 +155,7 @@ config_cleanup (void *cls, | |||
156 | * Offer internal data to other commands. | 155 | * Offer internal data to other commands. |
157 | * | 156 | * |
158 | * @param cls closure | 157 | * @param cls closure |
159 | * @param ret[out] result (could be anything) | 158 | * @param[out] ret result (could be anything) |
160 | * @param trait name of the trait | 159 | * @param trait name of the trait |
161 | * @param index index number of the object to extract. | 160 | * @param index index number of the object to extract. |
162 | * @return #GNUNET_OK on success | 161 | * @return #GNUNET_OK on success |
diff --git a/src/testing/testing_api_cmd_keyshare_lookup.c b/src/testing/testing_api_cmd_keyshare_lookup.c index efc8c9a..45e1e26 100644 --- a/src/testing/testing_api_cmd_keyshare_lookup.c +++ b/src/testing/testing_api_cmd_keyshare_lookup.c | |||
@@ -14,7 +14,7 @@ | |||
14 | Anastasis; see the file COPYING.GPL. If not, see <http://www.gnu.org/licenses/> | 14 | Anastasis; see the file COPYING.GPL. If not, see <http://www.gnu.org/licenses/> |
15 | */ | 15 | */ |
16 | /** | 16 | /** |
17 | * @file testing/anastasis_api_keyshare_lookup.c | 17 | * @file testing/testing_api_cmd_keyshare_lookup.c |
18 | * @brief Testing of Implementation of the /truth GET | 18 | * @brief Testing of Implementation of the /truth GET |
19 | * @author Christian Grothoff | 19 | * @author Christian Grothoff |
20 | * @author Dennis Neufeld | 20 | * @author Dennis Neufeld |
diff --git a/src/testing/testing_api_cmd_policy_lookup.c b/src/testing/testing_api_cmd_policy_lookup.c index 0906491..6608d90 100644 --- a/src/testing/testing_api_cmd_policy_lookup.c +++ b/src/testing/testing_api_cmd_policy_lookup.c | |||
@@ -69,11 +69,11 @@ struct PolicyLookupState | |||
69 | 69 | ||
70 | 70 | ||
71 | /** | 71 | /** |
72 | * Function called with the results of a #ANASTASIS_lookup(). | 72 | * Function called with the results of a #ANASTASIS_policy_lookup(). |
73 | * | 73 | * |
74 | * @param cls closure | 74 | * @param cls closure |
75 | * @param http_status HTTP status of the request | 75 | * @param http_status HTTP status of the request |
76 | * @param ud details about the lookup operation | 76 | * @param dd details about the lookup operation |
77 | */ | 77 | */ |
78 | static void | 78 | static void |
79 | policy_lookup_cb (void *cls, | 79 | policy_lookup_cb (void *cls, |
@@ -197,16 +197,6 @@ policy_lookup_cleanup (void *cls, | |||
197 | } | 197 | } |
198 | 198 | ||
199 | 199 | ||
200 | /** | ||
201 | * Make the "policy lookup" command. | ||
202 | * | ||
203 | * @param label command label | ||
204 | * @param anastasis_url base URL of the ANASTASIS serving | ||
205 | * the policy store request. | ||
206 | * @param http_status expected HTTP status. | ||
207 | * @param upload_ref reference to upload command | ||
208 | * @return the command | ||
209 | */ | ||
210 | struct TALER_TESTING_Command | 200 | struct TALER_TESTING_Command |
211 | ANASTASIS_TESTING_cmd_policy_lookup (const char *label, | 201 | ANASTASIS_TESTING_cmd_policy_lookup (const char *label, |
212 | const char *anastasis_url, | 202 | const char *anastasis_url, |
@@ -233,14 +223,6 @@ ANASTASIS_TESTING_cmd_policy_lookup (const char *label, | |||
233 | } | 223 | } |
234 | 224 | ||
235 | 225 | ||
236 | /** | ||
237 | * Make the "policy lookup" command for a non-existent upload. | ||
238 | * | ||
239 | * @param label command label | ||
240 | * @param anastasis_url base URL of the ANASTASIS serving | ||
241 | * the policy lookup request. | ||
242 | * @return the command | ||
243 | */ | ||
244 | struct TALER_TESTING_Command | 226 | struct TALER_TESTING_Command |
245 | ANASTASIS_TESTING_cmd_policy_nx (const char *label, | 227 | ANASTASIS_TESTING_cmd_policy_nx (const char *label, |
246 | const char *anastasis_url) | 228 | const char *anastasis_url) |
diff --git a/src/testing/testing_api_cmd_policy_store.c b/src/testing/testing_api_cmd_policy_store.c index d5062c0..9f4a80a 100644 --- a/src/testing/testing_api_cmd_policy_store.c +++ b/src/testing/testing_api_cmd_policy_store.c | |||
@@ -125,10 +125,9 @@ struct PolicyStoreState | |||
125 | }; | 125 | }; |
126 | 126 | ||
127 | /** | 127 | /** |
128 | * Function called with the results of a #policy_store(). | 128 | * Function called with the results of an #ANASTASIS_policy_store() operation. |
129 | * | 129 | * |
130 | * @param cls closure | 130 | * @param cls closure |
131 | * @param http_status HTTP status of the request | ||
132 | * @param ud details about the upload operation | 131 | * @param ud details about the upload operation |
133 | */ | 132 | */ |
134 | static void | 133 | static void |
diff --git a/src/testing/testing_api_cmd_truth_store.c b/src/testing/testing_api_cmd_truth_store.c index 40c4d32..816a285 100644 --- a/src/testing/testing_api_cmd_truth_store.c +++ b/src/testing/testing_api_cmd_truth_store.c | |||
@@ -112,11 +112,10 @@ struct TruthStoreState | |||
112 | }; | 112 | }; |
113 | 113 | ||
114 | /** | 114 | /** |
115 | * Function called with the results of a #truth_store(). | 115 | * Function called with the results of an #ANASTASIS_truth_store() |
116 | * operation. | ||
116 | * | 117 | * |
117 | * @param cls closure | 118 | * @param cls closure |
118 | * @param ec ANASTASIS error code | ||
119 | * @param http_status HTTP status of the request | ||
120 | * @param ud details about the upload operation | 119 | * @param ud details about the upload operation |
121 | */ | 120 | */ |
122 | static void | 121 | static void |
diff --git a/src/testing/testing_api_helpers.c b/src/testing/testing_api_helpers.c index fb3cb48..e64f506 100644 --- a/src/testing/testing_api_helpers.c +++ b/src/testing/testing_api_helpers.c | |||
@@ -18,7 +18,7 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | /** | 20 | /** |
21 | * @file testing/testing_api_helpers.c | 21 | * @file anastasis/src/testing/testing_api_helpers.c |
22 | * @brief helper functions for test library. | 22 | * @brief helper functions for test library. |
23 | * @author Christian Grothoff | 23 | * @author Christian Grothoff |
24 | * @author Marcello Stanisci | 24 | * @author Marcello Stanisci |
diff --git a/src/testing/testing_api_trait_account_priv.c b/src/testing/testing_api_trait_account_priv.c index a40e9d2..a666f7a 100644 --- a/src/testing/testing_api_trait_account_priv.c +++ b/src/testing/testing_api_trait_account_priv.c | |||
@@ -27,17 +27,9 @@ | |||
27 | #define ANASTASIS_TESTING_TRAIT_ACCOUNT_PRIV "anastasis-account_priv" | 27 | #define ANASTASIS_TESTING_TRAIT_ACCOUNT_PRIV "anastasis-account_priv" |
28 | 28 | ||
29 | 29 | ||
30 | /** | ||
31 | * Obtain an account private key from @a cmd. | ||
32 | * | ||
33 | * @param cmd command to extract the private key from. | ||
34 | * @param index the private key's index number. | ||
35 | * @param n[out] set to the private key coming from @a cmd. | ||
36 | * @return #GNUNET_OK on success. | ||
37 | */ | ||
38 | int | 30 | int |
39 | ANASTASIS_TESTING_get_trait_account_priv | 31 | ANASTASIS_TESTING_get_trait_account_priv ( |
40 | (const struct TALER_TESTING_Command *cmd, | 32 | const struct TALER_TESTING_Command *cmd, |
41 | unsigned int index, | 33 | unsigned int index, |
42 | const struct ANASTASIS_CRYPTO_AccountPrivateKeyP **priv) | 34 | const struct ANASTASIS_CRYPTO_AccountPrivateKeyP **priv) |
43 | { | 35 | { |
@@ -48,16 +40,9 @@ ANASTASIS_TESTING_get_trait_account_priv | |||
48 | } | 40 | } |
49 | 41 | ||
50 | 42 | ||
51 | /** | ||
52 | * Offer an account private key. | ||
53 | * | ||
54 | * @param index usually zero | ||
55 | * @param priv the account_priv to offer. | ||
56 | * @return #GNUNET_OK on success. | ||
57 | */ | ||
58 | struct TALER_TESTING_Trait | 43 | struct TALER_TESTING_Trait |
59 | ANASTASIS_TESTING_make_trait_account_priv | 44 | ANASTASIS_TESTING_make_trait_account_priv ( |
60 | (unsigned int index, | 45 | unsigned int index, |
61 | const struct ANASTASIS_CRYPTO_AccountPrivateKeyP *priv) | 46 | const struct ANASTASIS_CRYPTO_AccountPrivateKeyP *priv) |
62 | { | 47 | { |
63 | struct TALER_TESTING_Trait ret = { | 48 | struct TALER_TESTING_Trait ret = { |
@@ -65,6 +50,7 @@ ANASTASIS_TESTING_make_trait_account_priv | |||
65 | .trait_name = ANASTASIS_TESTING_TRAIT_ACCOUNT_PRIV, | 50 | .trait_name = ANASTASIS_TESTING_TRAIT_ACCOUNT_PRIV, |
66 | .ptr = (const void *) priv | 51 | .ptr = (const void *) priv |
67 | }; | 52 | }; |
53 | |||
68 | return ret; | 54 | return ret; |
69 | } | 55 | } |
70 | 56 | ||
diff --git a/src/testing/testing_api_trait_account_pub.c b/src/testing/testing_api_trait_account_pub.c index 19ba79f..9a6a45a 100644 --- a/src/testing/testing_api_trait_account_pub.c +++ b/src/testing/testing_api_trait_account_pub.c | |||
@@ -27,17 +27,9 @@ | |||
27 | #define ANASTASIS_TESTING_TRAIT_ACCOUNT_PUB "anastasis-account_pub" | 27 | #define ANASTASIS_TESTING_TRAIT_ACCOUNT_PUB "anastasis-account_pub" |
28 | 28 | ||
29 | 29 | ||
30 | /** | ||
31 | * Obtain an account public key from @a cmd. | ||
32 | * | ||
33 | * @param cmd command to extract the public key from. | ||
34 | * @param index the public key's index number. | ||
35 | * @param n[out] set to the public key coming from @a cmd. | ||
36 | * @return #GNUNET_OK on success. | ||
37 | */ | ||
38 | int | 30 | int |
39 | ANASTASIS_TESTING_get_trait_account_pub | 31 | ANASTASIS_TESTING_get_trait_account_pub ( |
40 | (const struct TALER_TESTING_Command *cmd, | 32 | const struct TALER_TESTING_Command *cmd, |
41 | unsigned int index, | 33 | unsigned int index, |
42 | const struct ANASTASIS_CRYPTO_AccountPublicKeyP **pub) | 34 | const struct ANASTASIS_CRYPTO_AccountPublicKeyP **pub) |
43 | { | 35 | { |
@@ -48,16 +40,9 @@ ANASTASIS_TESTING_get_trait_account_pub | |||
48 | } | 40 | } |
49 | 41 | ||
50 | 42 | ||
51 | /** | ||
52 | * Offer an account public key. | ||
53 | * | ||
54 | * @param index usually zero | ||
55 | * @param h the account_pub to offer. | ||
56 | * @return #GNUNET_OK on success. | ||
57 | */ | ||
58 | struct TALER_TESTING_Trait | 43 | struct TALER_TESTING_Trait |
59 | ANASTASIS_TESTING_make_trait_account_pub | 44 | ANASTASIS_TESTING_make_trait_account_pub ( |
60 | (unsigned int index, | 45 | unsigned int index, |
61 | const struct ANASTASIS_CRYPTO_AccountPublicKeyP *h) | 46 | const struct ANASTASIS_CRYPTO_AccountPublicKeyP *h) |
62 | { | 47 | { |
63 | struct TALER_TESTING_Trait ret = { | 48 | struct TALER_TESTING_Trait ret = { |
@@ -65,6 +50,7 @@ ANASTASIS_TESTING_make_trait_account_pub | |||
65 | .trait_name = ANASTASIS_TESTING_TRAIT_ACCOUNT_PUB, | 50 | .trait_name = ANASTASIS_TESTING_TRAIT_ACCOUNT_PUB, |
66 | .ptr = (const void *) h | 51 | .ptr = (const void *) h |
67 | }; | 52 | }; |
53 | |||
68 | return ret; | 54 | return ret; |
69 | } | 55 | } |
70 | 56 | ||
diff --git a/src/testing/testing_api_trait_code.c b/src/testing/testing_api_trait_code.c index 9989dec..5892065 100644 --- a/src/testing/testing_api_trait_code.c +++ b/src/testing/testing_api_trait_code.c | |||
@@ -17,7 +17,7 @@ | |||
17 | <http://www.gnu.org/licenses/> | 17 | <http://www.gnu.org/licenses/> |
18 | */ | 18 | */ |
19 | /** | 19 | /** |
20 | * @file testing/testing_api_trait_string.c | 20 | * @file testing/testing_api_trait_code.c |
21 | * @brief traits to offers a code for a challenge | 21 | * @brief traits to offers a code for a challenge |
22 | * @author Dominik Meister | 22 | * @author Dominik Meister |
23 | * @author Christian Grothoff | 23 | * @author Christian Grothoff |
@@ -28,17 +28,9 @@ | |||
28 | #define ANASTASIS_TESTING_TRAIT_CODE "anastasis-code" | 28 | #define ANASTASIS_TESTING_TRAIT_CODE "anastasis-code" |
29 | 29 | ||
30 | 30 | ||
31 | /** | ||
32 | * Obtain a code from @a cmd. | ||
33 | * | ||
34 | * @param cmd command to extract the number from. | ||
35 | * @param index the number's index number. | ||
36 | * @param n[out] set to the number coming from @a cmd. | ||
37 | * @return #GNUNET_OK on success. | ||
38 | */ | ||
39 | int | 31 | int |
40 | ANASTASIS_TESTING_get_trait_code | 32 | ANASTASIS_TESTING_get_trait_code ( |
41 | (const struct TALER_TESTING_Command *cmd, | 33 | const struct TALER_TESTING_Command *cmd, |
42 | unsigned int index, | 34 | unsigned int index, |
43 | const char **code) | 35 | const char **code) |
44 | { | 36 | { |
@@ -49,16 +41,9 @@ ANASTASIS_TESTING_get_trait_code | |||
49 | } | 41 | } |
50 | 42 | ||
51 | 43 | ||
52 | /** | ||
53 | * Offer a code. | ||
54 | * | ||
55 | * @param index the number's index number. | ||
56 | * @param code the code to offer. | ||
57 | * @return #GNUNET_OK on success. | ||
58 | */ | ||
59 | struct TALER_TESTING_Trait | 44 | struct TALER_TESTING_Trait |
60 | ANASTASIS_TESTING_make_trait_code | 45 | ANASTASIS_TESTING_make_trait_code ( |
61 | (unsigned int index, | 46 | unsigned int index, |
62 | const char *code) | 47 | const char *code) |
63 | { | 48 | { |
64 | struct TALER_TESTING_Trait ret = { | 49 | struct TALER_TESTING_Trait ret = { |
@@ -66,8 +51,9 @@ ANASTASIS_TESTING_make_trait_code | |||
66 | .trait_name = ANASTASIS_TESTING_TRAIT_CODE, | 51 | .trait_name = ANASTASIS_TESTING_TRAIT_CODE, |
67 | .ptr = (const void *) code | 52 | .ptr = (const void *) code |
68 | }; | 53 | }; |
54 | |||
69 | return ret; | 55 | return ret; |
70 | } | 56 | } |
71 | 57 | ||
72 | 58 | ||
73 | /* end of testing_api_trait_string.c */ | 59 | /* end of testing_api_trait_code.c */ |
diff --git a/src/testing/testing_api_trait_eks.c b/src/testing/testing_api_trait_eks.c index f374433..1c19233 100644 --- a/src/testing/testing_api_trait_eks.c +++ b/src/testing/testing_api_trait_eks.c | |||
@@ -29,8 +29,8 @@ | |||
29 | 29 | ||
30 | 30 | ||
31 | int | 31 | int |
32 | ANASTASIS_TESTING_get_trait_eks | 32 | ANASTASIS_TESTING_get_trait_eks ( |
33 | (const struct TALER_TESTING_Command *cmd, | 33 | const struct TALER_TESTING_Command *cmd, |
34 | unsigned int index, | 34 | unsigned int index, |
35 | const struct ANASTASIS_CRYPTO_EncryptedKeyShareP **eks) | 35 | const struct ANASTASIS_CRYPTO_EncryptedKeyShareP **eks) |
36 | { | 36 | { |
@@ -42,8 +42,8 @@ ANASTASIS_TESTING_get_trait_eks | |||
42 | 42 | ||
43 | 43 | ||
44 | struct TALER_TESTING_Trait | 44 | struct TALER_TESTING_Trait |
45 | ANASTASIS_TESTING_make_trait_eks | 45 | ANASTASIS_TESTING_make_trait_eks ( |
46 | (unsigned int index, | 46 | unsigned int index, |
47 | const struct ANASTASIS_CRYPTO_EncryptedKeyShareP *eks) | 47 | const struct ANASTASIS_CRYPTO_EncryptedKeyShareP *eks) |
48 | { | 48 | { |
49 | struct TALER_TESTING_Trait ret = { | 49 | struct TALER_TESTING_Trait ret = { |
diff --git a/src/testing/testing_api_trait_hash.c b/src/testing/testing_api_trait_hash.c index fb5015e..5f3a1a0 100644 --- a/src/testing/testing_api_trait_hash.c +++ b/src/testing/testing_api_trait_hash.c | |||
@@ -17,7 +17,7 @@ | |||
17 | <http://www.gnu.org/licenses/> | 17 | <http://www.gnu.org/licenses/> |
18 | */ | 18 | */ |
19 | /** | 19 | /** |
20 | * @file testing/testing_api_trait_hash.c | 20 | * @file anastasis/src/testing/testing_api_trait_hash.c |
21 | * @brief traits to offer a hash | 21 | * @brief traits to offer a hash |
22 | * @author Christian Grothoff | 22 | * @author Christian Grothoff |
23 | */ | 23 | */ |