merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 30f8c2c12367cbc39af5a751c7834f6e0aed58d1
parent 409434523d7740d2707395096f62717fbffa9b09
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Sun, 10 Aug 2025 16:45:02 +0200

fix PQ type, do not write pointers into the DB...

Diffstat:
Mdebian/taler-merchant.taler-merchant-donaukeyupdate.service | 1+
Msrc/backenddb/merchant-0023.sql | 5++---
Msrc/backenddb/pg_insert_order_blinded_sigs.c | 7+++++--
Msrc/backenddb/pg_select_order_blinded_sigs.c | 15++++++++-------
4 files changed, 16 insertions(+), 12 deletions(-)

diff --git a/debian/taler-merchant.taler-merchant-donaukeyupdate.service b/debian/taler-merchant.taler-merchant-donaukeyupdate.service @@ -1,6 +1,7 @@ [Unit] Description=GNU Taler merchant donau configuration data download service After=postgres.service +ConditionPathExists=/usr/bin/taler-merchant-donaukeyupdate [Service] User=taler-merchant-httpd diff --git a/src/backenddb/merchant-0023.sql b/src/backenddb/merchant-0023.sql @@ -77,7 +77,7 @@ CREATE TABLE IF NOT EXISTS merchant_order_token_blinded_sigs (order_token_bs_serial BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY ,order_serial BIGINT NOT NULL REFERENCES merchant_contract_terms (order_serial) ON DELETE CASCADE - ,token_blinded_signature BYTEA NOT NULL CHECK (LENGTH(token_blinded_signature)=48) + ,token_blinded_signature BYTEA NOT NULL ,token_hash BYTEA NOT NULL CHECK (LENGTH(token_hash)=64) ); @@ -91,4 +91,4 @@ COMMENT ON COLUMN merchant_order_token_blinded_sigs.token_blinded_signature IS 'Blinded signature of the token associated with the order'; COMMENT ON COLUMN merchant_order_token_blinded_sigs.token_hash IS 'Hash of the token'; -COMMIT; -\ No newline at end of file +COMMIT; diff --git a/src/backenddb/pg_insert_order_blinded_sigs.c b/src/backenddb/pg_insert_order_blinded_sigs.c @@ -36,7 +36,7 @@ TMH_PG_insert_order_blinded_sigs ( struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_string (order_id), GNUNET_PQ_query_param_auto_from_type (hash), - GNUNET_PQ_query_param_auto_from_type (blind_sig), + GNUNET_PQ_query_param_blinded_sig (blind_sig), GNUNET_PQ_query_param_end }; @@ -44,7 +44,10 @@ TMH_PG_insert_order_blinded_sigs ( PREPARE (pg, "insert_blinded_sigs", "INSERT INTO merchant_order_token_blinded_sigs" - " (order_serial, token_hash, token_blinded_signature)" + " (order_serial" + " , token_hash" + " ,token_blinded_signature" + ")" " SELECT order_serial, $2, $3" " FROM merchant_contract_terms" " WHERE order_id = $1"); diff --git a/src/backenddb/pg_select_order_blinded_sigs.c b/src/backenddb/pg_select_order_blinded_sigs.c @@ -64,25 +64,26 @@ restore_sig_cb (void *cls, for (unsigned int i = 0; i < num_results; i++) { struct GNUNET_HashCode h_issue; - struct GNUNET_CRYPTO_BlindedSignature sig; + struct GNUNET_CRYPTO_BlindedSignature *sig; struct GNUNET_PQ_ResultSpec rs[] = { GNUNET_PQ_result_spec_auto_from_type ("token_hash", &h_issue), - GNUNET_PQ_result_spec_auto_from_type ("token_blinded_signature", - &sig), + GNUNET_PQ_result_spec_blinded_sig ("token_blinded_signature", + &sig), GNUNET_PQ_result_spec_end }; - if (GNUNET_OK != GNUNET_PQ_extract_result (result, - rs, - i)) + if (GNUNET_OK != + GNUNET_PQ_extract_result (result, + rs, + i)) { ctx->qs = GNUNET_DB_STATUS_HARD_ERROR; return; } ctx->cb (ctx->cb_cls, &h_issue, - &sig); + sig); GNUNET_PQ_cleanup_result (rs); } }