aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim/plugin_rest_openid_connect.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/reclaim/plugin_rest_openid_connect.c')
-rw-r--r--src/reclaim/plugin_rest_openid_connect.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/reclaim/plugin_rest_openid_connect.c b/src/reclaim/plugin_rest_openid_connect.c
index fef79fb10..88b928526 100644
--- a/src/reclaim/plugin_rest_openid_connect.c
+++ b/src/reclaim/plugin_rest_openid_connect.c
@@ -551,7 +551,7 @@ struct RequestHandle
551 char *edesc; 551 char *edesc;
552 552
553 /** 553 /**
554 * Reponse code 554 * Response code
555 */ 555 */
556 int response_code; 556 int response_code;
557 557
@@ -974,7 +974,8 @@ oidc_iteration_error (void *cls)
974static void 974static void
975oidc_ticket_issue_cb (void *cls, 975oidc_ticket_issue_cb (void *cls,
976 const struct GNUNET_RECLAIM_Ticket *ticket, 976 const struct GNUNET_RECLAIM_Ticket *ticket,
977 const struct GNUNET_RECLAIM_PresentationList *pres) 977 const struct
978 GNUNET_RECLAIM_PresentationList *presentation)
978{ 979{
979 struct RequestHandle *handle = cls; 980 struct RequestHandle *handle = cls;
980 struct MHD_Response *resp; 981 struct MHD_Response *resp;
@@ -997,7 +998,7 @@ oidc_ticket_issue_cb (void *cls,
997 code_string = OIDC_build_authz_code (&handle->priv_key, 998 code_string = OIDC_build_authz_code (&handle->priv_key,
998 &handle->ticket, 999 &handle->ticket,
999 handle->attr_idtoken_list, 1000 handle->attr_idtoken_list,
1000 pres, 1001 presentation,
1001 handle->oidc->nonce, 1002 handle->oidc->nonce,
1002 handle->oidc->code_challenge); 1003 handle->oidc->code_challenge);
1003 if ((NULL != handle->redirect_prefix) && (NULL != handle->redirect_suffix) && 1004 if ((NULL != handle->redirect_prefix) && (NULL != handle->redirect_suffix) &&
@@ -1103,7 +1104,7 @@ oidc_cred_collect_finished_cb (void *cls)
1103 handle->attr_userinfo_list); 1104 handle->attr_userinfo_list);
1104 for (le_m = merged_list->list_head; NULL != le_m; le_m = le_m->next) 1105 for (le_m = merged_list->list_head; NULL != le_m; le_m = le_m->next)
1105 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1106 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1106 "List Attibute in ticket to issue: %s\n", 1107 "List Attribute in ticket to issue: %s\n",
1107 le_m->attribute->name); 1108 le_m->attribute->name);
1108 handle->idp_op = GNUNET_RECLAIM_ticket_issue (idp, 1109 handle->idp_op = GNUNET_RECLAIM_ticket_issue (idp,
1109 &handle->priv_key, 1110 &handle->priv_key,
@@ -1387,7 +1388,8 @@ build_redirect (void *cls)
1387 } 1388 }
1388 resp = GNUNET_REST_create_response (""); 1389 resp = GNUNET_REST_create_response ("");
1389 GNUNET_assert (MHD_NO != MHD_add_response_header (resp, 1390 GNUNET_assert (MHD_NO != MHD_add_response_header (resp,
1390 "Location", redirect_uri)); 1391 "Location",
1392 redirect_uri));
1391 handle->proc (handle->proc_cls, resp, MHD_HTTP_FOUND); 1393 handle->proc (handle->proc_cls, resp, MHD_HTTP_FOUND);
1392 cleanup_handle (handle); 1394 cleanup_handle (handle);
1393 GNUNET_free (redirect_uri); 1395 GNUNET_free (redirect_uri);
@@ -2192,7 +2194,7 @@ token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
2192 &cache_key, 2194 &cache_key,
2193 code, 2195 code,
2194 GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE); 2196 GNUNET_CONTAINER_MULTIHASHMAPOPTION_REPLACE);
2195 /* If there was a previus code in there, free the old value */ 2197 /* If there was a previous code in there, free the old value */
2196 if (NULL != tmp_at) 2198 if (NULL != tmp_at)
2197 { 2199 {
2198 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2200 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -2231,7 +2233,7 @@ static void
2231consume_ticket (void *cls, 2233consume_ticket (void *cls,
2232 const struct GNUNET_IDENTITY_PublicKey *identity, 2234 const struct GNUNET_IDENTITY_PublicKey *identity,
2233 const struct GNUNET_RECLAIM_Attribute *attr, 2235 const struct GNUNET_RECLAIM_Attribute *attr,
2234 const struct GNUNET_RECLAIM_Presentation *pres) 2236 const struct GNUNET_RECLAIM_Presentation *presentation)
2235{ 2237{
2236 struct RequestHandle *handle = cls; 2238 struct RequestHandle *handle = cls;
2237 struct GNUNET_RECLAIM_AttributeListEntry *ale; 2239 struct GNUNET_RECLAIM_AttributeListEntry *ale;
@@ -2268,14 +2270,14 @@ consume_ticket (void *cls,
2268 GNUNET_CONTAINER_DLL_insert (handle->attr_userinfo_list->list_head, 2270 GNUNET_CONTAINER_DLL_insert (handle->attr_userinfo_list->list_head,
2269 handle->attr_userinfo_list->list_tail, 2271 handle->attr_userinfo_list->list_tail,
2270 ale); 2272 ale);
2271 if (NULL == pres) 2273 if (NULL == presentation)
2272 return; 2274 return;
2273 for (atle = handle->presentations->list_head; 2275 for (atle = handle->presentations->list_head;
2274 NULL != atle; atle = atle->next) 2276 NULL != atle; atle = atle->next)
2275 { 2277 {
2276 if (GNUNET_NO == GNUNET_RECLAIM_id_is_equal ( 2278 if (GNUNET_NO == GNUNET_RECLAIM_id_is_equal (
2277 &atle->presentation->credential_id, 2279 &atle->presentation->credential_id,
2278 &pres->credential_id)) 2280 &presentation->credential_id))
2279 continue; 2281 continue;
2280 break; /** already in list **/ 2282 break; /** already in list **/
2281 } 2283 }
@@ -2283,10 +2285,11 @@ consume_ticket (void *cls,
2283 { 2285 {
2284 /** Credential matches for attribute, add **/ 2286 /** Credential matches for attribute, add **/
2285 atle = GNUNET_new (struct GNUNET_RECLAIM_PresentationListEntry); 2287 atle = GNUNET_new (struct GNUNET_RECLAIM_PresentationListEntry);
2286 atle->presentation = GNUNET_RECLAIM_presentation_new (pres->type, 2288 atle->presentation = GNUNET_RECLAIM_presentation_new (presentation->type,
2287 pres->data, 2289 presentation->data,
2288 pres->data_size); 2290 presentation->
2289 atle->presentation->credential_id = pres->credential_id; 2291 data_size);
2292 atle->presentation->credential_id = presentation->credential_id;
2290 GNUNET_CONTAINER_DLL_insert (handle->presentations->list_head, 2293 GNUNET_CONTAINER_DLL_insert (handle->presentations->list_head,
2291 handle->presentations->list_tail, 2294 handle->presentations->list_tail,
2292 atle); 2295 atle);
@@ -2643,7 +2646,7 @@ oidc_config_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
2643 response_types); 2646 response_types);
2644 sub_types = json_array (); 2647 sub_types = json_array ();
2645 json_array_append_new (sub_types, 2648 json_array_append_new (sub_types,
2646 json_string ("public")); /* no pairwise suppport */ 2649 json_string ("public")); /* no pairwise support */
2647 json_object_set_new (oidc_config, 2650 json_object_set_new (oidc_config,
2648 "subject_types_supported", 2651 "subject_types_supported",
2649 sub_types); 2652 sub_types);