aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim/plugin_rest_reclaim.c
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2023-10-18 13:37:38 +0200
committerMartin Schanzenbach <schanzen@gnunet.org>2023-10-18 13:37:38 +0200
commit9ef4abad615bea12d13be542b8ae5fbeb2dfee32 (patch)
tree8875a687e004d331c9ea6a1d511a328c72b88113 /src/reclaim/plugin_rest_reclaim.c
parente95236b3ed78cd597c15f34b89385295702b627f (diff)
downloadgnunet-9ef4abad615bea12d13be542b8ae5fbeb2dfee32.tar.gz
gnunet-9ef4abad615bea12d13be542b8ae5fbeb2dfee32.zip
NEWS: Refactoring components under src/ into lib/, plugin/, cli/ and service/
This also includes a necessary API refactoring of crypto from IDENTITY to UTIL.
Diffstat (limited to 'src/reclaim/plugin_rest_reclaim.c')
-rw-r--r--src/reclaim/plugin_rest_reclaim.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/reclaim/plugin_rest_reclaim.c b/src/reclaim/plugin_rest_reclaim.c
index 9cc41bf1a..b2586109a 100644
--- a/src/reclaim/plugin_rest_reclaim.c
+++ b/src/reclaim/plugin_rest_reclaim.c
@@ -172,7 +172,7 @@ struct RequestHandle
172 /** 172 /**
173 * Pointer to ego private key 173 * Pointer to ego private key
174 */ 174 */
175 struct GNUNET_IDENTITY_PrivateKey priv_key; 175 struct GNUNET_CRYPTO_PrivateKey priv_key;
176 176
177 /** 177 /**
178 * Rest connection 178 * Rest connection
@@ -449,14 +449,14 @@ ticket_collect (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket)
449 tmp = 449 tmp =
450 GNUNET_STRINGS_data_to_string_alloc (&ticket->identity, 450 GNUNET_STRINGS_data_to_string_alloc (&ticket->identity,
451 sizeof(struct 451 sizeof(struct
452 GNUNET_IDENTITY_PublicKey)); 452 GNUNET_CRYPTO_PublicKey));
453 value = json_string (tmp); 453 value = json_string (tmp);
454 json_object_set_new (json_resource, "issuer", value); 454 json_object_set_new (json_resource, "issuer", value);
455 GNUNET_free (tmp); 455 GNUNET_free (tmp);
456 tmp = 456 tmp =
457 GNUNET_STRINGS_data_to_string_alloc (&ticket->audience, 457 GNUNET_STRINGS_data_to_string_alloc (&ticket->audience,
458 sizeof(struct 458 sizeof(struct
459 GNUNET_IDENTITY_PublicKey)); 459 GNUNET_CRYPTO_PublicKey));
460 value = json_string (tmp); 460 value = json_string (tmp);
461 json_object_set_new (json_resource, "audience", value); 461 json_object_set_new (json_resource, "audience", value);
462 GNUNET_free (tmp); 462 GNUNET_free (tmp);
@@ -474,7 +474,7 @@ add_credential_cont (struct GNUNET_REST_RequestHandle *con_handle,
474 void *cls) 474 void *cls)
475{ 475{
476 struct RequestHandle *handle = cls; 476 struct RequestHandle *handle = cls;
477 const struct GNUNET_IDENTITY_PrivateKey *identity_priv; 477 const struct GNUNET_CRYPTO_PrivateKey *identity_priv;
478 const char *identity; 478 const char *identity;
479 struct EgoEntry *ego_entry; 479 struct EgoEntry *ego_entry;
480 struct GNUNET_RECLAIM_Credential *attribute; 480 struct GNUNET_RECLAIM_Credential *attribute;
@@ -562,7 +562,7 @@ add_credential_cont (struct GNUNET_REST_RequestHandle *con_handle,
562 */ 562 */
563static void 563static void
564cred_collect (void *cls, 564cred_collect (void *cls,
565 const struct GNUNET_IDENTITY_PublicKey *identity, 565 const struct GNUNET_CRYPTO_PublicKey *identity,
566 const struct GNUNET_RECLAIM_Credential *cred) 566 const struct GNUNET_RECLAIM_Credential *cred)
567{ 567{
568 struct RequestHandle *handle = cls; 568 struct RequestHandle *handle = cls;
@@ -649,7 +649,7 @@ list_credential_cont (struct GNUNET_REST_RequestHandle *con_handle,
649 void *cls) 649 void *cls)
650{ 650{
651 struct RequestHandle *handle = cls; 651 struct RequestHandle *handle = cls;
652 const struct GNUNET_IDENTITY_PrivateKey *priv_key; 652 const struct GNUNET_CRYPTO_PrivateKey *priv_key;
653 struct EgoEntry *ego_entry; 653 struct EgoEntry *ego_entry;
654 char *identity; 654 char *identity;
655 655
@@ -706,7 +706,7 @@ delete_credential_cont (struct GNUNET_REST_RequestHandle *con_handle,
706 void *cls) 706 void *cls)
707{ 707{
708 struct RequestHandle *handle = cls; 708 struct RequestHandle *handle = cls;
709 const struct GNUNET_IDENTITY_PrivateKey *priv_key; 709 const struct GNUNET_CRYPTO_PrivateKey *priv_key;
710 struct GNUNET_RECLAIM_Credential attr; 710 struct GNUNET_RECLAIM_Credential attr;
711 struct EgoEntry *ego_entry; 711 struct EgoEntry *ego_entry;
712 char *identity_id_str; 712 char *identity_id_str;
@@ -772,7 +772,7 @@ list_tickets_cont (struct GNUNET_REST_RequestHandle *con_handle,
772 const char *url, 772 const char *url,
773 void *cls) 773 void *cls)
774{ 774{
775 const struct GNUNET_IDENTITY_PrivateKey *priv_key; 775 const struct GNUNET_CRYPTO_PrivateKey *priv_key;
776 struct RequestHandle *handle = cls; 776 struct RequestHandle *handle = cls;
777 struct EgoEntry *ego_entry; 777 struct EgoEntry *ego_entry;
778 char *identity; 778 char *identity;
@@ -819,7 +819,7 @@ add_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle,
819 const char *url, 819 const char *url,
820 void *cls) 820 void *cls)
821{ 821{
822 const struct GNUNET_IDENTITY_PrivateKey *identity_priv; 822 const struct GNUNET_CRYPTO_PrivateKey *identity_priv;
823 const char *identity; 823 const char *identity;
824 struct RequestHandle *handle = cls; 824 struct RequestHandle *handle = cls;
825 struct EgoEntry *ego_entry; 825 struct EgoEntry *ego_entry;
@@ -967,7 +967,7 @@ parse_jwt (const struct GNUNET_RECLAIM_Credential *cred,
967 */ 967 */
968static void 968static void
969attr_collect (void *cls, 969attr_collect (void *cls,
970 const struct GNUNET_IDENTITY_PublicKey *identity, 970 const struct GNUNET_CRYPTO_PublicKey *identity,
971 const struct GNUNET_RECLAIM_Attribute *attr) 971 const struct GNUNET_RECLAIM_Attribute *attr)
972{ 972{
973 struct RequestHandle *handle = cls; 973 struct RequestHandle *handle = cls;
@@ -1016,7 +1016,7 @@ list_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle,
1016 const char *url, 1016 const char *url,
1017 void *cls) 1017 void *cls)
1018{ 1018{
1019 const struct GNUNET_IDENTITY_PrivateKey *priv_key; 1019 const struct GNUNET_CRYPTO_PrivateKey *priv_key;
1020 struct RequestHandle *handle = cls; 1020 struct RequestHandle *handle = cls;
1021 struct EgoEntry *ego_entry; 1021 struct EgoEntry *ego_entry;
1022 char *identity; 1022 char *identity;
@@ -1070,7 +1070,7 @@ delete_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle,
1070 const char *url, 1070 const char *url,
1071 void *cls) 1071 void *cls)
1072{ 1072{
1073 const struct GNUNET_IDENTITY_PrivateKey *priv_key; 1073 const struct GNUNET_CRYPTO_PrivateKey *priv_key;
1074 struct RequestHandle *handle = cls; 1074 struct RequestHandle *handle = cls;
1075 struct GNUNET_RECLAIM_Attribute attr; 1075 struct GNUNET_RECLAIM_Attribute attr;
1076 struct EgoEntry *ego_entry; 1076 struct EgoEntry *ego_entry;
@@ -1128,11 +1128,11 @@ revoke_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle,
1128 const char *url, 1128 const char *url,
1129 void *cls) 1129 void *cls)
1130{ 1130{
1131 const struct GNUNET_IDENTITY_PrivateKey *identity_priv; 1131 const struct GNUNET_CRYPTO_PrivateKey *identity_priv;
1132 struct RequestHandle *handle = cls; 1132 struct RequestHandle *handle = cls;
1133 struct EgoEntry *ego_entry; 1133 struct EgoEntry *ego_entry;
1134 struct GNUNET_RECLAIM_Ticket *ticket = NULL; 1134 struct GNUNET_RECLAIM_Ticket *ticket = NULL;
1135 struct GNUNET_IDENTITY_PublicKey tmp_pk; 1135 struct GNUNET_CRYPTO_PublicKey tmp_pk;
1136 char term_data[handle->rest_handle->data_size + 1]; 1136 char term_data[handle->rest_handle->data_size + 1];
1137 json_t *data_json; 1137 json_t *data_json;
1138 json_error_t err; 1138 json_error_t err;
@@ -1176,7 +1176,7 @@ revoke_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle,
1176 GNUNET_IDENTITY_ego_get_public_key (ego_entry->ego, &tmp_pk); 1176 GNUNET_IDENTITY_ego_get_public_key (ego_entry->ego, &tmp_pk);
1177 if (0 == memcmp (&ticket->identity, 1177 if (0 == memcmp (&ticket->identity,
1178 &tmp_pk, 1178 &tmp_pk,
1179 sizeof(struct GNUNET_IDENTITY_PublicKey))) 1179 sizeof(struct GNUNET_CRYPTO_PublicKey)))
1180 break; 1180 break;
1181 } 1181 }
1182 if (NULL == ego_entry) 1182 if (NULL == ego_entry)
@@ -1198,7 +1198,7 @@ revoke_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle,
1198 1198
1199static void 1199static void
1200consume_cont (void *cls, 1200consume_cont (void *cls,
1201 const struct GNUNET_IDENTITY_PublicKey *identity, 1201 const struct GNUNET_CRYPTO_PublicKey *identity,
1202 const struct GNUNET_RECLAIM_Attribute *attr, 1202 const struct GNUNET_RECLAIM_Attribute *attr,
1203 const struct GNUNET_RECLAIM_Presentation *presentation) 1203 const struct GNUNET_RECLAIM_Presentation *presentation)
1204{ 1204{
@@ -1235,11 +1235,11 @@ consume_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle,
1235 const char *url, 1235 const char *url,
1236 void *cls) 1236 void *cls)
1237{ 1237{
1238 const struct GNUNET_IDENTITY_PrivateKey *identity_priv; 1238 const struct GNUNET_CRYPTO_PrivateKey *identity_priv;
1239 struct RequestHandle *handle = cls; 1239 struct RequestHandle *handle = cls;
1240 struct EgoEntry *ego_entry; 1240 struct EgoEntry *ego_entry;
1241 struct GNUNET_RECLAIM_Ticket *ticket; 1241 struct GNUNET_RECLAIM_Ticket *ticket;
1242 struct GNUNET_IDENTITY_PublicKey tmp_pk; 1242 struct GNUNET_CRYPTO_PublicKey tmp_pk;
1243 char term_data[handle->rest_handle->data_size + 1]; 1243 char term_data[handle->rest_handle->data_size + 1];
1244 json_t *data_json; 1244 json_t *data_json;
1245 json_error_t err; 1245 json_error_t err;
@@ -1279,7 +1279,7 @@ consume_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle,
1279 GNUNET_IDENTITY_ego_get_public_key (ego_entry->ego, &tmp_pk); 1279 GNUNET_IDENTITY_ego_get_public_key (ego_entry->ego, &tmp_pk);
1280 if (0 == memcmp (&ticket->audience, 1280 if (0 == memcmp (&ticket->audience,
1281 &tmp_pk, 1281 &tmp_pk,
1282 sizeof(struct GNUNET_IDENTITY_PublicKey))) 1282 sizeof(struct GNUNET_CRYPTO_PublicKey)))
1283 break; 1283 break;
1284 } 1284 }
1285 if (NULL == ego_entry) 1285 if (NULL == ego_entry)
@@ -1362,7 +1362,7 @@ list_ego (void *cls,
1362 const char *identifier) 1362 const char *identifier)
1363{ 1363{
1364 struct EgoEntry *ego_entry; 1364 struct EgoEntry *ego_entry;
1365 struct GNUNET_IDENTITY_PublicKey pk; 1365 struct GNUNET_CRYPTO_PublicKey pk;
1366 1366
1367 if (NULL == ego) 1367 if (NULL == ego)
1368 { 1368 {
@@ -1373,7 +1373,7 @@ list_ego (void *cls,
1373 { 1373 {
1374 ego_entry = GNUNET_new (struct EgoEntry); 1374 ego_entry = GNUNET_new (struct EgoEntry);
1375 GNUNET_IDENTITY_ego_get_public_key (ego, &pk); 1375 GNUNET_IDENTITY_ego_get_public_key (ego, &pk);
1376 ego_entry->keystring = GNUNET_IDENTITY_public_key_to_string (&pk); 1376 ego_entry->keystring = GNUNET_CRYPTO_public_key_to_string (&pk);
1377 ego_entry->ego = ego; 1377 ego_entry->ego = ego;
1378 ego_entry->identifier = GNUNET_strdup (identifier); 1378 ego_entry->identifier = GNUNET_strdup (identifier);
1379 GNUNET_CONTAINER_DLL_insert_tail (ego_head, 1379 GNUNET_CONTAINER_DLL_insert_tail (ego_head,
@@ -1399,7 +1399,7 @@ list_ego (void *cls,
1399 /* Add */ 1399 /* Add */
1400 ego_entry = GNUNET_new (struct EgoEntry); 1400 ego_entry = GNUNET_new (struct EgoEntry);
1401 GNUNET_IDENTITY_ego_get_public_key (ego, &pk); 1401 GNUNET_IDENTITY_ego_get_public_key (ego, &pk);
1402 ego_entry->keystring = GNUNET_IDENTITY_public_key_to_string (&pk); 1402 ego_entry->keystring = GNUNET_CRYPTO_public_key_to_string (&pk);
1403 ego_entry->ego = ego; 1403 ego_entry->ego = ego;
1404 ego_entry->identifier = GNUNET_strdup (identifier); 1404 ego_entry->identifier = GNUNET_strdup (identifier);
1405 GNUNET_CONTAINER_DLL_insert_tail (ego_head, 1405 GNUNET_CONTAINER_DLL_insert_tail (ego_head,