diff options
-rw-r--r-- | po/POTFILES.in | 6 | ||||
-rw-r--r-- | src/reclaim-attribute/reclaim_attestation.c | 2 | ||||
-rw-r--r-- | src/reclaim-attribute/reclaim_attribute.c | 2 | ||||
-rw-r--r-- | src/reclaim/gnunet-reclaim.c | 17 | ||||
-rw-r--r-- | src/reclaim/gnunet-service-reclaim.c | 7 | ||||
-rw-r--r-- | src/reclaim/plugin_rest_reclaim.c | 4 | ||||
-rw-r--r-- | src/reclaim/reclaim_api.c | 34 |
7 files changed, 53 insertions, 19 deletions
diff --git a/po/POTFILES.in b/po/POTFILES.in index 441d0f91d..f3376d01b 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in | |||
@@ -264,7 +264,9 @@ src/pq/pq_prepare.c | |||
264 | src/pq/pq_query_helper.c | 264 | src/pq/pq_query_helper.c |
265 | src/pq/pq_result_helper.c | 265 | src/pq/pq_result_helper.c |
266 | src/pt/gnunet-daemon-pt.c | 266 | src/pt/gnunet-daemon-pt.c |
267 | src/reclaim-attribute/plugin_reclaim_attribute_gnuid.c | 267 | src/reclaim-attribute/plugin_reclaim_attestation_jwt.c |
268 | src/reclaim-attribute/plugin_reclaim_attribute_basic.c | ||
269 | src/reclaim-attribute/reclaim_attestation.c | ||
268 | src/reclaim-attribute/reclaim_attribute.c | 270 | src/reclaim-attribute/reclaim_attribute.c |
269 | src/reclaim/gnunet-reclaim.c | 271 | src/reclaim/gnunet-reclaim.c |
270 | src/reclaim/gnunet-service-reclaim.c | 272 | src/reclaim/gnunet-service-reclaim.c |
@@ -428,6 +430,7 @@ src/transport/transport_api_offer_hello.c | |||
428 | src/util/bandwidth.c | 430 | src/util/bandwidth.c |
429 | src/util/benchmark.c | 431 | src/util/benchmark.c |
430 | src/util/bio.c | 432 | src/util/bio.c |
433 | src/util/buffer.c | ||
431 | src/util/client.c | 434 | src/util/client.c |
432 | src/util/common_allocation.c | 435 | src/util/common_allocation.c |
433 | src/util/common_endian.c | 436 | src/util/common_endian.c |
@@ -464,6 +467,7 @@ src/util/getopt.c | |||
464 | src/util/getopt_helpers.c | 467 | src/util/getopt_helpers.c |
465 | src/util/gnunet-config-diff.c | 468 | src/util/gnunet-config-diff.c |
466 | src/util/gnunet-config.c | 469 | src/util/gnunet-config.c |
470 | src/util/gnunet-crypto-tvg.c | ||
467 | src/util/gnunet-ecc.c | 471 | src/util/gnunet-ecc.c |
468 | src/util/gnunet-qr.c | 472 | src/util/gnunet-qr.c |
469 | src/util/gnunet-resolver.c | 473 | src/util/gnunet-resolver.c |
diff --git a/src/reclaim-attribute/reclaim_attestation.c b/src/reclaim-attribute/reclaim_attestation.c index fd08b9b12..961c6ede4 100644 --- a/src/reclaim-attribute/reclaim_attestation.c +++ b/src/reclaim-attribute/reclaim_attestation.c | |||
@@ -388,7 +388,7 @@ GNUNET_RECLAIM_attestation_list_destroy ( | |||
388 | struct GNUNET_RECLAIM_AttestationListEntry *ale; | 388 | struct GNUNET_RECLAIM_AttestationListEntry *ale; |
389 | struct GNUNET_RECLAIM_AttestationListEntry *tmp_ale; | 389 | struct GNUNET_RECLAIM_AttestationListEntry *tmp_ale; |
390 | 390 | ||
391 | for (ale = al->list_head; NULL != ale; ale = ale->next) | 391 | for (ale = al->list_head; NULL != ale;) |
392 | { | 392 | { |
393 | if (NULL != ale->attestation) | 393 | if (NULL != ale->attestation) |
394 | GNUNET_free (ale->attestation); | 394 | GNUNET_free (ale->attestation); |
diff --git a/src/reclaim-attribute/reclaim_attribute.c b/src/reclaim-attribute/reclaim_attribute.c index 936f9cb75..0e3fae849 100644 --- a/src/reclaim-attribute/reclaim_attribute.c +++ b/src/reclaim-attribute/reclaim_attribute.c | |||
@@ -423,7 +423,7 @@ GNUNET_RECLAIM_attribute_list_destroy ( | |||
423 | struct GNUNET_RECLAIM_AttributeListEntry *ale; | 423 | struct GNUNET_RECLAIM_AttributeListEntry *ale; |
424 | struct GNUNET_RECLAIM_AttributeListEntry *tmp_ale; | 424 | struct GNUNET_RECLAIM_AttributeListEntry *tmp_ale; |
425 | 425 | ||
426 | for (ale = al->list_head; NULL != ale; ale = ale->next) | 426 | for (ale = al->list_head; NULL != ale;) |
427 | { | 427 | { |
428 | if (NULL != ale->attribute) | 428 | if (NULL != ale->attribute) |
429 | GNUNET_free (ale->attribute); | 429 | GNUNET_free (ale->attribute); |
diff --git a/src/reclaim/gnunet-reclaim.c b/src/reclaim/gnunet-reclaim.c index 0170ceff2..121f2b963 100644 --- a/src/reclaim/gnunet-reclaim.c +++ b/src/reclaim/gnunet-reclaim.c | |||
@@ -627,8 +627,10 @@ attest_iter_cb (void *cls, | |||
627 | const struct GNUNET_RECLAIM_AttributeList *attrs) | 627 | const struct GNUNET_RECLAIM_AttributeList *attrs) |
628 | { | 628 | { |
629 | char *attest_str; | 629 | char *attest_str; |
630 | char *attr_str; | ||
630 | char *id; | 631 | char *id; |
631 | const char *attest_type; | 632 | const char *attest_type; |
633 | struct GNUNET_RECLAIM_AttributeListEntry *ale; | ||
632 | 634 | ||
633 | if (GNUNET_YES == GNUNET_RECLAIM_id_is_equal (&attestation, | 635 | if (GNUNET_YES == GNUNET_RECLAIM_id_is_equal (&attestation, |
634 | &attest->id)) | 636 | &attest->id)) |
@@ -647,6 +649,21 @@ attest_iter_cb (void *cls, | |||
647 | attest_type, | 649 | attest_type, |
648 | attest->flag, | 650 | attest->flag, |
649 | id); | 651 | id); |
652 | if (NULL != attrs) | ||
653 | { | ||
654 | fprintf (stdout, | ||
655 | "\t Attributes:\n"); | ||
656 | for (ale = attrs->list_head; NULL != ale; ale = ale->next) | ||
657 | { | ||
658 | attr_str = GNUNET_RECLAIM_attribute_value_to_string (ale->attribute->type, | ||
659 | ale->attribute->data, | ||
660 | ale->attribute->data_size); | ||
661 | |||
662 | fprintf (stdout, | ||
663 | "\t %s: %s\n", ale->attribute->name, attr_str); | ||
664 | GNUNET_free (attr_str); | ||
665 | } | ||
666 | } | ||
650 | GNUNET_free (id); | 667 | GNUNET_free (id); |
651 | } | 668 | } |
652 | GNUNET_RECLAIM_get_attestations_next (attest_iterator); | 669 | GNUNET_RECLAIM_get_attestations_next (attest_iterator); |
diff --git a/src/reclaim/gnunet-service-reclaim.c b/src/reclaim/gnunet-service-reclaim.c index 99831172b..eb8727f8f 100644 --- a/src/reclaim/gnunet-service-reclaim.c +++ b/src/reclaim/gnunet-service-reclaim.c | |||
@@ -1859,6 +1859,7 @@ attest_iter_finished (void *cls) | |||
1859 | env = GNUNET_MQ_msg (arm, GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_RESULT); | 1859 | env = GNUNET_MQ_msg (arm, GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_RESULT); |
1860 | arm->id = htonl (ai->request_id); | 1860 | arm->id = htonl (ai->request_id); |
1861 | arm->attestation_len = htons (0); | 1861 | arm->attestation_len = htons (0); |
1862 | arm->attributes_len = htons (0); | ||
1862 | GNUNET_MQ_send (ai->client->mq, env); | 1863 | GNUNET_MQ_send (ai->client->mq, env); |
1863 | GNUNET_CONTAINER_DLL_remove (ai->client->attest_iter_head, | 1864 | GNUNET_CONTAINER_DLL_remove (ai->client->attest_iter_head, |
1864 | ai->client->attest_iter_tail, | 1865 | ai->client->attest_iter_tail, |
@@ -1900,10 +1901,11 @@ attest_iter_cb (void *cls, | |||
1900 | { | 1901 | { |
1901 | struct Iterator *ai = cls; | 1902 | struct Iterator *ai = cls; |
1902 | struct GNUNET_MQ_Envelope *env; | 1903 | struct GNUNET_MQ_Envelope *env; |
1904 | struct AttestationResultMessage *arm; | ||
1903 | struct GNUNET_RECLAIM_AttributeList *attrs; | 1905 | struct GNUNET_RECLAIM_AttributeList *attrs; |
1904 | struct GNUNET_RECLAIM_Attestation *att; | 1906 | struct GNUNET_RECLAIM_Attestation *att; |
1905 | char *data_tmp; | 1907 | char *data_tmp; |
1906 | char *attrs_size; | 1908 | size_t attrs_size; |
1907 | 1909 | ||
1908 | if ((rd_count != 1) || | 1910 | if ((rd_count != 1) || |
1909 | (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTESTATION != rd->record_type)) | 1911 | (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTESTATION != rd->record_type)) |
@@ -1915,8 +1917,6 @@ attest_iter_cb (void *cls, | |||
1915 | rd->data_size); | 1917 | rd->data_size); |
1916 | attrs = GNUNET_RECLAIM_attestation_get_attributes (att); | 1918 | attrs = GNUNET_RECLAIM_attestation_get_attributes (att); |
1917 | attrs_size = GNUNET_RECLAIM_attribute_list_serialize_get_size (attrs); | 1919 | attrs_size = GNUNET_RECLAIM_attribute_list_serialize_get_size (attrs); |
1918 | |||
1919 | struct AttestationResultMessage *arm; | ||
1920 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found attestation under: %s\n", | 1920 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found attestation under: %s\n", |
1921 | label); | 1921 | label); |
1922 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1922 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -1926,6 +1926,7 @@ attest_iter_cb (void *cls, | |||
1926 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_RESULT); | 1926 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_RESULT); |
1927 | arm->id = htonl (ai->request_id); | 1927 | arm->id = htonl (ai->request_id); |
1928 | arm->attestation_len = htons (rd->data_size); | 1928 | arm->attestation_len = htons (rd->data_size); |
1929 | arm->attributes_len = htons (attrs_size); | ||
1929 | GNUNET_CRYPTO_ecdsa_key_get_public (zone, &arm->identity); | 1930 | GNUNET_CRYPTO_ecdsa_key_get_public (zone, &arm->identity); |
1930 | data_tmp = (char *) &arm[1]; | 1931 | data_tmp = (char *) &arm[1]; |
1931 | GNUNET_memcpy (data_tmp, rd->data, rd->data_size); | 1932 | GNUNET_memcpy (data_tmp, rd->data, rd->data_size); |
diff --git a/src/reclaim/plugin_rest_reclaim.c b/src/reclaim/plugin_rest_reclaim.c index cddee9b54..cd163e8a4 100644 --- a/src/reclaim/plugin_rest_reclaim.c +++ b/src/reclaim/plugin_rest_reclaim.c | |||
@@ -275,7 +275,8 @@ cleanup_handle (struct RequestHandle *handle) | |||
275 | GNUNET_free (handle->url); | 275 | GNUNET_free (handle->url); |
276 | if (NULL != handle->emsg) | 276 | if (NULL != handle->emsg) |
277 | GNUNET_free (handle->emsg); | 277 | GNUNET_free (handle->emsg); |
278 | GNUNET_RECLAIM_attribute_list_destroy (handle->attr_list); | 278 | if (NULL != handle->attr_list) |
279 | GNUNET_RECLAIM_attribute_list_destroy (handle->attr_list); | ||
279 | for (ego_entry = handle->ego_head; NULL != ego_entry;) | 280 | for (ego_entry = handle->ego_head; NULL != ego_entry;) |
280 | { | 281 | { |
281 | ego_tmp = ego_entry; | 282 | ego_tmp = ego_entry; |
@@ -1029,6 +1030,7 @@ attr_collect (void *cls, | |||
1029 | json_array_append (handle->resp_object, attr_obj); | 1030 | json_array_append (handle->resp_object, attr_obj); |
1030 | json_decref (attr_obj); | 1031 | json_decref (attr_obj); |
1031 | GNUNET_free (tmp_value); | 1032 | GNUNET_free (tmp_value); |
1033 | GNUNET_RECLAIM_get_attributes_next (handle->attr_it); | ||
1032 | } | 1034 | } |
1033 | 1035 | ||
1034 | 1036 | ||
diff --git a/src/reclaim/reclaim_api.c b/src/reclaim/reclaim_api.c index afab33320..5f52aa57b 100644 --- a/src/reclaim/reclaim_api.c +++ b/src/reclaim/reclaim_api.c | |||
@@ -632,7 +632,7 @@ handle_consume_ticket_result (void *cls, | |||
632 | &ale->attestation->id)) | 632 | &ale->attestation->id)) |
633 | { | 633 | { |
634 | op->atr_cb (op->cls, &msg->identity, | 634 | op->atr_cb (op->cls, &msg->identity, |
635 | le->attribute, ale->attestation); | 635 | le->attribute, ale->attestation); |
636 | break; | 636 | break; |
637 | } | 637 | } |
638 | 638 | ||
@@ -641,11 +641,13 @@ handle_consume_ticket_result (void *cls, | |||
641 | else // No attestations | 641 | else // No attestations |
642 | { | 642 | { |
643 | op->atr_cb (op->cls, &msg->identity, | 643 | op->atr_cb (op->cls, &msg->identity, |
644 | le->attribute, NULL); | 644 | le->attribute, NULL); |
645 | } | 645 | } |
646 | } | 646 | } |
647 | GNUNET_RECLAIM_attribute_list_destroy (attrs); | 647 | if (NULL != attrs) |
648 | GNUNET_RECLAIM_attestation_list_destroy (attests); | 648 | GNUNET_RECLAIM_attribute_list_destroy (attrs); |
649 | if (NULL != attests) | ||
650 | GNUNET_RECLAIM_attestation_list_destroy (attests); | ||
649 | attrs = NULL; | 651 | attrs = NULL; |
650 | attests = NULL; | 652 | attests = NULL; |
651 | } | 653 | } |
@@ -775,10 +777,13 @@ check_attestation_result (void *cls, const struct AttestationResultMessage *msg) | |||
775 | { | 777 | { |
776 | size_t msg_len; | 778 | size_t msg_len; |
777 | size_t attr_len; | 779 | size_t attr_len; |
780 | size_t attest_len; | ||
778 | 781 | ||
779 | msg_len = ntohs (msg->header.size); | 782 | msg_len = ntohs (msg->header.size); |
780 | attr_len = ntohs (msg->attestation_len); | 783 | attest_len = ntohs (msg->attestation_len); |
781 | if (msg_len != sizeof(struct AttestationResultMessage) + attr_len) | 784 | attr_len = ntohs (msg->attributes_len); |
785 | if (msg_len != sizeof(struct AttestationResultMessage) | ||
786 | + attr_len + attest_len) | ||
782 | { | 787 | { |
783 | GNUNET_break (0); | 788 | GNUNET_break (0); |
784 | return GNUNET_SYSERR; | 789 | return GNUNET_SYSERR; |
@@ -851,6 +856,7 @@ handle_attestation_result (void *cls, const struct | |||
851 | att = GNUNET_RECLAIM_attestation_deserialize ((char *) &msg[1], att_len); | 856 | att = GNUNET_RECLAIM_attestation_deserialize ((char *) &msg[1], att_len); |
852 | char *read_ptr = ((char *) &msg[1]) + att_len; | 857 | char *read_ptr = ((char *) &msg[1]) + att_len; |
853 | attrs = GNUNET_RECLAIM_attribute_list_deserialize (read_ptr, attrs_len); | 858 | attrs = GNUNET_RECLAIM_attribute_list_deserialize (read_ptr, attrs_len); |
859 | |||
854 | if (NULL != it) | 860 | if (NULL != it) |
855 | { | 861 | { |
856 | if (NULL != it->proc) | 862 | if (NULL != it->proc) |
@@ -862,7 +868,8 @@ handle_attestation_result (void *cls, const struct | |||
862 | op->at_cb (op->cls, &msg->identity, att, attrs); | 868 | op->at_cb (op->cls, &msg->identity, att, attrs); |
863 | } | 869 | } |
864 | GNUNET_free (att); | 870 | GNUNET_free (att); |
865 | GNUNET_RECLAIM_attribute_list_destroy (attrs); | 871 | if (NULL != attrs) |
872 | GNUNET_RECLAIM_attribute_list_destroy (attrs); | ||
866 | return; | 873 | return; |
867 | } | 874 | } |
868 | GNUNET_assert (0); | 875 | GNUNET_assert (0); |
@@ -1429,7 +1436,8 @@ GNUNET_RECLAIM_get_attestations_start ( | |||
1429 | ait->identity = *identity; | 1436 | ait->identity = *identity; |
1430 | GNUNET_CONTAINER_DLL_insert_tail (h->ait_head, h->ait_tail, ait); | 1437 | GNUNET_CONTAINER_DLL_insert_tail (h->ait_head, h->ait_tail, ait); |
1431 | env = | 1438 | env = |
1432 | GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_ITERATION_START); | 1439 | GNUNET_MQ_msg (msg, |
1440 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_ITERATION_START); | ||
1433 | msg->id = htonl (rid); | 1441 | msg->id = htonl (rid); |
1434 | msg->identity = *identity; | 1442 | msg->identity = *identity; |
1435 | if (NULL == h->mq) | 1443 | if (NULL == h->mq) |
@@ -1447,7 +1455,8 @@ GNUNET_RECLAIM_get_attestations_start ( | |||
1447 | * @param it the iterator | 1455 | * @param it the iterator |
1448 | */ | 1456 | */ |
1449 | void | 1457 | void |
1450 | GNUNET_RECLAIM_get_attestations_next (struct GNUNET_RECLAIM_AttestationIterator *ait) | 1458 | GNUNET_RECLAIM_get_attestations_next (struct |
1459 | GNUNET_RECLAIM_AttestationIterator *ait) | ||
1451 | { | 1460 | { |
1452 | struct GNUNET_RECLAIM_Handle *h = ait->h; | 1461 | struct GNUNET_RECLAIM_Handle *h = ait->h; |
1453 | struct AttestationIterationNextMessage *msg; | 1462 | struct AttestationIterationNextMessage *msg; |
@@ -1468,7 +1477,8 @@ GNUNET_RECLAIM_get_attestations_next (struct GNUNET_RECLAIM_AttestationIterator | |||
1468 | * @param it the iterator | 1477 | * @param it the iterator |
1469 | */ | 1478 | */ |
1470 | void | 1479 | void |
1471 | GNUNET_RECLAIM_get_attestations_stop (struct GNUNET_RECLAIM_AttestationIterator *ait) | 1480 | GNUNET_RECLAIM_get_attestations_stop (struct |
1481 | GNUNET_RECLAIM_AttestationIterator *ait) | ||
1472 | { | 1482 | { |
1473 | struct GNUNET_RECLAIM_Handle *h = ait->h; | 1483 | struct GNUNET_RECLAIM_Handle *h = ait->h; |
1474 | struct GNUNET_MQ_Envelope *env; | 1484 | struct GNUNET_MQ_Envelope *env; |
@@ -1477,7 +1487,8 @@ GNUNET_RECLAIM_get_attestations_stop (struct GNUNET_RECLAIM_AttestationIterator | |||
1477 | if (NULL != h->mq) | 1487 | if (NULL != h->mq) |
1478 | { | 1488 | { |
1479 | env = | 1489 | env = |
1480 | GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_ITERATION_STOP); | 1490 | GNUNET_MQ_msg (msg, |
1491 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_ITERATION_STOP); | ||
1481 | msg->id = htonl (ait->r_id); | 1492 | msg->id = htonl (ait->r_id); |
1482 | GNUNET_MQ_send (h->mq, env); | 1493 | GNUNET_MQ_send (h->mq, env); |
1483 | } | 1494 | } |
@@ -1485,7 +1496,6 @@ GNUNET_RECLAIM_get_attestations_stop (struct GNUNET_RECLAIM_AttestationIterator | |||
1485 | } | 1496 | } |
1486 | 1497 | ||
1487 | 1498 | ||
1488 | |||
1489 | /** | 1499 | /** |
1490 | * Issues a ticket to another relying party. The identity may use | 1500 | * Issues a ticket to another relying party. The identity may use |
1491 | * @GNUNET_RECLAIM_ticket_consume to consume the ticket | 1501 | * @GNUNET_RECLAIM_ticket_consume to consume the ticket |