diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-02-07 21:15:59 +0100 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-02-09 20:38:11 +0100 |
commit | e8ea1f3e34e2a07cbe2fd4725e7362027d0c51c3 (patch) | |
tree | 5b11a525700872147d92d8195615e4352d6d18b1 /src/reclaim/reclaim_api.c | |
parent | 5f9f9cae1714eb33e0ee9c824f3d88e6aab8cf63 (diff) | |
download | gnunet-e8ea1f3e34e2a07cbe2fd4725e7362027d0c51c3.tar.gz gnunet-e8ea1f3e34e2a07cbe2fd4725e7362027d0c51c3.zip |
add expiration
Diffstat (limited to 'src/reclaim/reclaim_api.c')
-rw-r--r-- | src/reclaim/reclaim_api.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/reclaim/reclaim_api.c b/src/reclaim/reclaim_api.c index 8558b19df..b863789a2 100644 --- a/src/reclaim/reclaim_api.c +++ b/src/reclaim/reclaim_api.c | |||
@@ -779,14 +779,11 @@ static int | |||
779 | check_attestation_result (void *cls, const struct AttestationResultMessage *msg) | 779 | check_attestation_result (void *cls, const struct AttestationResultMessage *msg) |
780 | { | 780 | { |
781 | size_t msg_len; | 781 | size_t msg_len; |
782 | size_t attr_len; | ||
783 | size_t attest_len; | 782 | size_t attest_len; |
784 | 783 | ||
785 | msg_len = ntohs (msg->header.size); | 784 | msg_len = ntohs (msg->header.size); |
786 | attest_len = ntohs (msg->attestation_len); | 785 | attest_len = ntohs (msg->attestation_len); |
787 | attr_len = ntohs (msg->attributes_len); | 786 | if (msg_len != sizeof(struct AttestationResultMessage) + attest_len) |
788 | if (msg_len != sizeof(struct AttestationResultMessage) | ||
789 | + attr_len + attest_len) | ||
790 | { | 787 | { |
791 | GNUNET_break (0); | 788 | GNUNET_break (0); |
792 | return GNUNET_SYSERR; | 789 | return GNUNET_SYSERR; |
@@ -809,14 +806,11 @@ handle_attestation_result (void *cls, const struct | |||
809 | static struct GNUNET_CRYPTO_EcdsaPrivateKey identity_dummy; | 806 | static struct GNUNET_CRYPTO_EcdsaPrivateKey identity_dummy; |
810 | struct GNUNET_RECLAIM_Handle *h = cls; | 807 | struct GNUNET_RECLAIM_Handle *h = cls; |
811 | struct GNUNET_RECLAIM_AttestationIterator *it; | 808 | struct GNUNET_RECLAIM_AttestationIterator *it; |
812 | struct GNUNET_RECLAIM_AttributeList *attrs; | ||
813 | struct GNUNET_RECLAIM_Operation *op; | 809 | struct GNUNET_RECLAIM_Operation *op; |
814 | size_t att_len; | 810 | size_t att_len; |
815 | size_t attrs_len; | ||
816 | uint32_t r_id = ntohl (msg->id); | 811 | uint32_t r_id = ntohl (msg->id); |
817 | 812 | ||
818 | att_len = ntohs (msg->attestation_len); | 813 | att_len = ntohs (msg->attestation_len); |
819 | attrs_len = ntohs (msg->attributes_len); | ||
820 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing attestation result.\n"); | 814 | LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing attestation result.\n"); |
821 | 815 | ||
822 | 816 | ||
@@ -847,7 +841,7 @@ handle_attestation_result (void *cls, const struct | |||
847 | if (NULL != op) | 841 | if (NULL != op) |
848 | { | 842 | { |
849 | if (NULL != op->at_cb) | 843 | if (NULL != op->at_cb) |
850 | op->at_cb (op->cls, NULL, NULL, NULL); | 844 | op->at_cb (op->cls, NULL, NULL); |
851 | GNUNET_CONTAINER_DLL_remove (h->op_head, h->op_tail, op); | 845 | GNUNET_CONTAINER_DLL_remove (h->op_head, h->op_tail, op); |
852 | free_op (op); | 846 | free_op (op); |
853 | } | 847 | } |
@@ -857,22 +851,18 @@ handle_attestation_result (void *cls, const struct | |||
857 | { | 851 | { |
858 | struct GNUNET_RECLAIM_Attestation *att; | 852 | struct GNUNET_RECLAIM_Attestation *att; |
859 | att = GNUNET_RECLAIM_attestation_deserialize ((char *) &msg[1], att_len); | 853 | att = GNUNET_RECLAIM_attestation_deserialize ((char *) &msg[1], att_len); |
860 | char *read_ptr = ((char *) &msg[1]) + att_len; | ||
861 | attrs = GNUNET_RECLAIM_attribute_list_deserialize (read_ptr, attrs_len); | ||
862 | 854 | ||
863 | if (NULL != it) | 855 | if (NULL != it) |
864 | { | 856 | { |
865 | if (NULL != it->proc) | 857 | if (NULL != it->proc) |
866 | it->proc (it->proc_cls, &msg->identity, att, attrs); | 858 | it->proc (it->proc_cls, &msg->identity, att); |
867 | } | 859 | } |
868 | else if (NULL != op) | 860 | else if (NULL != op) |
869 | { | 861 | { |
870 | if (NULL != op->at_cb) | 862 | if (NULL != op->at_cb) |
871 | op->at_cb (op->cls, &msg->identity, att, attrs); | 863 | op->at_cb (op->cls, &msg->identity, att); |
872 | } | 864 | } |
873 | GNUNET_free (att); | 865 | GNUNET_free (att); |
874 | if (NULL != attrs) | ||
875 | GNUNET_RECLAIM_attribute_list_destroy (attrs); | ||
876 | return; | 866 | return; |
877 | } | 867 | } |
878 | GNUNET_assert (0); | 868 | GNUNET_assert (0); |