commit adc9985a580c106b5ab1fe268646632caf4b9f11
parent 28ccd7d082392e36a899a7f4d06bb357a2d329d8
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
Date: Sat, 1 Jun 2024 16:58:06 +0200
some changes
Diffstat:
5 files changed, 35 insertions(+), 20 deletions(-)
diff --git a/src/donau/donau-httpd_donation-statement.c b/src/donau/donau-httpd_donation-statement.c
@@ -71,6 +71,10 @@ DH_handler_donation_statement_get (
"h_donor_tax_id");
}
+ for(unsigned int i = 0; i < 16; i++)
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "The parsed id hash part %d on server side: %d\n",i, h_donor_tax_id.hash.bits[i]);
+
{
struct TALER_Amount total_donations;
struct DONAU_DonauPublicKeyP donau_pub;
@@ -100,19 +104,21 @@ DH_handler_donation_statement_get (
0);
break;
case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT:
- if (TALER_EC_NONE !=
- DONAU_donation_statement_sign (
+ enum TALER_ErrorCode ec;
+ ec = DONAU_donation_statement_sign (
&DH_keys_donau_sign_,
&total_donations,
donation_year,
&h_donor_tax_id,
&donau_pub,
- &donau_sig))
+ &donau_sig);
+
+ if (TALER_EC_NONE != ec)
{
GNUNET_break (0);
return TALER_MHD_reply_with_error (rc->connection,
MHD_HTTP_INTERNAL_SERVER_ERROR,
- TALER_EC_GENERIC_DB_FETCH_FAILED,
+ ec,
NULL);
}
break;
diff --git a/src/donau/donau-httpd_keys.c b/src/donau/donau-httpd_keys.c
@@ -1282,7 +1282,7 @@ DH_keys_donau_sign_ (
// sizeof (*sig));
// return TALER_EC_DONAU_SIGNKEY_HELPER_BUG;
// }
- //}
+ // }
return ec;
}
diff --git a/src/donaudb/pg_iterate_submitted_receipts.c b/src/donaudb/pg_iterate_submitted_receipts.c
@@ -38,7 +38,7 @@ DH_PG_iterate_submitted_receipts (
struct PostgresClosure *pg = cls;
struct GNUNET_PQ_QueryParam params[] = {
GNUNET_PQ_query_param_uint64 (&donation_year),
- //GNUNET_PQ_query_param_auto_from_type (&h_donor_tax_id),
+ // GNUNET_PQ_query_param_auto_from_type (&h_donor_tax_id),
GNUNET_PQ_query_param_end
};
uint64_t valueSum = 0;
@@ -60,7 +60,7 @@ DH_PG_iterate_submitted_receipts (
" FROM receipts_submitted ref"
" JOIN donation_units USING (h_donation_unit_pub)"
" WHERE donation_year=$1");
- //" AND h_tax_number=$2");
+ // " AND h_tax_number=$2");
qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn,
"lookup_submitted_receipts",
params,
diff --git a/src/lib/donau_api_donation_statement_get.c b/src/lib/donau_api_donation_statement_get.c
@@ -100,8 +100,8 @@ handle_donation_statement_get_finished (void *cls,
&dsresp.details.ok.donation_statement_sig),
TALER_JSON_spec_amount_any ("total",
&dsresp.details.ok.total_amount),
- GNUNET_JSON_spec_fixed_auto("donau_pub",
- &dsresp.details.ok.donau_pub),
+ GNUNET_JSON_spec_fixed_auto ("donau_pub",
+ &dsresp.details.ok.donau_pub),
GNUNET_JSON_spec_end ()
};
if (GNUNET_OK !=
@@ -172,7 +172,7 @@ prepare_url (
const char *donau_url)
{
char arg_str[sizeof (struct DONAU_HashDonorTaxId) * 2 + 32];
- char donor_id_hash_str[sizeof (struct DONAU_HashDonorTaxId) * 2 + 32];
+ char donor_id_hash_str[sizeof (struct DONAU_HashDonorTaxId) * 2];
char *end;
end = GNUNET_STRINGS_data_to_string (
@@ -215,6 +215,10 @@ DONAU_donation_statement_get (
TALER_LOG_DEBUG ("Connecting to the donau (%s)\n",
url);
+
+ for(unsigned int i = 0; i < 16; i++)
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "The parsed id hash part %d on client side: %d\n",i, h_donor_tax_id->hash.bits[i]);
dsgh = GNUNET_new (struct DONAU_DonationStatementGetHandle);
// dsgh->url = GNUNET_strdup (url);
dsgh->cb = cb;
diff --git a/src/testing/testing_api_cmd_donation_statement_get.c b/src/testing/testing_api_cmd_donation_statement_get.c
@@ -65,7 +65,7 @@ struct StatusState
*/
static void
donation_statement_status_cb (void *cls,
- const struct DONAU_DonationStatementResponse *dsr)
+ const struct DONAU_DonationStatementResponse *dsr)
{
struct StatusState *ss = cls;
@@ -84,15 +84,20 @@ donation_statement_status_cb (void *cls,
return;
}
ss->donation_statement.total_amount = dsr->details.ok.total_amount;
- ss->donation_statement.donation_statement_sig = dsr->details.ok.donation_statement_sig;
- if (GNUNET_OK != DONAU_donation_statement_verify(&ss->donation_statement.total_amount,
- ss->donation_statement.year,
- ss->donation_statement.h_donor_tax_id,
- &dsr->details.ok.donau_pub,
- &ss->donation_statement.donation_statement_sig)) {
- GNUNET_break (0);
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Verify donation statement signature failed!");
+ ss->donation_statement.donation_statement_sig =
+ dsr->details.ok.donation_statement_sig;
+ if (GNUNET_OK != DONAU_donation_statement_verify (
+ &ss->donation_statement.total_amount,
+ ss->donation_statement.year,
+ ss->donation_statement.
+ h_donor_tax_id,
+ &dsr->details.ok.donau_pub,
+ &ss->donation_statement.
+ donation_statement_sig))
+ {
+ GNUNET_break (0);
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Verify donation statement signature failed!");
}
TALER_TESTING_interpreter_next (ss->is);
}