diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2022-02-18 00:44:55 +0100 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2022-02-18 00:50:31 +0100 |
commit | f4f502d037a84a38db4bc21a1db06324a05d26aa (patch) | |
tree | abd1d813c9e1a9303d60edd3600a9e39f9d3d91a /src/util/denom.c | |
parent | a78b3345fbf017b1cddfd09afb4b2c29287b0bba (diff) | |
parent | 22fe5da700df7328de183470c1c7f59b21c9f4f9 (diff) | |
download | exchange-f4f502d037a84a38db4bc21a1db06324a05d26aa.tar.xz |
-minor merge conflict resolves
Diffstat (limited to 'src/util/denom.c')
-rw-r--r-- | src/util/denom.c | 93 |
1 files changed, 8 insertions, 85 deletions
diff --git a/src/util/denom.c b/src/util/denom.c index 7c2c42c9e..7afc7f408 100644 --- a/src/util/denom.c +++ b/src/util/denom.c @@ -652,8 +652,8 @@ TALER_blinded_denom_sig_cmp ( void -TALER_blinded_planchet_hash (const struct TALER_BlindedPlanchet *bp, - struct GNUNET_HashContext *hash_context) +TALER_blinded_planchet_hash_ (const struct TALER_BlindedPlanchet *bp, + struct GNUNET_HashContext *hash_context) { uint32_t cipher = htonl (bp->cipher); @@ -771,97 +771,20 @@ TALER_blinded_planchet_free (struct TALER_BlindedPlanchet *blinded_planchet) { switch (blinded_planchet->cipher) { + case TALER_DENOMINATION_INVALID: + GNUNET_break (0); + return; case TALER_DENOMINATION_RSA: GNUNET_free (blinded_planchet->details.rsa_blinded_planchet.blinded_msg); - break; + return; case TALER_DENOMINATION_CS: memset (blinded_planchet, 0, sizeof (*blinded_planchet)); /* nothing to do for CS */ - break; - default: - GNUNET_break (0); - } -} - - -enum GNUNET_GenericReturnValue -TALER_coin_ev_hash (const struct TALER_BlindedPlanchet *blinded_planchet, - const struct TALER_DenominationHash *denom_hash, - struct TALER_BlindedCoinHash *bch) -{ - struct GNUNET_HashContext *hash_context; - - hash_context = GNUNET_CRYPTO_hash_context_start (); - GNUNET_CRYPTO_hash_context_read (hash_context, - denom_hash, - sizeof(*denom_hash)); - switch (blinded_planchet->cipher) - { - case TALER_DENOMINATION_RSA: - GNUNET_CRYPTO_hash_context_read ( - hash_context, - blinded_planchet->details.rsa_blinded_planchet.blinded_msg, - blinded_planchet->details.rsa_blinded_planchet.blinded_msg_size); - break; - case TALER_DENOMINATION_CS: - // FIXME: c-values MUST NOT be included in idempotency check - // during withdraw (or recoup), but right now they are!!! - GNUNET_CRYPTO_hash_context_read ( - hash_context, - &blinded_planchet->details.cs_blinded_planchet.c[0], - sizeof (struct GNUNET_CRYPTO_CsC) * 2); - GNUNET_CRYPTO_hash_context_read ( - hash_context, - &blinded_planchet->details.cs_blinded_planchet.nonce, - sizeof (struct TALER_CsNonce)); - break; - default: - GNUNET_break (0); - GNUNET_CRYPTO_hash_context_abort (hash_context); - return GNUNET_SYSERR; - } - GNUNET_CRYPTO_hash_context_finish (hash_context, - &bch->hash); - return GNUNET_OK; -} - - -enum GNUNET_GenericReturnValue -TALER_withdraw_request_hash ( - const struct TALER_BlindedPlanchet *blinded_planchet, - const struct TALER_DenominationHash *denom_hash, - struct TALER_WithdrawIdentificationHash *wih) -{ - struct GNUNET_HashContext *hash_context; - - hash_context = GNUNET_CRYPTO_hash_context_start (); - GNUNET_CRYPTO_hash_context_read (hash_context, - denom_hash, - sizeof(*denom_hash)); - switch (blinded_planchet->cipher) - { - case TALER_DENOMINATION_RSA: - GNUNET_CRYPTO_hash_context_read ( - hash_context, - blinded_planchet->details.rsa_blinded_planchet.blinded_msg, - blinded_planchet->details.rsa_blinded_planchet.blinded_msg_size); - break; - case TALER_DENOMINATION_CS: - GNUNET_CRYPTO_hash_context_read ( - hash_context, - &blinded_planchet->details.cs_blinded_planchet.nonce, - sizeof (struct TALER_CsNonce)); - break; - default: - GNUNET_break (0); - GNUNET_CRYPTO_hash_context_abort (hash_context); - return GNUNET_SYSERR; + return; } - GNUNET_CRYPTO_hash_context_finish (hash_context, - &wih->hash); - return GNUNET_OK; + GNUNET_assert (0); } |