diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-02-04 23:34:10 +0100 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-02-09 20:38:10 +0100 |
commit | 5fb277e8d012d687f4d2d032571cd4b57946bbfb (patch) | |
tree | 2387ee8a40ef9d308e6d34ebd0f8af0dc90feb5f /src/reclaim/gnunet-service-reclaim.c | |
parent | 065ecd9a0f92ecafd6c552494a6310b92cc08597 (diff) | |
download | gnunet-5fb277e8d012d687f4d2d032571cd4b57946bbfb.tar.gz gnunet-5fb277e8d012d687f4d2d032571cd4b57946bbfb.zip |
towards better API
Diffstat (limited to 'src/reclaim/gnunet-service-reclaim.c')
-rw-r--r-- | src/reclaim/gnunet-service-reclaim.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/reclaim/gnunet-service-reclaim.c b/src/reclaim/gnunet-service-reclaim.c index 61d029665..99831172b 100644 --- a/src/reclaim/gnunet-service-reclaim.c +++ b/src/reclaim/gnunet-service-reclaim.c | |||
@@ -1900,7 +1900,10 @@ attest_iter_cb (void *cls, | |||
1900 | { | 1900 | { |
1901 | struct Iterator *ai = cls; | 1901 | struct Iterator *ai = cls; |
1902 | struct GNUNET_MQ_Envelope *env; | 1902 | struct GNUNET_MQ_Envelope *env; |
1903 | struct GNUNET_RECLAIM_AttributeList *attrs; | ||
1904 | struct GNUNET_RECLAIM_Attestation *att; | ||
1903 | char *data_tmp; | 1905 | char *data_tmp; |
1906 | char *attrs_size; | ||
1904 | 1907 | ||
1905 | if ((rd_count != 1) || | 1908 | if ((rd_count != 1) || |
1906 | (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTESTATION != rd->record_type)) | 1909 | (GNUNET_GNSRECORD_TYPE_RECLAIM_ATTESTATION != rd->record_type)) |
@@ -1908,6 +1911,10 @@ attest_iter_cb (void *cls, | |||
1908 | GNUNET_NAMESTORE_zone_iterator_next (ai->ns_it, 1); | 1911 | GNUNET_NAMESTORE_zone_iterator_next (ai->ns_it, 1); |
1909 | return; | 1912 | return; |
1910 | } | 1913 | } |
1914 | att = GNUNET_RECLAIM_attestation_deserialize (rd->data, | ||
1915 | rd->data_size); | ||
1916 | attrs = GNUNET_RECLAIM_attestation_get_attributes (att); | ||
1917 | attrs_size = GNUNET_RECLAIM_attribute_list_serialize_get_size (attrs); | ||
1911 | 1918 | ||
1912 | struct AttestationResultMessage *arm; | 1919 | struct AttestationResultMessage *arm; |
1913 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found attestation under: %s\n", | 1920 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Found attestation under: %s\n", |
@@ -1915,13 +1922,17 @@ attest_iter_cb (void *cls, | |||
1915 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1922 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1916 | "Sending ATTESTATION_RESULT message\n"); | 1923 | "Sending ATTESTATION_RESULT message\n"); |
1917 | env = GNUNET_MQ_msg_extra (arm, | 1924 | env = GNUNET_MQ_msg_extra (arm, |
1918 | rd->data_size, | 1925 | rd->data_size + attrs_size, |
1919 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_RESULT); | 1926 | GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_RESULT); |
1920 | arm->id = htonl (ai->request_id); | 1927 | arm->id = htonl (ai->request_id); |
1921 | arm->attestation_len = htons (rd->data_size); | 1928 | arm->attestation_len = htons (rd->data_size); |
1922 | GNUNET_CRYPTO_ecdsa_key_get_public (zone, &arm->identity); | 1929 | GNUNET_CRYPTO_ecdsa_key_get_public (zone, &arm->identity); |
1923 | data_tmp = (char *) &arm[1]; | 1930 | data_tmp = (char *) &arm[1]; |
1924 | GNUNET_memcpy (data_tmp, rd->data, rd->data_size); | 1931 | GNUNET_memcpy (data_tmp, rd->data, rd->data_size); |
1932 | data_tmp += rd->data_size; | ||
1933 | GNUNET_RECLAIM_attribute_list_serialize (attrs, | ||
1934 | data_tmp); | ||
1935 | |||
1925 | GNUNET_MQ_send (ai->client->mq, env); | 1936 | GNUNET_MQ_send (ai->client->mq, env); |
1926 | } | 1937 | } |
1927 | 1938 | ||