diff options
Diffstat (limited to 'src/exchange/taler-exchange-httpd_withdraw.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_withdraw.c | 46 |
1 files changed, 25 insertions, 21 deletions
diff --git a/src/exchange/taler-exchange-httpd_withdraw.c b/src/exchange/taler-exchange-httpd_withdraw.c index ed54fe278..9925fa8e6 100644 --- a/src/exchange/taler-exchange-httpd_withdraw.c +++ b/src/exchange/taler-exchange-httpd_withdraw.c @@ -600,31 +600,35 @@ TEH_handler_withdraw (struct TEH_RequestContext *rc, /* Sign before transaction! */ ec = TALER_EC_NONE; - switch (wc.blinded_planchet.cipher) { - case TALER_DENOMINATION_RSA: - wc.collectable.sig = TEH_keys_denomination_sign ( - &wc.collectable.denom_pub_hash, - wc.blinded_planchet.details.rsa_blinded_planchet.blinded_msg, - wc.blinded_planchet.details.rsa_blinded_planchet.blinded_msg_size, - &ec); - break; - case TALER_DENOMINATION_CS: + struct TEH_SignDetails sign_details; + sign_details.cipher = wc.blinded_planchet.cipher; + switch (wc.blinded_planchet.cipher) + { + case TALER_DENOMINATION_RSA: + sign_details.details.rsa_message.msg = + wc.blinded_planchet.details.rsa_blinded_planchet.blinded_msg; + sign_details.details.rsa_message.msg_size = + wc.blinded_planchet.details.rsa_blinded_planchet.blinded_msg_size; + break; + case TALER_DENOMINATION_CS: + sign_details.details.cs_message = + wc.blinded_planchet.details.cs_blinded_planchet; + break; + default: + GNUNET_break (0); + GNUNET_JSON_parse_free (spec); + if (NULL != coin_ev_spec) + GNUNET_JSON_parse_free (coin_ev_spec); + return TALER_MHD_reply_with_error (rc->connection, + MHD_HTTP_FORBIDDEN, + TALER_EC_GENERIC_INTERNAL_INVARIANT_FAILURE, + NULL); + } wc.collectable.sig = TEH_keys_denomination_sign ( &wc.collectable.denom_pub_hash, - &wc.blinded_planchet.details.cs_blinded_planchet, - sizeof (wc.blinded_planchet.details.cs_blinded_planchet), + &sign_details, &ec); - break; - default: - GNUNET_break (0); - GNUNET_JSON_parse_free (spec); - if (NULL != coin_ev_spec) - GNUNET_JSON_parse_free (coin_ev_spec); - return TALER_MHD_reply_with_error (rc->connection, - MHD_HTTP_FORBIDDEN, - TALER_EC_GENERIC_INTERNAL_INVARIANT_FAILURE, - NULL); } if (TALER_EC_NONE != ec) { |