From b461fc6fc4fa3d83326aa4e7806de973991a99e5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 9 Feb 2022 10:03:10 +0100 Subject: [PATCH] -simpilify --- src/util/crypto.c | 43 ++++++++----------------------------------- 1 file 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; }