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.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/reclaim/plugin_rest_openid_connect.c b/src/reclaim/plugin_rest_openid_connect.c
index ff882aca1..d0aee043e 100644
--- a/src/reclaim/plugin_rest_openid_connect.c
+++ b/src/reclaim/plugin_rest_openid_connect.c
@@ -331,7 +331,7 @@ struct OIDC_Variables
331 /** 331 /**
332 * The RP client public key 332 * The RP client public key
333 */ 333 */
334 struct GNUNET_IDENTITY_PublicKey client_pkey; 334 struct GNUNET_CRYPTO_PublicKey client_pkey;
335 335
336 /** 336 /**
337 * The OIDC client id of the RP 337 * The OIDC client id of the RP
@@ -442,7 +442,7 @@ struct RequestHandle
442 /** 442 /**
443 * Pointer to ego private key 443 * Pointer to ego private key
444 */ 444 */
445 struct GNUNET_IDENTITY_PrivateKey priv_key; 445 struct GNUNET_CRYPTO_PrivateKey priv_key;
446 446
447 /** 447 /**
448 * OIDC variables 448 * OIDC variables
@@ -1257,7 +1257,7 @@ oidc_cred_collect_finished_cb (void *cls)
1257 */ 1257 */
1258static void 1258static void
1259oidc_cred_collect (void *cls, 1259oidc_cred_collect (void *cls,
1260 const struct GNUNET_IDENTITY_PublicKey *identity, 1260 const struct GNUNET_CRYPTO_PublicKey *identity,
1261 const struct GNUNET_RECLAIM_Credential *cred) 1261 const struct GNUNET_RECLAIM_Credential *cred)
1262{ 1262{
1263 struct RequestHandle *handle = cls; 1263 struct RequestHandle *handle = cls;
@@ -1380,7 +1380,7 @@ attr_in_userinfo_request (struct RequestHandle *handle,
1380 */ 1380 */
1381static void 1381static void
1382oidc_attr_collect (void *cls, 1382oidc_attr_collect (void *cls,
1383 const struct GNUNET_IDENTITY_PublicKey *identity, 1383 const struct GNUNET_CRYPTO_PublicKey *identity,
1384 const struct GNUNET_RECLAIM_Attribute *attr) 1384 const struct GNUNET_RECLAIM_Attribute *attr)
1385{ 1385{
1386 struct RequestHandle *handle = cls; 1386 struct RequestHandle *handle = cls;
@@ -1429,8 +1429,8 @@ code_redirect (void *cls)
1429 struct RequestHandle *handle = cls; 1429 struct RequestHandle *handle = cls;
1430 struct GNUNET_TIME_Absolute current_time; 1430 struct GNUNET_TIME_Absolute current_time;
1431 struct GNUNET_TIME_Absolute *relog_time; 1431 struct GNUNET_TIME_Absolute *relog_time;
1432 struct GNUNET_IDENTITY_PublicKey pubkey; 1432 struct GNUNET_CRYPTO_PublicKey pubkey;
1433 struct GNUNET_IDENTITY_PublicKey ego_pkey; 1433 struct GNUNET_CRYPTO_PublicKey ego_pkey;
1434 struct GNUNET_HashCode cache_key; 1434 struct GNUNET_HashCode cache_key;
1435 char *identity_cookie; 1435 char *identity_cookie;
1436 1436
@@ -1450,7 +1450,7 @@ code_redirect (void *cls)
1450 if (current_time.abs_value_us <= relog_time->abs_value_us) 1450 if (current_time.abs_value_us <= relog_time->abs_value_us)
1451 { 1451 {
1452 if (GNUNET_OK != 1452 if (GNUNET_OK !=
1453 GNUNET_IDENTITY_public_key_from_string (handle->oidc 1453 GNUNET_CRYPTO_public_key_from_string (handle->oidc
1454 ->login_identity, 1454 ->login_identity,
1455 &pubkey)) 1455 &pubkey))
1456 { 1456 {
@@ -1544,7 +1544,7 @@ lookup_redirect_uri_result (void *cls,
1544 char *tmp; 1544 char *tmp;
1545 char *tmp_key_str; 1545 char *tmp_key_str;
1546 char *pos; 1546 char *pos;
1547 struct GNUNET_IDENTITY_PublicKey redirect_zone; 1547 struct GNUNET_CRYPTO_PublicKey redirect_zone;
1548 1548
1549 handle->gns_op = NULL; 1549 handle->gns_op = NULL;
1550 if (0 == rd_count) 1550 if (0 == rd_count)
@@ -1776,10 +1776,10 @@ static void
1776tld_iter (void *cls, const char *section, const char *option, const char *value) 1776tld_iter (void *cls, const char *section, const char *option, const char *value)
1777{ 1777{
1778 struct RequestHandle *handle = cls; 1778 struct RequestHandle *handle = cls;
1779 struct GNUNET_IDENTITY_PublicKey pkey; 1779 struct GNUNET_CRYPTO_PublicKey pkey;
1780 1780
1781 if (GNUNET_OK != 1781 if (GNUNET_OK !=
1782 GNUNET_IDENTITY_public_key_from_string (value, &pkey)) 1782 GNUNET_CRYPTO_public_key_from_string (value, &pkey))
1783 { 1783 {
1784 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Skipping non key %s\n", value); 1784 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Skipping non key %s\n", value);
1785 return; 1785 return;
@@ -1803,8 +1803,8 @@ authorize_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1803{ 1803{
1804 struct RequestHandle *handle = cls; 1804 struct RequestHandle *handle = cls;
1805 struct EgoEntry *tmp_ego; 1805 struct EgoEntry *tmp_ego;
1806 const struct GNUNET_IDENTITY_PrivateKey *priv_key; 1806 const struct GNUNET_CRYPTO_PrivateKey *priv_key;
1807 struct GNUNET_IDENTITY_PublicKey pkey; 1807 struct GNUNET_CRYPTO_PublicKey pkey;
1808 1808
1809 cookie_identity_interpretation (handle); 1809 cookie_identity_interpretation (handle);
1810 1810
@@ -1832,7 +1832,7 @@ authorize_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1832 } 1832 }
1833 1833
1834 if (GNUNET_OK != 1834 if (GNUNET_OK !=
1835 GNUNET_IDENTITY_public_key_from_string (handle->oidc->client_id, 1835 GNUNET_CRYPTO_public_key_from_string (handle->oidc->client_id,
1836 &handle->oidc->client_pkey)) 1836 &handle->oidc->client_pkey))
1837 { 1837 {
1838 handle->emsg = GNUNET_strdup (OIDC_ERROR_KEY_UNAUTHORIZED_CLIENT); 1838 handle->emsg = GNUNET_strdup (OIDC_ERROR_KEY_UNAUTHORIZED_CLIENT);
@@ -1848,7 +1848,7 @@ authorize_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
1848 for (tmp_ego = ego_head; NULL != tmp_ego; tmp_ego = tmp_ego->next) 1848 for (tmp_ego = ego_head; NULL != tmp_ego; tmp_ego = tmp_ego->next)
1849 { 1849 {
1850 priv_key = GNUNET_IDENTITY_ego_get_private_key (tmp_ego->ego); 1850 priv_key = GNUNET_IDENTITY_ego_get_private_key (tmp_ego->ego);
1851 GNUNET_IDENTITY_key_get_public (priv_key, &pkey); 1851 GNUNET_CRYPTO_key_get_public (priv_key, &pkey);
1852 if (0 == GNUNET_memcmp (&pkey, &handle->oidc->client_pkey)) 1852 if (0 == GNUNET_memcmp (&pkey, &handle->oidc->client_pkey))
1853 { 1853 {
1854 handle->tld = GNUNET_strdup (tmp_ego->identifier); 1854 handle->tld = GNUNET_strdup (tmp_ego->identifier);
@@ -2041,7 +2041,7 @@ parse_credentials_post_body (struct RequestHandle *handle,
2041 2041
2042static int 2042static int
2043check_authorization (struct RequestHandle *handle, 2043check_authorization (struct RequestHandle *handle,
2044 struct GNUNET_IDENTITY_PublicKey *cid) 2044 struct GNUNET_CRYPTO_PublicKey *cid)
2045{ 2045{
2046 char *expected_pass; 2046 char *expected_pass;
2047 char *received_cid; 2047 char *received_cid;
@@ -2078,7 +2078,7 @@ check_authorization (struct RequestHandle *handle,
2078 GNUNET_STRINGS_string_to_data (received_cid, 2078 GNUNET_STRINGS_string_to_data (received_cid,
2079 strlen (received_cid), 2079 strlen (received_cid),
2080 cid, 2080 cid,
2081 sizeof(struct GNUNET_IDENTITY_PublicKey)); 2081 sizeof(struct GNUNET_CRYPTO_PublicKey));
2082 GNUNET_free (received_cid); 2082 GNUNET_free (received_cid);
2083 return GNUNET_OK; 2083 return GNUNET_OK;
2084 2084
@@ -2128,7 +2128,7 @@ check_authorization (struct RequestHandle *handle,
2128 GNUNET_STRINGS_string_to_data (received_cid, 2128 GNUNET_STRINGS_string_to_data (received_cid,
2129 strlen (received_cid), 2129 strlen (received_cid),
2130 cid, 2130 cid,
2131 sizeof(struct GNUNET_IDENTITY_PublicKey)); 2131 sizeof(struct GNUNET_CRYPTO_PublicKey));
2132 2132
2133 GNUNET_free (received_cpw); 2133 GNUNET_free (received_cpw);
2134 GNUNET_free (received_cid); 2134 GNUNET_free (received_cid);
@@ -2138,10 +2138,10 @@ check_authorization (struct RequestHandle *handle,
2138 2138
2139const struct EgoEntry * 2139const struct EgoEntry *
2140find_ego (struct RequestHandle *handle, 2140find_ego (struct RequestHandle *handle,
2141 struct GNUNET_IDENTITY_PublicKey *test_key) 2141 struct GNUNET_CRYPTO_PublicKey *test_key)
2142{ 2142{
2143 struct EgoEntry *ego_entry; 2143 struct EgoEntry *ego_entry;
2144 struct GNUNET_IDENTITY_PublicKey pub_key; 2144 struct GNUNET_CRYPTO_PublicKey pub_key;
2145 2145
2146 for (ego_entry = ego_head; NULL != ego_entry; 2146 for (ego_entry = ego_head; NULL != ego_entry;
2147 ego_entry = ego_entry->next) 2147 ego_entry = ego_entry->next)
@@ -2172,7 +2172,7 @@ token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
2172 struct GNUNET_RECLAIM_AttributeList *cl = NULL; 2172 struct GNUNET_RECLAIM_AttributeList *cl = NULL;
2173 struct GNUNET_RECLAIM_PresentationList *pl = NULL; 2173 struct GNUNET_RECLAIM_PresentationList *pl = NULL;
2174 struct GNUNET_RECLAIM_Ticket ticket; 2174 struct GNUNET_RECLAIM_Ticket ticket;
2175 struct GNUNET_IDENTITY_PublicKey cid; 2175 struct GNUNET_CRYPTO_PublicKey cid;
2176 struct GNUNET_HashCode cache_key; 2176 struct GNUNET_HashCode cache_key;
2177 struct MHD_Response *resp = NULL; 2177 struct MHD_Response *resp = NULL;
2178 char *grant_type = NULL; 2178 char *grant_type = NULL;
@@ -2439,7 +2439,7 @@ token_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
2439 */ 2439 */
2440static void 2440static void
2441consume_ticket (void *cls, 2441consume_ticket (void *cls,
2442 const struct GNUNET_IDENTITY_PublicKey *identity, 2442 const struct GNUNET_CRYPTO_PublicKey *identity,
2443 const struct GNUNET_RECLAIM_Attribute *attr, 2443 const struct GNUNET_RECLAIM_Attribute *attr,
2444 const struct GNUNET_RECLAIM_Presentation *presentation) 2444 const struct GNUNET_RECLAIM_Presentation *presentation)
2445{ 2445{
@@ -2620,7 +2620,7 @@ userinfo_endpoint (struct GNUNET_REST_RequestHandle *con_handle,
2620 char *authorization_type; 2620 char *authorization_type;
2621 char *authorization_access_token; 2621 char *authorization_access_token;
2622 const struct EgoEntry *aud_ego; 2622 const struct EgoEntry *aud_ego;
2623 const struct GNUNET_IDENTITY_PrivateKey *privkey; 2623 const struct GNUNET_CRYPTO_PrivateKey *privkey;
2624 2624
2625 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Getting userinfo\n"); 2625 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Getting userinfo\n");
2626 GNUNET_CRYPTO_hash (OIDC_AUTHORIZATION_HEADER_KEY, 2626 GNUNET_CRYPTO_hash (OIDC_AUTHORIZATION_HEADER_KEY,
@@ -2802,7 +2802,7 @@ list_ego (void *cls,
2802 const char *identifier) 2802 const char *identifier)
2803{ 2803{
2804 struct EgoEntry *ego_entry; 2804 struct EgoEntry *ego_entry;
2805 struct GNUNET_IDENTITY_PublicKey pk; 2805 struct GNUNET_CRYPTO_PublicKey pk;
2806 2806
2807 if (NULL == ego) 2807 if (NULL == ego)
2808 { 2808 {
@@ -2814,7 +2814,7 @@ list_ego (void *cls,
2814 { 2814 {
2815 ego_entry = GNUNET_new (struct EgoEntry); 2815 ego_entry = GNUNET_new (struct EgoEntry);
2816 GNUNET_IDENTITY_ego_get_public_key (ego, &pk); 2816 GNUNET_IDENTITY_ego_get_public_key (ego, &pk);
2817 ego_entry->keystring = GNUNET_IDENTITY_public_key_to_string (&pk); 2817 ego_entry->keystring = GNUNET_CRYPTO_public_key_to_string (&pk);
2818 ego_entry->ego = ego; 2818 ego_entry->ego = ego;
2819 ego_entry->identifier = GNUNET_strdup (identifier); 2819 ego_entry->identifier = GNUNET_strdup (identifier);
2820 GNUNET_CONTAINER_DLL_insert_tail (ego_head, 2820 GNUNET_CONTAINER_DLL_insert_tail (ego_head,
@@ -2841,7 +2841,7 @@ list_ego (void *cls,
2841 /* Add */ 2841 /* Add */
2842 ego_entry = GNUNET_new (struct EgoEntry); 2842 ego_entry = GNUNET_new (struct EgoEntry);
2843 GNUNET_IDENTITY_ego_get_public_key (ego, &pk); 2843 GNUNET_IDENTITY_ego_get_public_key (ego, &pk);
2844 ego_entry->keystring = GNUNET_IDENTITY_public_key_to_string (&pk); 2844 ego_entry->keystring = GNUNET_CRYPTO_public_key_to_string (&pk);
2845 ego_entry->ego = ego; 2845 ego_entry->ego = ego;
2846 ego_entry->identifier = GNUNET_strdup (identifier); 2846 ego_entry->identifier = GNUNET_strdup (identifier);
2847 GNUNET_CONTAINER_DLL_insert_tail (ego_head, 2847 GNUNET_CONTAINER_DLL_insert_tail (ego_head,