diff options
author | Markus Voggenreiter <Markus.Voggenreiter@tum.de> | 2019-10-19 11:30:24 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-01-13 13:31:02 +0100 |
commit | 4eda8d33675ba1e004792635b33342c04c5cbe32 (patch) | |
tree | 93eab84b3b93dace71ec4f31988991abcd692a2d /src/reclaim/gnunet-service-reclaim.c | |
parent | 483bc7e3095dff908fe8c032ea96995d44304868 (diff) | |
download | gnunet-4eda8d33675ba1e004792635b33342c04c5cbe32.tar.gz gnunet-4eda8d33675ba1e004792635b33342c04c5cbe32.zip |
Listing Attestations through service
Diffstat (limited to 'src/reclaim/gnunet-service-reclaim.c')
-rw-r--r-- | src/reclaim/gnunet-service-reclaim.c | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/src/reclaim/gnunet-service-reclaim.c b/src/reclaim/gnunet-service-reclaim.c index 7929d36d9..45b2a57c5 100644 --- a/src/reclaim/gnunet-service-reclaim.c +++ b/src/reclaim/gnunet-service-reclaim.c | |||
@@ -1616,7 +1616,7 @@ attr_iter_error (void *cls) | |||
1616 | 1616 | ||
1617 | 1617 | ||
1618 | /** | 1618 | /** |
1619 | * Got record. Return if it is an attribute. | 1619 | * Got record. Return if it is an attribute or attestation. |
1620 | * | 1620 | * |
1621 | * @param cls our attribute iterator | 1621 | * @param cls our attribute iterator |
1622 | * @param zone zone we are iterating | 1622 | * @param zone zone we are iterating |
@@ -1642,22 +1642,43 @@ attr_iter_cb (void *cls, | |||
1642 | return; | 1642 | return; |
1643 | } | 1643 | } |
1644 | 1644 | ||
1645 | if (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR != rd->record_type) | 1645 | if ((GNUNET_GNSRECORD_TYPE_RECLAIM_ATTR != rd->record_type) && |
1646 | (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTEST_ATTR != rd->record_type) ) | ||
1646 | { | 1647 | { |
1647 | GNUNET_NAMESTORE_zone_iterator_next (ai->ns_it, 1); | 1648 | GNUNET_NAMESTORE_zone_iterator_next (ai->ns_it, 1); |
1648 | return; | 1649 | return; |
1649 | } | 1650 | } |
1650 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found attribute under: %s\n", label); | 1651 | |
1651 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending ATTRIBUTE_RESULT message\n"); | 1652 | if (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTEST_ATTR == rd->record_type ) |
1652 | env = GNUNET_MQ_msg_extra (arm, | 1653 | { |
1653 | rd->data_size, | 1654 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found attestation under: %s\n", |
1654 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT); | 1655 | label); |
1655 | arm->id = htonl (ai->request_id); | 1656 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1656 | arm->attr_len = htons (rd->data_size); | 1657 | "Sending ATTESTATION_RESULT message\n"); |
1657 | GNUNET_CRYPTO_ecdsa_key_get_public (zone, &arm->identity); | 1658 | env = GNUNET_MQ_msg_extra (arm, |
1658 | data_tmp = (char *) &arm[1]; | 1659 | rd->data_size, |
1659 | GNUNET_memcpy (data_tmp, rd->data, rd->data_size); | 1660 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_RESULT); |
1660 | GNUNET_MQ_send (ai->client->mq, env); | 1661 | arm->id = htonl (ai->request_id); |
1662 | arm->attr_len = htons (rd->data_size); | ||
1663 | GNUNET_CRYPTO_ecdsa_key_get_public (zone, &arm->identity); | ||
1664 | data_tmp = (char *) &arm[1]; | ||
1665 | GNUNET_memcpy (data_tmp, rd->data, rd->data_size); | ||
1666 | GNUNET_MQ_send (ai->client->mq, env); | ||
1667 | } | ||
1668 | else | ||
1669 | { | ||
1670 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found attribute under: %s\n", label); | ||
1671 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending ATTRIBUTE_RESULT message\n"); | ||
1672 | env = GNUNET_MQ_msg_extra (arm, | ||
1673 | rd->data_size, | ||
1674 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT); | ||
1675 | arm->id = htonl (ai->request_id); | ||
1676 | arm->attr_len = htons (rd->data_size); | ||
1677 | GNUNET_CRYPTO_ecdsa_key_get_public (zone, &arm->identity); | ||
1678 | data_tmp = (char *) &arm[1]; | ||
1679 | GNUNET_memcpy (data_tmp, rd->data, rd->data_size); | ||
1680 | GNUNET_MQ_send (ai->client->mq, env); | ||
1681 | } | ||
1661 | } | 1682 | } |
1662 | 1683 | ||
1663 | 1684 | ||