diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-02-09 10:03:10 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-02-09 10:03:10 +0100 |
commit | b461fc6fc4fa3d83326aa4e7806de973991a99e5 (patch) | |
tree | 5708c72c47a96a2d8519641aa81c990d66efccc7 /src/util | |
parent | e82d18325abb63c08b15be1c291b9f2c2988cfdc (diff) | |
download | exchange-b461fc6fc4fa3d83326aa4e7806de973991a99e5.tar.xz |
-simpilify
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/crypto.c | 43 |
1 files changed, 8 insertions, 35 deletions
diff --git a/src/util/crypto.c b/src/util/crypto.c index ae611901f..03c3ea0fc 100644 --- a/src/util/crypto.c +++ b/src/util/crypto.c @@ -411,57 +411,30 @@ TALER_planchet_to_coin ( const struct TALER_ExchangeWithdrawValues *alg_values, struct TALER_FreshCoin *coin) { - struct TALER_DenominationSignature sig; - if ( (dk->cipher != blind_sig->cipher) || (dk->cipher != alg_values->cipher) ) { GNUNET_break_op (0); return GNUNET_SYSERR; } - - switch (dk->cipher) + if (GNUNET_OK != + TALER_denom_sig_unblind (&coin->sig, + blind_sig, + bks, + dk)) { - case TALER_DENOMINATION_RSA: - if (GNUNET_OK != - TALER_denom_sig_unblind (&sig, - blind_sig, - bks, - dk)) - { - GNUNET_break_op (0); - return GNUNET_SYSERR; - } - break; - case TALER_DENOMINATION_CS: - { - if (GNUNET_OK != - TALER_denom_sig_unblind (&sig, - blind_sig, - bks, - dk)) - { - GNUNET_break_op (0); - return GNUNET_SYSERR; - } - break; - } - default: - GNUNET_break (0); + GNUNET_break_op (0); return GNUNET_SYSERR; } - if (GNUNET_OK != TALER_denom_pub_verify (dk, - &sig, + &coin->sig, c_hash)) { GNUNET_break_op (0); - TALER_denom_sig_free (&sig); + TALER_denom_sig_free (&coin->sig); return GNUNET_SYSERR; } - - coin->sig = sig; coin->coin_priv = *coin_priv; return GNUNET_OK; } |