aboutsummaryrefslogtreecommitdiff
path: root/src/identity-provider/plugin_rest_identity_provider.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/identity-provider/plugin_rest_identity_provider.c')
-rw-r--r--src/identity-provider/plugin_rest_identity_provider.c38
1 files changed, 16 insertions, 22 deletions
diff --git a/src/identity-provider/plugin_rest_identity_provider.c b/src/identity-provider/plugin_rest_identity_provider.c
index 3a6151682..b104950ba 100644
--- a/src/identity-provider/plugin_rest_identity_provider.c
+++ b/src/identity-provider/plugin_rest_identity_provider.c
@@ -150,12 +150,12 @@ struct EgoEntry
150 * DLL 150 * DLL
151 */ 151 */
152 struct EgoEntry *next; 152 struct EgoEntry *next;
153 153
154 /** 154 /**
155 * DLL 155 * DLL
156 */ 156 */
157 struct EgoEntry *prev; 157 struct EgoEntry *prev;
158 158
159 /** 159 /**
160 * Ego Identifier 160 * Ego Identifier
161 */ 161 */
@@ -165,7 +165,7 @@ struct EgoEntry
165 * Public key string 165 * Public key string
166 */ 166 */
167 char *keystring; 167 char *keystring;
168 168
169 /** 169 /**
170 * The Ego 170 * The Ego
171 */ 171 */
@@ -189,7 +189,7 @@ struct RequestHandle
189 * Selected ego 189 * Selected ego
190 */ 190 */
191 struct EgoEntry *ego_entry; 191 struct EgoEntry *ego_entry;
192 192
193 /** 193 /**
194 * Ptr to current ego private key 194 * Ptr to current ego private key
195 */ 195 */
@@ -199,7 +199,7 @@ struct RequestHandle
199 * Handle to the rest connection 199 * Handle to the rest connection
200 */ 200 */
201 struct RestConnectionDataHandle *conndata_handle; 201 struct RestConnectionDataHandle *conndata_handle;
202 202
203 /** 203 /**
204 * The processing state 204 * The processing state
205 */ 205 */
@@ -248,8 +248,8 @@ struct RequestHandle
248 /** 248 /**
249 * ID of a task associated with the resolution process. 249 * ID of a task associated with the resolution process.
250 */ 250 */
251 struct GNUNET_SCHEDULER_Task * timeout_task; 251 struct GNUNET_SCHEDULER_Task * timeout_task;
252 252
253 /** 253 /**
254 * The plugin result processor 254 * The plugin result processor
255 */ 255 */
@@ -289,7 +289,7 @@ cleanup_handle (struct RequestHandle *handle)
289 struct EgoEntry *ego_tmp; 289 struct EgoEntry *ego_tmp;
290 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 290 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
291 "Cleaning up\n"); 291 "Cleaning up\n");
292 if (NULL != handle->resp_object) 292 if (NULL != handle->resp_object)
293 GNUNET_REST_jsonapi_object_delete (handle->resp_object); 293 GNUNET_REST_jsonapi_object_delete (handle->resp_object);
294 if (NULL != handle->timeout_task) 294 if (NULL != handle->timeout_task)
295 GNUNET_SCHEDULER_cancel (handle->timeout_task); 295 GNUNET_SCHEDULER_cancel (handle->timeout_task);
@@ -324,11 +324,9 @@ cleanup_handle (struct RequestHandle *handle)
324 * Task run on shutdown. Cleans up everything. 324 * Task run on shutdown. Cleans up everything.
325 * 325 *
326 * @param cls unused 326 * @param cls unused
327 * @param tc scheduler context
328 */ 327 */
329static void 328static void
330do_error (void *cls, 329do_error (void *cls)
331 const struct GNUNET_SCHEDULER_TaskContext *tc)
332{ 330{
333 struct RequestHandle *handle = cls; 331 struct RequestHandle *handle = cls;
334 struct MHD_Response *resp; 332 struct MHD_Response *resp;
@@ -347,11 +345,9 @@ do_error (void *cls,
347 * Task run on shutdown. Cleans up everything. 345 * Task run on shutdown. Cleans up everything.
348 * 346 *
349 * @param cls unused 347 * @param cls unused
350 * @param tc scheduler context
351 */ 348 */
352static void 349static void
353do_cleanup_handle_delayed (void *cls, 350do_cleanup_handle_delayed (void *cls)
354 const struct GNUNET_SCHEDULER_TaskContext *tc)
355{ 351{
356 struct RequestHandle *handle = cls; 352 struct RequestHandle *handle = cls;
357 cleanup_handle(handle); 353 cleanup_handle(handle);
@@ -377,7 +373,7 @@ token_creat_cont (void *cls,
377 char *ticket_str; 373 char *ticket_str;
378 char *token_str; 374 char *token_str;
379 char *result_str; 375 char *result_str;
380 376
381 if (NULL == ticket) 377 if (NULL == ticket)
382 { 378 {
383 handle->emsg = GNUNET_strdup ("Error in token issue"); 379 handle->emsg = GNUNET_strdup ("Error in token issue");
@@ -536,7 +532,7 @@ issue_token_cont (struct RestConnectionDataHandle *con,
536 &aud_key, 532 &aud_key,
537 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey)); 533 sizeof (struct GNUNET_CRYPTO_EcdsaPublicKey));
538 534
539 //Remote nonce 535 //Remote nonce
540 nonce_str = NULL; 536 nonce_str = NULL;
541 GNUNET_CRYPTO_hash (GNUNET_IDENTITY_TOKEN_REQUEST_NONCE, 537 GNUNET_CRYPTO_hash (GNUNET_IDENTITY_TOKEN_REQUEST_NONCE,
542 strlen (GNUNET_IDENTITY_TOKEN_REQUEST_NONCE), 538 strlen (GNUNET_IDENTITY_TOKEN_REQUEST_NONCE),
@@ -600,11 +596,9 @@ issue_token_cont (struct RestConnectionDataHandle *con,
600 * Build a GNUid token for identity 596 * Build a GNUid token for identity
601 * 597 *
602 * @param cls the request handle 598 * @param cls the request handle
603 * @param tc task context
604 */ 599 */
605static void 600static void
606return_token_list (void *cls, 601return_token_list (void *cls)
607 const struct GNUNET_SCHEDULER_TaskContext *tc)
608{ 602{
609 char* result_str; 603 char* result_str;
610 struct RequestHandle *handle = cls; 604 struct RequestHandle *handle = cls;
@@ -784,7 +778,7 @@ exchange_cont (void *cls,
784 char* token_str; 778 char* token_str;
785 char* nonce_str; 779 char* nonce_str;
786 uint64_t expected_nonce; 780 uint64_t expected_nonce;
787 781
788 //Get nonce 782 //Get nonce
789 GNUNET_CRYPTO_hash (GNUNET_REST_JSONAPI_IDENTITY_PROVIDER_EXPECTED_NONCE, 783 GNUNET_CRYPTO_hash (GNUNET_REST_JSONAPI_IDENTITY_PROVIDER_EXPECTED_NONCE,
790 strlen (GNUNET_REST_JSONAPI_IDENTITY_PROVIDER_EXPECTED_NONCE), 784 strlen (GNUNET_REST_JSONAPI_IDENTITY_PROVIDER_EXPECTED_NONCE),
@@ -823,7 +817,7 @@ exchange_cont (void *cls,
823 GNUNET_free (result); 817 GNUNET_free (result);
824 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK); 818 handle->proc (handle->proc_cls, resp, MHD_HTTP_OK);
825 cleanup_handle (handle); 819 cleanup_handle (handle);
826 json_decref (root); 820 json_decref (root);
827} 821}
828 822
829 823
@@ -1010,7 +1004,7 @@ list_ego (void *cls,
1010 if (ID_REST_STATE_INIT == handle->state) { 1004 if (ID_REST_STATE_INIT == handle->state) {
1011 ego_entry = GNUNET_new (struct EgoEntry); 1005 ego_entry = GNUNET_new (struct EgoEntry);
1012 GNUNET_IDENTITY_ego_get_public_key (ego, &pk); 1006 GNUNET_IDENTITY_ego_get_public_key (ego, &pk);
1013 ego_entry->keystring = 1007 ego_entry->keystring =
1014 GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); 1008 GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk);
1015 ego_entry->ego = ego; 1009 ego_entry->ego = ego;
1016 GNUNET_asprintf (&ego_entry->identifier, "%s", identifier); 1010 GNUNET_asprintf (&ego_entry->identifier, "%s", identifier);