donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

commit 75417f94c117a7ee6210eefec576ceac7762a9ca
parent 1bcb159fc7671acfb1862b8b7d52a021c2e3d54d
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
Date:   Mon, 29 Apr 2024 00:11:54 +0200

cleanup

Diffstat:
Msrc/include/donau_service.h | 2+-
Msrc/lib/donau_api_batch_issue_receipts.c | 57++++++++++++++++++++++++++-------------------------------
Msrc/testing/testing_api_cmd_issue_receipts.c | 3+--
3 files changed, 28 insertions(+), 34 deletions(-)

diff --git a/src/include/donau_service.h b/src/include/donau_service.h @@ -469,7 +469,7 @@ struct DONAU_BatchIssueResponse */ struct { - + /** * Blind signature provided by the donau */ diff --git a/src/lib/donau_api_batch_issue_receipts.c b/src/lib/donau_api_batch_issue_receipts.c @@ -117,8 +117,7 @@ handle_batch_issue_ok (const json_t *resp_obj, GNUNET_break_op (0); return GNUNET_SYSERR; } -// const unsigned long long num_du_sigs -// = json_array_size (j_blind_signatures); + if ( (NULL == j_blind_signatures) || (! json_is_array (j_blind_signatures)) || (birh->num_blinded_sigs != json_array_size (j_blind_signatures)) ) @@ -126,39 +125,35 @@ handle_batch_issue_ok (const json_t *resp_obj, GNUNET_break (0); return GNUNET_SYSERR; } -// if (0 != num_du_sigs) -// { biresp->details.ok.blinded_sigs = - GNUNET_malloc(sizeof(struct DONAU_BlindedDonationUnitSignature) - * birh->num_blinded_sigs); - struct DONAU_BlindedDonationUnitSignature du_sigs[birh->num_blinded_sigs]; - size_t index; - json_t *du_sig_obj; - json_array_foreach (j_blind_signatures, - index, - du_sig_obj) + GNUNET_malloc (sizeof(struct DONAU_BlindedDonationUnitSignature) + * birh->num_blinded_sigs); + struct DONAU_BlindedDonationUnitSignature du_sigs[birh->num_blinded_sigs]; + size_t index; + json_t *du_sig_obj; + json_array_foreach (j_blind_signatures, + index, + du_sig_obj) + { + struct GNUNET_JSON_Specification spec[] = { + DONAU_JSON_spec_blinded_donation_unit_sig ("blinded_signature", + &biresp->details.ok. + blinded_sigs[index]), + GNUNET_JSON_spec_end () + }; + if (GNUNET_OK != + GNUNET_JSON_parse (du_sig_obj, + spec, + NULL, + NULL)) { - struct GNUNET_JSON_Specification spec[] = { - DONAU_JSON_spec_blinded_donation_unit_sig ("blinded_signature", - &biresp->details.ok.blinded_sigs[index]), - GNUNET_JSON_spec_end () - }; - if (GNUNET_OK != - GNUNET_JSON_parse (du_sig_obj, - spec, - NULL, - NULL)) - { - GNUNET_break_op (0); - for (size_t i = 0; i<index; i++) - DONAU_blinded_donation_unit_sig_free (&du_sigs[i]); - return GNUNET_SYSERR; - } -// GNUNET_memcpy(&biresp->details.ok.blinded_sigs[index], &du_sigs[index], -// sizeof(struct DONAU_BlindedDonationUnitSignature)); + GNUNET_break_op (0); + for (size_t i = 0; i<index; i++) + DONAU_blinded_donation_unit_sig_free (&du_sigs[i]); + return GNUNET_SYSERR; } + } - //} birh->cb (birh->cb_cls, biresp); birh->cb = NULL; diff --git a/src/testing/testing_api_cmd_issue_receipts.c b/src/testing/testing_api_cmd_issue_receipts.c @@ -115,9 +115,8 @@ issue_receipts_status_cb (void *cls, TALER_TESTING_interpreter_fail (ss->is); return; } - //struct DONAU_BlindedDonationUnitSignature *blinded_sigs = biresp->details.ok.blinded_sigs; + // struct DONAU_BlindedDonationUnitSignature *blinded_sigs = biresp->details.ok.blinded_sigs; - //GNUNET_free (blinded_sigs); TALER_TESTING_interpreter_next (ss->is); }