aboutsummaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
authorGian Demarmels <gian@demarmels.org>2022-02-04 16:50:32 +0100
committerGian Demarmels <gian@demarmels.org>2022-02-04 16:50:32 +0100
commita67786078bb3617ea8d4d308b21781fd0a1c2258 (patch)
tree67d476fe3e096001997f6de77d1db92bcd643bbb /src/exchange
parent8674f32aec8113ced6b2c2be625728b31158fff8 (diff)
resolves merge conflicts
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/taler-exchange-httpd_csr.c3
-rw-r--r--src/exchange/taler-exchange-httpd_recoup-refresh.c13
-rw-r--r--src/exchange/taler-exchange-httpd_recoup.c5
-rw-r--r--src/exchange/taler-exchange-httpd_refreshes_reveal.c18
-rw-r--r--src/exchange/taler-exchange-httpd_withdraw.c53
5 files changed, 24 insertions, 68 deletions
diff --git a/src/exchange/taler-exchange-httpd_csr.c b/src/exchange/taler-exchange-httpd_csr.c
index dfe4d4d0..fbad543c 100644
--- a/src/exchange/taler-exchange-httpd_csr.c
+++ b/src/exchange/taler-exchange-httpd_csr.c
@@ -94,7 +94,6 @@ TEH_handler_csr (struct TEH_RequestContext *rc,
return TEH_RESPONSE_reply_expired_denom_pub_hash (
rc->connection,
&denom_pub_hash,
- GNUNET_TIME_timestamp_get (),
TALER_EC_EXCHANGE_GENERIC_DENOMINATION_EXPIRED,
"CSR");
}
@@ -105,7 +104,6 @@ TEH_handler_csr (struct TEH_RequestContext *rc,
return TEH_RESPONSE_reply_expired_denom_pub_hash (
rc->connection,
&denom_pub_hash,
- GNUNET_TIME_timestamp_get (),
TALER_EC_EXCHANGE_GENERIC_DENOMINATION_VALIDITY_IN_FUTURE,
"CSR");
}
@@ -115,7 +113,6 @@ TEH_handler_csr (struct TEH_RequestContext *rc,
return TEH_RESPONSE_reply_expired_denom_pub_hash (
rc->connection,
&denom_pub_hash,
- GNUNET_TIME_timestamp_get (),
TALER_EC_EXCHANGE_GENERIC_DENOMINATION_REVOKED,
"CSR");
}
diff --git a/src/exchange/taler-exchange-httpd_recoup-refresh.c b/src/exchange/taler-exchange-httpd_recoup-refresh.c
index 78a454c8..acaea64f 100644
--- a/src/exchange/taler-exchange-httpd_recoup-refresh.c
+++ b/src/exchange/taler-exchange-httpd_recoup-refresh.c
@@ -241,18 +241,17 @@ verify_and_execute_recoup_refresh (
}
{
- void *coin_ev;
- size_t coin_ev_size;
struct TALER_CoinPubHash c_hash;
+ struct TALER_BlindedPlanchet blinded_planchet;
if (GNUNET_OK !=
TALER_denom_blind (&dk->denom_pub,
coin_bks,
NULL, /* FIXME-Oec: TALER_AgeHash * */
&coin->coin_pub,
+ NULL, /* FIXME: Implement CS */
&c_hash,
- &coin_ev,
- &coin_ev_size))
+ &blinded_planchet))
{
GNUNET_break (0);
return TALER_MHD_reply_with_error (
@@ -261,10 +260,10 @@ verify_and_execute_recoup_refresh (
TALER_EC_EXCHANGE_RECOUP_REFRESH_BLINDING_FAILED,
NULL);
}
- TALER_coin_ev_hash (coin_ev,
- coin_ev_size,
+ TALER_coin_ev_hash (&blinded_planchet,
+ &coin->denom_pub_hash,
&h_blind);
- GNUNET_free (coin_ev);
+ TALER_blinded_planchet_free (&blinded_planchet);
}
pc.coin_sig = coin_sig;
diff --git a/src/exchange/taler-exchange-httpd_recoup.c b/src/exchange/taler-exchange-httpd_recoup.c
index 1978b58d..416eaf69 100644
--- a/src/exchange/taler-exchange-httpd_recoup.c
+++ b/src/exchange/taler-exchange-httpd_recoup.c
@@ -243,9 +243,6 @@ verify_and_execute_recoup (
}
{
- //FIXME:
- void *coin_ev;
- size_t coin_ev_size;
struct TALER_CoinPubHash c_hash;
struct TALER_BlindedPlanchet blinded_planchet;
@@ -254,7 +251,7 @@ verify_and_execute_recoup (
coin_bks,
NULL, /* FIXME-Oec: TALER_AgeHash * */
&coin->coin_pub,
- NULL, /* in RSA Case not needed*/
+ NULL, /* FIXME: handle CS */
&c_hash,
&blinded_planchet))
{
diff --git a/src/exchange/taler-exchange-httpd_refreshes_reveal.c b/src/exchange/taler-exchange-httpd_refreshes_reveal.c
index eba8efbd..95ec55b2 100644
--- a/src/exchange/taler-exchange-httpd_refreshes_reveal.c
+++ b/src/exchange/taler-exchange-httpd_refreshes_reveal.c
@@ -510,23 +510,17 @@ resolve_refreshes_reveal_denominations (struct MHD_Connection *connection,
for (unsigned int i = 0; i<rctx->num_fresh_coins; i++)
{
enum TALER_ErrorCode ec = TALER_EC_NONE;
- //FIXME:
+ struct TEH_SignDetails sign_details;
+ // FIXME: implement cipher handling
+ sign_details.cipher = TALER_DENOMINATION_RSA;
+ sign_details.details.rsa_message.msg = rcds[i].coin_ev;
+ sign_details.details.rsa_message.msg_size = rcds[i].coin_ev_size;
rrcs[i].coin_sig
= TEH_keys_denomination_sign (
&rrcs[i].h_denom_pub,
- rcds[i].coin_ev,
- rcds[i].coin_ev_size,
+ &sign_details,
&ec);
- struct TEH_SignDetails sign_details;
-
- // FIXME: implement cipher handling
- sign_details.cipher = TALER_DENOMINATION_RSA;
- sign_details.details.rsa_message.msg = rctx->rcds[i].coin_ev;
- sign_details.details.rsa_message.msg_size = rctx->rcds[i].coin_ev_size;
- rctx->ev_sigs[i] = TEH_keys_denomination_sign (&dk_h[i],
- &sign_details,
- &ec);
if (TALER_EC_NONE != ec)
{
GNUNET_break (0);
diff --git a/src/exchange/taler-exchange-httpd_withdraw.c b/src/exchange/taler-exchange-httpd_withdraw.c
index aab1cafd..5cae883e 100644
--- a/src/exchange/taler-exchange-httpd_withdraw.c
+++ b/src/exchange/taler-exchange-httpd_withdraw.c
@@ -98,13 +98,10 @@ struct WithdrawContext
/**
* Blinded planchet.
*/
- //FIXME:
+ struct TALER_BlindedPlanchet blinded_planchet;
/**
- * Number of bytes in @e blinded_msg.
- */
- size_t blinded_msg_len;
- struct TALER_BlindedPlanchet blinded_planchet;
+ * Set to the resulting signed coin data to be returned to the client.
*/
struct TALER_EXCHANGEDB_CollectableBlindcoin collectable;
@@ -322,12 +319,6 @@ TEH_handler_withdraw (struct TEH_RequestContext *rc,
{
struct WithdrawContext wc;
struct GNUNET_JSON_Specification spec[] = {
- //FIXME:
- GNUNET_JSON_spec_varsize ("coin_ev",
- &wc.blinded_msg,
- &wc.blinded_msg_len),
- // field "coin_ev" will be parsed later due to different parsing depending
- // on denomination cipher, see coin_ev_..._spec
GNUNET_JSON_spec_fixed_auto ("reserve_sig",
&wc.collectable.reserve_sig),
GNUNET_JSON_spec_fixed_auto ("denom_pub_hash",
@@ -447,24 +438,6 @@ TEH_handler_withdraw (struct TEH_RequestContext *rc,
GNUNET_JSON_parse_free (spec);
return mret;
}
- }
-//FIXME:
- if (0 >
- TALER_amount_add (&wc.collectable.amount_with_fee,
- &dk->meta.value,
- &dk->meta.fee_withdraw))
- {
- GNUNET_JSON_parse_free (spec);
- return TALER_MHD_reply_with_error (rc->connection,
- MHD_HTTP_INTERNAL_SERVER_ERROR,
- TALER_EC_EXCHANGE_WITHDRAW_AMOUNT_FEE_OVERFLOW,
- NULL);
- // parse coin_ev field, must be done after dk lookup to know denom cipher
- {
- enum GNUNET_GenericReturnValue res;
- wc.blinded_planchet.cipher = dk->denom_pub.cipher;
- switch (wc.blinded_planchet.cipher)
-
if (dk->denom_pub.cipher != wc.blinded_planchet.cipher)
{
/* denomination cipher and blinded planchet cipher not the same */
@@ -476,20 +449,16 @@ TEH_handler_withdraw (struct TEH_RequestContext *rc,
}
}
+ if (0 >
+ TALER_amount_add (&wc.collectable.amount_with_fee,
+ &dk->meta.value,
+ &dk->meta.fee_withdraw))
{
- if (0 >
- TALER_amount_add (&wc.collectable.amount_with_fee,
- &dk->meta.value,
- &dk->meta.fee_withdraw))
- {
- GNUNET_JSON_parse_free (spec);
- return TALER_MHD_reply_with_error (rc->connection,
- MHD_HTTP_INTERNAL_SERVER_ERROR,
- TALER_EC_EXCHANGE_WITHDRAW_AMOUNT_FEE_OVERFLOW,
- NULL);
- }
- TALER_amount_hton (&wc.wsrd.amount_with_fee,
- &wc.collectable.amount_with_fee);
+ GNUNET_JSON_parse_free (spec);
+ return TALER_MHD_reply_with_error (rc->connection,
+ MHD_HTTP_INTERNAL_SERVER_ERROR,
+ TALER_EC_EXCHANGE_WITHDRAW_AMOUNT_FEE_OVERFLOW,
+ NULL);
}
TALER_amount_hton (&wc.wsrd.amount_with_fee,
&wc.collectable.amount_with_fee);