aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/exchange/taler-exchange-httpd_purses_create.c1
-rw-r--r--src/exchange/taler-exchange-httpd_purses_deposit.c8
-rw-r--r--src/exchange/taler-exchange-httpd_reserves_purse.c1
-rw-r--r--src/exchangedb/exchange-0001-part.sql1
-rw-r--r--src/include/taler_crypto_lib.h2
-rw-r--r--src/include/taler_exchange_service.h7
-rw-r--r--src/lib/exchange_api_purse_create_with_deposit.c1
-rw-r--r--src/lib/exchange_api_purse_deposit.c3
-rw-r--r--src/testing/test_exchange_p2p.c4
-rw-r--r--src/testing/testing_api_cmd_common.c7
-rw-r--r--src/testing/testing_api_cmd_purse_deposit.c13
-rw-r--r--src/testing/testing_api_cmd_reserve_purse.c8
-rw-r--r--src/util/exchange_signatures.c9
13 files changed, 27 insertions, 38 deletions
diff --git a/src/exchange/taler-exchange-httpd_purses_create.c b/src/exchange/taler-exchange-httpd_purses_create.c
index f8293981c..dba4fa4ae 100644
--- a/src/exchange/taler-exchange-httpd_purses_create.c
+++ b/src/exchange/taler-exchange-httpd_purses_create.c
@@ -176,7 +176,6 @@ reply_create_success (struct MHD_Connection *connection,
&pcc->amount,
&pcc->deposit_total,
pcc->purse_pub,
- &pcc->merge_pub,
&pcc->h_contract_terms,
&pub,
&sig)))
diff --git a/src/exchange/taler-exchange-httpd_purses_deposit.c b/src/exchange/taler-exchange-httpd_purses_deposit.c
index 38bd84729..f1f6ecabf 100644
--- a/src/exchange/taler-exchange-httpd_purses_deposit.c
+++ b/src/exchange/taler-exchange-httpd_purses_deposit.c
@@ -98,11 +98,6 @@ struct PurseDepositContext
struct GNUNET_TIME_Timestamp purse_expiration;
/**
- * Key with the merge capability (needed for signing).
- */
- struct TALER_PurseMergePublicKeyP merge_pub;
-
- /**
* Hash of the contract (needed for signing).
*/
struct TALER_PrivateContractHashP h_contract_terms;
@@ -152,7 +147,6 @@ reply_deposit_success (struct MHD_Connection *connection,
&pcc->amount,
&pcc->deposit_total,
pcc->purse_pub,
- &pcc->merge_pub,
&pcc->h_contract_terms,
&pub,
&sig)))
@@ -175,8 +169,6 @@ reply_deposit_success (struct MHD_Connection *connection,
pcc->purse_expiration),
GNUNET_JSON_pack_data_auto ("h_contract_terms",
&pcc->h_contract_terms),
- GNUNET_JSON_pack_data_auto ("merge_pub",
- &pcc->merge_pub),
GNUNET_JSON_pack_data_auto ("exchange_sig",
&sig),
GNUNET_JSON_pack_data_auto ("exchange_pub",
diff --git a/src/exchange/taler-exchange-httpd_reserves_purse.c b/src/exchange/taler-exchange-httpd_reserves_purse.c
index 77321b2c5..b4035b55c 100644
--- a/src/exchange/taler-exchange-httpd_reserves_purse.c
+++ b/src/exchange/taler-exchange-httpd_reserves_purse.c
@@ -165,7 +165,6 @@ reply_purse_success (struct MHD_Connection *connection,
&rpc->amount,
&rpc->deposit_total,
&rpc->purse_pub,
- &rpc->merge_pub,
&rpc->h_contract_terms,
&pub,
&sig)))
diff --git a/src/exchangedb/exchange-0001-part.sql b/src/exchangedb/exchange-0001-part.sql
index 21810034e..9b9828fe9 100644
--- a/src/exchangedb/exchange-0001-part.sql
+++ b/src/exchangedb/exchange-0001-part.sql
@@ -3071,6 +3071,7 @@ ELSE
WHERE reserve_pub=my_reserve_pub;
-- ... and mark purse as finished.
+ -- FIXME: combine with UPDATE above?
UPDATE purse_requests
SET finished=true
WHERE purse_pub=in_purse_pub;
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index 3c413aaf6..5cc28db01 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -3974,7 +3974,6 @@ TALER_exchange_online_purse_created_sign (
const struct TALER_Amount *amount_without_fee,
const struct TALER_Amount *total_deposited,
const struct TALER_PurseContractPublicKeyP *purse_pub,
- const struct TALER_PurseMergePublicKeyP *merge_pub,
const struct TALER_PrivateContractHashP *h_contract_terms,
struct TALER_ExchangePublicKeyP *pub,
struct TALER_ExchangeSignatureP *sig);
@@ -3987,7 +3986,6 @@ TALER_exchange_online_purse_created_verify (
const struct TALER_Amount *amount_without_fee,
const struct TALER_Amount *total_deposited,
const struct TALER_PurseContractPublicKeyP *purse_pub,
- const struct TALER_PurseMergePublicKeyP *merge_pub,
const struct TALER_PrivateContractHashP *h_contract_terms,
const struct TALER_ExchangePublicKeyP *pub,
const struct TALER_ExchangeSignatureP *sig);
diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h
index 634e78324..ecb74bd6f 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -4240,7 +4240,7 @@ TALER_EXCHANGE_purse_get (
/**
- * Cancel #TALER_EXCHANGE_purse_deposit() operation.
+ * Cancel #TALER_EXCHANGE_purse_get() operation.
*
* @param pgh handle of the operation to cancel
*/
@@ -4628,11 +4628,6 @@ struct TALER_EXCHANGE_PurseDepositResponse
*/
struct TALER_PrivateContractHashP h_contract_terms;
- /**
- * Key with the merge capability (needed to verify signature).
- */
- struct TALER_PurseMergePublicKeyP merge_pub;
-
} success;
} details;
diff --git a/src/lib/exchange_api_purse_create_with_deposit.c b/src/lib/exchange_api_purse_create_with_deposit.c
index 60f0f7361..42dd6914b 100644
--- a/src/lib/exchange_api_purse_create_with_deposit.c
+++ b/src/lib/exchange_api_purse_create_with_deposit.c
@@ -170,7 +170,6 @@ handle_purse_create_deposit_finished (void *cls,
&pch->purse_value_after_fees,
&total_deposited,
&pch->purse_pub,
- &pch->merge_pub,
&pch->h_contract_terms,
&exchange_pub,
&exchange_sig))
diff --git a/src/lib/exchange_api_purse_deposit.c b/src/lib/exchange_api_purse_deposit.c
index 67f5355d9..3ed523b64 100644
--- a/src/lib/exchange_api_purse_deposit.c
+++ b/src/lib/exchange_api_purse_deposit.c
@@ -152,8 +152,6 @@ handle_purse_deposit_finished (void *cls,
&exchange_sig),
GNUNET_JSON_spec_fixed_auto ("exchange_pub",
&exchange_pub),
- GNUNET_JSON_spec_fixed_auto ("merge_pub",
- &dr.details.success.merge_pub),
GNUNET_JSON_spec_fixed_auto ("h_contract_terms",
&dr.details.success.h_contract_terms),
GNUNET_JSON_spec_timestamp ("exchange_timestamp",
@@ -195,7 +193,6 @@ handle_purse_deposit_finished (void *cls,
&dr.details.success.purse_value_after_fees,
&dr.details.success.total_deposited,
&pch->purse_pub,
- &dr.details.success.merge_pub,
&dr.details.success.h_contract_terms,
&exchange_pub,
&exchange_sig))
diff --git a/src/testing/test_exchange_p2p.c b/src/testing/test_exchange_p2p.c
index aad0465b7..2f82d1243 100644
--- a/src/testing/test_exchange_p2p.c
+++ b/src/testing/test_exchange_p2p.c
@@ -251,9 +251,9 @@ run (void *cls,
"create-reserve-1",
"EUR:2",
MHD_HTTP_OK),
-#if FIXME
+#if 1
/* POST history doesn't yet support P2P transfers */
- TALER_TESTING_cmd_reserves_status (
+ TALER_TESTING_cmd_reserve_status (
"push-check-post-merge-reserve-balance-post",
"create-reserve-1",
"EUR:2",
diff --git a/src/testing/testing_api_cmd_common.c b/src/testing/testing_api_cmd_common.c
index 1e2439377..138e5502a 100644
--- a/src/testing/testing_api_cmd_common.c
+++ b/src/testing/testing_api_cmd_common.c
@@ -26,10 +26,9 @@
int
-TALER_TESTING_history_entry_cmp (const struct
- TALER_EXCHANGE_ReserveHistoryEntry *h1,
- const struct
- TALER_EXCHANGE_ReserveHistoryEntry *h2)
+TALER_TESTING_history_entry_cmp (
+ const struct TALER_EXCHANGE_ReserveHistoryEntry *h1,
+ const struct TALER_EXCHANGE_ReserveHistoryEntry *h2)
{
if (h1->type != h2->type)
return 1;
diff --git a/src/testing/testing_api_cmd_purse_deposit.c b/src/testing/testing_api_cmd_purse_deposit.c
index 86ed1b185..1c6dcdd9b 100644
--- a/src/testing/testing_api_cmd_purse_deposit.c
+++ b/src/testing/testing_api_cmd_purse_deposit.c
@@ -159,6 +159,7 @@ deposit_cb (void *cls,
const struct TALER_ReserveSignatureP *reserve_sig;
const struct TALER_ReservePublicKeyP *reserve_pub;
const struct GNUNET_TIME_Timestamp *merge_timestamp;
+ const struct TALER_PurseMergePublicKeyP *merge_pub;
purse_cmd = TALER_TESTING_interpreter_lookup_command (ds->is,
ds->purse_ref);
@@ -179,6 +180,14 @@ deposit_cb (void *cls,
TALER_TESTING_interpreter_fail (ds->is);
return;
}
+ if (GNUNET_OK !=
+ TALER_TESTING_get_trait_merge_pub (purse_cmd,
+ &merge_pub))
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (ds->is);
+ return;
+ }
ds->reserve_pub = *reserve_pub;
if (GNUNET_OK !=
TALER_TESTING_get_trait_timestamp (purse_cmd,
@@ -213,7 +222,9 @@ deposit_cb (void *cls,
ds->reserve_history.details.merge_details.h_contract_terms
= dr->details.success.h_contract_terms;
ds->reserve_history.details.merge_details.merge_pub
- = dr->details.success.merge_pub;
+ = *merge_pub;
+ ds->reserve_history.details.merge_details.purse_pub
+ = ds->purse_pub;
ds->reserve_history.details.merge_details.reserve_sig
= *reserve_sig;
ds->reserve_history.details.merge_details.merge_timestamp
diff --git a/src/testing/testing_api_cmd_reserve_purse.c b/src/testing/testing_api_cmd_reserve_purse.c
index ffdd00053..42aff80e3 100644
--- a/src/testing/testing_api_cmd_reserve_purse.c
+++ b/src/testing/testing_api_cmd_reserve_purse.c
@@ -73,6 +73,11 @@ struct ReservePurseState
struct TALER_PurseMergePrivateKeyP merge_priv;
/**
+ * Public key of the merge capability.
+ */
+ struct TALER_PurseMergePublicKeyP merge_pub;
+
+ /**
* Private key to decrypt the contract.
*/
struct TALER_ContractDiffiePrivateP contract_priv;
@@ -184,6 +189,8 @@ purse_run (void *cls,
GNUNET_CRYPTO_eddsa_key_get_public (&ds->reserve_priv.eddsa_priv,
&ds->reserve_pub.eddsa_pub);
GNUNET_CRYPTO_eddsa_key_create (&ds->merge_priv.eddsa_priv);
+ GNUNET_CRYPTO_eddsa_key_get_public (&ds->merge_priv.eddsa_priv,
+ &ds->merge_pub.eddsa_pub);
GNUNET_CRYPTO_ecdhe_key_create (&ds->contract_priv.ecdhe_priv);
ds->purse_expiration = GNUNET_TIME_absolute_to_timestamp (
GNUNET_TIME_relative_to_absolute (ds->expiration_rel));
@@ -266,6 +273,7 @@ purse_traits (void *cls,
TALER_TESTING_make_trait_purse_priv (&ds->purse_priv),
TALER_TESTING_make_trait_purse_pub (&ds->purse_pub),
TALER_TESTING_make_trait_merge_priv (&ds->merge_priv),
+ TALER_TESTING_make_trait_merge_pub (&ds->merge_pub),
TALER_TESTING_make_trait_contract_priv (&ds->contract_priv),
TALER_TESTING_make_trait_reserve_priv (&ds->reserve_priv),
TALER_TESTING_make_trait_reserve_pub (&ds->reserve_pub),
diff --git a/src/util/exchange_signatures.c b/src/util/exchange_signatures.c
index 5c72289e1..68c0fdb0a 100644
--- a/src/util/exchange_signatures.c
+++ b/src/util/exchange_signatures.c
@@ -1301,11 +1301,6 @@ struct TALER_PurseCreateDepositConfirmationPS
struct TALER_PurseContractPublicKeyP purse_pub;
/**
- * Public key of the merge capability.
- */
- struct TALER_PurseMergePublicKeyP merge_pub;
-
- /**
* Hash of the contract of the purse.
*/
struct TALER_PrivateContractHashP h_contract_terms;
@@ -1323,7 +1318,6 @@ TALER_exchange_online_purse_created_sign (
const struct TALER_Amount *amount_without_fee,
const struct TALER_Amount *total_deposited,
const struct TALER_PurseContractPublicKeyP *purse_pub,
- const struct TALER_PurseMergePublicKeyP *merge_pub,
const struct TALER_PrivateContractHashP *h_contract_terms,
struct TALER_ExchangePublicKeyP *pub,
struct TALER_ExchangeSignatureP *sig)
@@ -1333,7 +1327,6 @@ TALER_exchange_online_purse_created_sign (
.purpose.size = htonl (sizeof (dc)),
.h_contract_terms = *h_contract_terms,
.purse_pub = *purse_pub,
- .merge_pub = *merge_pub,
.purse_expiration = GNUNET_TIME_timestamp_hton (purse_expiration),
.exchange_time = GNUNET_TIME_timestamp_hton (exchange_time)
};
@@ -1355,7 +1348,6 @@ TALER_exchange_online_purse_created_verify (
const struct TALER_Amount *amount_without_fee,
const struct TALER_Amount *total_deposited,
const struct TALER_PurseContractPublicKeyP *purse_pub,
- const struct TALER_PurseMergePublicKeyP *merge_pub,
const struct TALER_PrivateContractHashP *h_contract_terms,
const struct TALER_ExchangePublicKeyP *pub,
const struct TALER_ExchangeSignatureP *sig)
@@ -1365,7 +1357,6 @@ TALER_exchange_online_purse_created_verify (
.purpose.size = htonl (sizeof (dc)),
.h_contract_terms = *h_contract_terms,
.purse_pub = *purse_pub,
- .merge_pub = *merge_pub,
.purse_expiration = GNUNET_TIME_timestamp_hton (purse_expiration),
.exchange_time = GNUNET_TIME_timestamp_hton (exchange_time)
};