diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-12-16 20:18:44 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-12-16 20:18:44 +0100 |
commit | 1acc851deb38c52e4212823100eec8a00d5f385a (patch) | |
tree | 67d62b84291996a0def04e9cec16e06025a285ed /src/auditor/taler-helper-auditor-coins.c | |
parent | 3b6a0dd5994b824ecbf246bb17e5be7611e89386 (diff) | |
download | exchange-1acc851deb38c52e4212823100eec8a00d5f385a.tar.xz |
-fix recoup ugliness
Diffstat (limited to 'src/auditor/taler-helper-auditor-coins.c')
-rw-r--r-- | src/auditor/taler-helper-auditor-coins.c | 53 |
1 files changed, 22 insertions, 31 deletions
diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c index 937613cce..393fc464b 100644 --- a/src/auditor/taler-helper-auditor-coins.c +++ b/src/auditor/taler-helper-auditor-coins.c @@ -1983,38 +1983,29 @@ check_recoup (struct CoinContext *cc, cc->qs = qs; return GNUNET_SYSERR; } + if (GNUNET_OK != + TALER_wallet_recoup_verify (&coin->denom_pub_hash, + coin_blind, + amount, + &coin->coin_pub, + coin_sig)) { - struct TALER_RecoupRequestPS pr = { - .purpose.purpose = htonl (TALER_SIGNATURE_WALLET_COIN_RECOUP), - .purpose.size = htonl (sizeof (pr)), - .coin_pub = coin->coin_pub, - .coin_blind = *coin_blind, - .h_denom_pub = coin->denom_pub_hash - }; - - if (GNUNET_OK != - GNUNET_CRYPTO_eddsa_verify (TALER_SIGNATURE_WALLET_COIN_RECOUP, - &pr, - &coin_sig->eddsa_signature, - &coin->coin_pub.eddsa_pub)) - { - TALER_ARL_report (report_bad_sig_losses, - GNUNET_JSON_PACK ( - GNUNET_JSON_pack_string ("operation", - operation), - GNUNET_JSON_pack_uint64 ("row", - rowid), - TALER_JSON_pack_amount ("loss", - amount), - GNUNET_JSON_pack_data_auto ("coin_pub", - &coin->coin_pub))); - TALER_ARL_amount_add (&total_bad_sig_loss, - &total_bad_sig_loss, - amount); - if (TALER_ARL_do_abort ()) - return GNUNET_SYSERR; - return GNUNET_OK; - } + TALER_ARL_report (report_bad_sig_losses, + GNUNET_JSON_PACK ( + GNUNET_JSON_pack_string ("operation", + operation), + GNUNET_JSON_pack_uint64 ("row", + rowid), + TALER_JSON_pack_amount ("loss", + amount), + GNUNET_JSON_pack_data_auto ("coin_pub", + &coin->coin_pub))); + TALER_ARL_amount_add (&total_bad_sig_loss, + &total_bad_sig_loss, + amount); + if (TALER_ARL_do_abort ()) + return GNUNET_SYSERR; + return GNUNET_OK; } ds = get_denomination_summary (cc, issue, |