diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-10-15 09:09:23 +0200 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2020-10-15 12:11:22 +0200 |
commit | 5680378974db794d67b75473435a0651fad0cd24 (patch) | |
tree | 06e1426049f9604114f9328554dc324b422052f4 /src/reclaim/plugin_rest_reclaim.c | |
parent | 7b992510c25c0081c59c4b1f61fe42ff5dc7680d (diff) | |
download | gnunet-5680378974db794d67b75473435a0651fad0cd24.tar.gz gnunet-5680378974db794d67b75473435a0651fad0cd24.zip |
- towards fix reclaim
Diffstat (limited to 'src/reclaim/plugin_rest_reclaim.c')
-rw-r--r-- | src/reclaim/plugin_rest_reclaim.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/reclaim/plugin_rest_reclaim.c b/src/reclaim/plugin_rest_reclaim.c index ff11d2a56..022744c82 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_CRYPTO_EcdsaPrivateKey priv_key; | 175 | struct GNUNET_IDENTITY_PrivateKey priv_key; |
176 | 176 | ||
177 | /** | 177 | /** |
178 | * Rest connection | 178 | * Rest connection |
@@ -440,14 +440,14 @@ ticket_collect (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket) | |||
440 | tmp = | 440 | tmp = |
441 | GNUNET_STRINGS_data_to_string_alloc (&ticket->identity, | 441 | GNUNET_STRINGS_data_to_string_alloc (&ticket->identity, |
442 | sizeof(struct | 442 | sizeof(struct |
443 | GNUNET_CRYPTO_EcdsaPublicKey)); | 443 | GNUNET_IDENTITY_PublicKey)); |
444 | value = json_string (tmp); | 444 | value = json_string (tmp); |
445 | json_object_set_new (json_resource, "issuer", value); | 445 | json_object_set_new (json_resource, "issuer", value); |
446 | GNUNET_free (tmp); | 446 | GNUNET_free (tmp); |
447 | tmp = | 447 | tmp = |
448 | GNUNET_STRINGS_data_to_string_alloc (&ticket->audience, | 448 | GNUNET_STRINGS_data_to_string_alloc (&ticket->audience, |
449 | sizeof(struct | 449 | sizeof(struct |
450 | GNUNET_CRYPTO_EcdsaPublicKey)); | 450 | GNUNET_IDENTITY_PublicKey)); |
451 | value = json_string (tmp); | 451 | value = json_string (tmp); |
452 | json_object_set_new (json_resource, "audience", value); | 452 | json_object_set_new (json_resource, "audience", value); |
453 | GNUNET_free (tmp); | 453 | GNUNET_free (tmp); |
@@ -465,7 +465,7 @@ add_credential_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
465 | void *cls) | 465 | void *cls) |
466 | { | 466 | { |
467 | struct RequestHandle *handle = cls; | 467 | struct RequestHandle *handle = cls; |
468 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity_priv; | 468 | const struct GNUNET_IDENTITY_PrivateKey *identity_priv; |
469 | const char *identity; | 469 | const char *identity; |
470 | struct EgoEntry *ego_entry; | 470 | struct EgoEntry *ego_entry; |
471 | struct GNUNET_RECLAIM_Credential *attribute; | 471 | struct GNUNET_RECLAIM_Credential *attribute; |
@@ -545,7 +545,7 @@ add_credential_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
545 | */ | 545 | */ |
546 | static void | 546 | static void |
547 | cred_collect (void *cls, | 547 | cred_collect (void *cls, |
548 | const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, | 548 | const struct GNUNET_IDENTITY_PublicKey *identity, |
549 | const struct GNUNET_RECLAIM_Credential *cred) | 549 | const struct GNUNET_RECLAIM_Credential *cred) |
550 | { | 550 | { |
551 | struct RequestHandle *handle = cls; | 551 | struct RequestHandle *handle = cls; |
@@ -631,7 +631,7 @@ list_credential_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
631 | void *cls) | 631 | void *cls) |
632 | { | 632 | { |
633 | struct RequestHandle *handle = cls; | 633 | struct RequestHandle *handle = cls; |
634 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key; | 634 | const struct GNUNET_IDENTITY_PrivateKey *priv_key; |
635 | struct EgoEntry *ego_entry; | 635 | struct EgoEntry *ego_entry; |
636 | char *identity; | 636 | char *identity; |
637 | 637 | ||
@@ -688,7 +688,7 @@ delete_credential_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
688 | void *cls) | 688 | void *cls) |
689 | { | 689 | { |
690 | struct RequestHandle *handle = cls; | 690 | struct RequestHandle *handle = cls; |
691 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key; | 691 | const struct GNUNET_IDENTITY_PrivateKey *priv_key; |
692 | struct GNUNET_RECLAIM_Credential attr; | 692 | struct GNUNET_RECLAIM_Credential attr; |
693 | struct EgoEntry *ego_entry; | 693 | struct EgoEntry *ego_entry; |
694 | char *identity_id_str; | 694 | char *identity_id_str; |
@@ -754,7 +754,7 @@ list_tickets_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
754 | const char *url, | 754 | const char *url, |
755 | void *cls) | 755 | void *cls) |
756 | { | 756 | { |
757 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key; | 757 | const struct GNUNET_IDENTITY_PrivateKey *priv_key; |
758 | struct RequestHandle *handle = cls; | 758 | struct RequestHandle *handle = cls; |
759 | struct EgoEntry *ego_entry; | 759 | struct EgoEntry *ego_entry; |
760 | char *identity; | 760 | char *identity; |
@@ -801,7 +801,7 @@ add_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
801 | const char *url, | 801 | const char *url, |
802 | void *cls) | 802 | void *cls) |
803 | { | 803 | { |
804 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity_priv; | 804 | const struct GNUNET_IDENTITY_PrivateKey *identity_priv; |
805 | const char *identity; | 805 | const char *identity; |
806 | struct RequestHandle *handle = cls; | 806 | struct RequestHandle *handle = cls; |
807 | struct EgoEntry *ego_entry; | 807 | struct EgoEntry *ego_entry; |
@@ -949,7 +949,7 @@ parse_jwt (const struct GNUNET_RECLAIM_Credential *cred, | |||
949 | */ | 949 | */ |
950 | static void | 950 | static void |
951 | attr_collect (void *cls, | 951 | attr_collect (void *cls, |
952 | const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, | 952 | const struct GNUNET_IDENTITY_PublicKey *identity, |
953 | const struct GNUNET_RECLAIM_Attribute *attr) | 953 | const struct GNUNET_RECLAIM_Attribute *attr) |
954 | { | 954 | { |
955 | struct RequestHandle *handle = cls; | 955 | struct RequestHandle *handle = cls; |
@@ -996,7 +996,7 @@ list_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
996 | const char *url, | 996 | const char *url, |
997 | void *cls) | 997 | void *cls) |
998 | { | 998 | { |
999 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key; | 999 | const struct GNUNET_IDENTITY_PrivateKey *priv_key; |
1000 | struct RequestHandle *handle = cls; | 1000 | struct RequestHandle *handle = cls; |
1001 | struct EgoEntry *ego_entry; | 1001 | struct EgoEntry *ego_entry; |
1002 | char *identity; | 1002 | char *identity; |
@@ -1050,7 +1050,7 @@ delete_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
1050 | const char *url, | 1050 | const char *url, |
1051 | void *cls) | 1051 | void *cls) |
1052 | { | 1052 | { |
1053 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key; | 1053 | const struct GNUNET_IDENTITY_PrivateKey *priv_key; |
1054 | struct RequestHandle *handle = cls; | 1054 | struct RequestHandle *handle = cls; |
1055 | struct GNUNET_RECLAIM_Attribute attr; | 1055 | struct GNUNET_RECLAIM_Attribute attr; |
1056 | struct EgoEntry *ego_entry; | 1056 | struct EgoEntry *ego_entry; |
@@ -1108,11 +1108,11 @@ revoke_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
1108 | const char *url, | 1108 | const char *url, |
1109 | void *cls) | 1109 | void *cls) |
1110 | { | 1110 | { |
1111 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity_priv; | 1111 | const struct GNUNET_IDENTITY_PrivateKey *identity_priv; |
1112 | struct RequestHandle *handle = cls; | 1112 | struct RequestHandle *handle = cls; |
1113 | struct EgoEntry *ego_entry; | 1113 | struct EgoEntry *ego_entry; |
1114 | struct GNUNET_RECLAIM_Ticket *ticket = NULL; | 1114 | struct GNUNET_RECLAIM_Ticket *ticket = NULL; |
1115 | struct GNUNET_CRYPTO_EcdsaPublicKey tmp_pk; | 1115 | struct GNUNET_IDENTITY_PublicKey tmp_pk; |
1116 | char term_data[handle->rest_handle->data_size + 1]; | 1116 | char term_data[handle->rest_handle->data_size + 1]; |
1117 | json_t *data_json; | 1117 | json_t *data_json; |
1118 | json_error_t err; | 1118 | json_error_t err; |
@@ -1156,7 +1156,7 @@ revoke_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
1156 | GNUNET_IDENTITY_ego_get_public_key (ego_entry->ego, &tmp_pk); | 1156 | GNUNET_IDENTITY_ego_get_public_key (ego_entry->ego, &tmp_pk); |
1157 | if (0 == memcmp (&ticket->identity, | 1157 | if (0 == memcmp (&ticket->identity, |
1158 | &tmp_pk, | 1158 | &tmp_pk, |
1159 | sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey))) | 1159 | sizeof(struct GNUNET_IDENTITY_PublicKey))) |
1160 | break; | 1160 | break; |
1161 | } | 1161 | } |
1162 | if (NULL == ego_entry) | 1162 | if (NULL == ego_entry) |
@@ -1178,7 +1178,7 @@ revoke_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
1178 | 1178 | ||
1179 | static void | 1179 | static void |
1180 | consume_cont (void *cls, | 1180 | consume_cont (void *cls, |
1181 | const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, | 1181 | const struct GNUNET_IDENTITY_PublicKey *identity, |
1182 | const struct GNUNET_RECLAIM_Attribute *attr, | 1182 | const struct GNUNET_RECLAIM_Attribute *attr, |
1183 | const struct GNUNET_RECLAIM_Presentation *pres) | 1183 | const struct GNUNET_RECLAIM_Presentation *pres) |
1184 | { | 1184 | { |
@@ -1215,11 +1215,11 @@ consume_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
1215 | const char *url, | 1215 | const char *url, |
1216 | void *cls) | 1216 | void *cls) |
1217 | { | 1217 | { |
1218 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity_priv; | 1218 | const struct GNUNET_IDENTITY_PrivateKey *identity_priv; |
1219 | struct RequestHandle *handle = cls; | 1219 | struct RequestHandle *handle = cls; |
1220 | struct EgoEntry *ego_entry; | 1220 | struct EgoEntry *ego_entry; |
1221 | struct GNUNET_RECLAIM_Ticket *ticket; | 1221 | struct GNUNET_RECLAIM_Ticket *ticket; |
1222 | struct GNUNET_CRYPTO_EcdsaPublicKey tmp_pk; | 1222 | struct GNUNET_IDENTITY_PublicKey tmp_pk; |
1223 | char term_data[handle->rest_handle->data_size + 1]; | 1223 | char term_data[handle->rest_handle->data_size + 1]; |
1224 | json_t *data_json; | 1224 | json_t *data_json; |
1225 | json_error_t err; | 1225 | json_error_t err; |
@@ -1259,7 +1259,7 @@ consume_ticket_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
1259 | GNUNET_IDENTITY_ego_get_public_key (ego_entry->ego, &tmp_pk); | 1259 | GNUNET_IDENTITY_ego_get_public_key (ego_entry->ego, &tmp_pk); |
1260 | if (0 == memcmp (&ticket->audience, | 1260 | if (0 == memcmp (&ticket->audience, |
1261 | &tmp_pk, | 1261 | &tmp_pk, |
1262 | sizeof(struct GNUNET_CRYPTO_EcdsaPublicKey))) | 1262 | sizeof(struct GNUNET_IDENTITY_PublicKey))) |
1263 | break; | 1263 | break; |
1264 | } | 1264 | } |
1265 | if (NULL == ego_entry) | 1265 | if (NULL == ego_entry) |
@@ -1343,7 +1343,7 @@ list_ego (void *cls, | |||
1343 | const char *identifier) | 1343 | const char *identifier) |
1344 | { | 1344 | { |
1345 | struct EgoEntry *ego_entry; | 1345 | struct EgoEntry *ego_entry; |
1346 | struct GNUNET_CRYPTO_EcdsaPublicKey pk; | 1346 | struct GNUNET_IDENTITY_PublicKey pk; |
1347 | 1347 | ||
1348 | if ((NULL == ego) && (ID_REST_STATE_INIT == state)) | 1348 | if ((NULL == ego) && (ID_REST_STATE_INIT == state)) |
1349 | { | 1349 | { |
@@ -1354,7 +1354,7 @@ list_ego (void *cls, | |||
1354 | { | 1354 | { |
1355 | ego_entry = GNUNET_new (struct EgoEntry); | 1355 | ego_entry = GNUNET_new (struct EgoEntry); |
1356 | GNUNET_IDENTITY_ego_get_public_key (ego, &pk); | 1356 | GNUNET_IDENTITY_ego_get_public_key (ego, &pk); |
1357 | ego_entry->keystring = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); | 1357 | ego_entry->keystring = GNUNET_IDENTITY_public_key_to_string (&pk); |
1358 | ego_entry->ego = ego; | 1358 | ego_entry->ego = ego; |
1359 | ego_entry->identifier = GNUNET_strdup (identifier); | 1359 | ego_entry->identifier = GNUNET_strdup (identifier); |
1360 | GNUNET_CONTAINER_DLL_insert_tail (ego_head, | 1360 | GNUNET_CONTAINER_DLL_insert_tail (ego_head, |
@@ -1380,7 +1380,7 @@ list_ego (void *cls, | |||
1380 | /* Add */ | 1380 | /* Add */ |
1381 | ego_entry = GNUNET_new (struct EgoEntry); | 1381 | ego_entry = GNUNET_new (struct EgoEntry); |
1382 | GNUNET_IDENTITY_ego_get_public_key (ego, &pk); | 1382 | GNUNET_IDENTITY_ego_get_public_key (ego, &pk); |
1383 | ego_entry->keystring = GNUNET_CRYPTO_ecdsa_public_key_to_string (&pk); | 1383 | ego_entry->keystring = GNUNET_IDENTITY_public_key_to_string (&pk); |
1384 | ego_entry->ego = ego; | 1384 | ego_entry->ego = ego; |
1385 | ego_entry->identifier = GNUNET_strdup (identifier); | 1385 | ego_entry->identifier = GNUNET_strdup (identifier); |
1386 | GNUNET_CONTAINER_DLL_insert_tail (ego_head, | 1386 | GNUNET_CONTAINER_DLL_insert_tail (ego_head, |