commit 04241527782b71c669c349f64b8bb6a6fe6c7010
parent 9db7a7191aa4df9a0d7e4980cec1146f9ac36244
Author: Christian Grothoff <christian@grothoff.org>
Date: Wed, 7 May 2025 20:36:05 +0200
require merchant_sig to be passed, and do pass it in test cases, to enforce non-NULL constraint
Diffstat:
4 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/src/exchange/taler-exchange-httpd_batch-deposit.c b/src/exchange/taler-exchange-httpd_batch-deposit.c
@@ -904,10 +904,8 @@ bdc_phase_parse (struct BatchDepositContext *bdc,
&bd->wire_salt),
GNUNET_JSON_spec_fixed_auto ("merchant_pub",
&bd->merchant_pub),
- GNUNET_JSON_spec_mark_optional ( /* since v22, we are compatible */
- GNUNET_JSON_spec_fixed_auto ("merchant_sig",
- &bd->merchant_sig),
- NULL),
+ GNUNET_JSON_spec_fixed_auto ("merchant_sig",
+ &bd->merchant_sig),
GNUNET_JSON_spec_fixed_auto ("h_contract_terms",
&bd->h_contract_terms),
GNUNET_JSON_spec_mark_optional (
@@ -954,12 +952,11 @@ bdc_phase_parse (struct BatchDepositContext *bdc,
return;
}
}
- if ( (! GNUNET_is_zero (&bd->merchant_sig)) &&
- (GNUNET_OK !=
- TALER_merchant_contract_verify (
- &bd->h_contract_terms,
- &bd->merchant_pub,
- &bd->merchant_sig)) )
+ if (GNUNET_OK !=
+ TALER_merchant_contract_verify (
+ &bd->h_contract_terms,
+ &bd->merchant_pub,
+ &bd->merchant_sig))
{
GNUNET_break_op (0);
GNUNET_JSON_parse_free (spec);
diff --git a/src/exchange/taler-exchange-httpd_config.h b/src/exchange/taler-exchange-httpd_config.h
@@ -41,7 +41,7 @@
*
* Returned via both /config and /keys endpoints.
*/
-#define EXCHANGE_PROTOCOL_VERSION "27:0:10"
+#define EXCHANGE_PROTOCOL_VERSION "27:0:5"
/**
diff --git a/src/testing/testing_api_cmd_batch_deposit.c b/src/testing/testing_api_cmd_batch_deposit.c
@@ -469,6 +469,9 @@ batch_deposit_run (void *cls,
.refund_deadline = ds->refund_deadline
};
+ TALER_merchant_contract_sign (&h_contract_terms,
+ &ds->account_priv.merchant_priv,
+ &dcd.merchant_sig);
ds->dh = TALER_EXCHANGE_batch_deposit (
TALER_TESTING_interpreter_get_context (is),
exchange_url,
diff --git a/src/testing/testing_api_cmd_deposit.c b/src/testing/testing_api_cmd_deposit.c
@@ -559,6 +559,9 @@ deposit_run (void *cls,
.refund_deadline = ds->refund_deadline
};
+ TALER_merchant_contract_sign (&h_contract_terms,
+ &ds->account_priv.merchant_priv,
+ &dcd.merchant_sig);
if (NULL != phac)
cdd.h_age_commitment = *phac;