diff options
-rw-r--r-- | src/lib/exchange_api_batch_withdraw.c | 6 | ||||
-rw-r--r-- | src/util/denom.c | 31 |
2 files changed, 28 insertions, 9 deletions
diff --git a/src/lib/exchange_api_batch_withdraw.c b/src/lib/exchange_api_batch_withdraw.c index cab4734b5..b8d40ef77 100644 --- a/src/lib/exchange_api_batch_withdraw.c +++ b/src/lib/exchange_api_batch_withdraw.c @@ -192,6 +192,10 @@ handle_reserve_batch_withdraw_finished ( struct CoinData *cd = &wh->coins[i]; struct TALER_EXCHANGE_PrivateCoinDetails *coin = &coins[i]; struct TALER_FreshCoin fc; + const struct TALER_ExchangeWithdrawValues *alg_values + = (GNUNET_CRYPTO_BSA_RSA != cd->pk.key.bsign_pub_key->cipher) + ? &cd->alg_values + : TALER_denom_ewv_rsa_singleton (); if (GNUNET_OK != TALER_planchet_to_coin (&cd->pk.key, @@ -200,7 +204,7 @@ handle_reserve_batch_withdraw_finished ( &cd->priv, cd->ach, &cd->c_hash, - &cd->alg_values, + alg_values, &fc)) { wr.hr.http_status = 0; diff --git a/src/util/denom.c b/src/util/denom.c index 20ee8c00e..50f191b2a 100644 --- a/src/util/denom.c +++ b/src/util/denom.c @@ -76,7 +76,10 @@ TALER_denom_sig_unblind ( alg_values->blinding_inputs, denom_pub->bsign_pub_key); if (NULL == denom_sig->unblinded_sig) + { + GNUNET_break_op (0); return GNUNET_SYSERR; + } return GNUNET_OK; } @@ -181,24 +184,33 @@ TALER_denom_pub_verify (const struct TALER_DenominationPublicKey *denom_pub, void TALER_denom_pub_free (struct TALER_DenominationPublicKey *denom_pub) { - GNUNET_CRYPTO_blind_sign_pub_decref (denom_pub->bsign_pub_key); - denom_pub->bsign_pub_key = NULL; + if (NULL != denom_pub->bsign_pub_key) + { + GNUNET_CRYPTO_blind_sign_pub_decref (denom_pub->bsign_pub_key); + denom_pub->bsign_pub_key = NULL; + } } void TALER_denom_priv_free (struct TALER_DenominationPrivateKey *denom_priv) { - GNUNET_CRYPTO_blind_sign_priv_decref (denom_priv->bsign_priv_key); - denom_priv->bsign_priv_key = NULL; + if (NULL != denom_priv->bsign_priv_key) + { + GNUNET_CRYPTO_blind_sign_priv_decref (denom_priv->bsign_priv_key); + denom_priv->bsign_priv_key = NULL; + } } void TALER_denom_sig_free (struct TALER_DenominationSignature *denom_sig) { - GNUNET_CRYPTO_unblinded_sig_decref (denom_sig->unblinded_sig); - denom_sig->unblinded_sig = NULL; + if (NULL != denom_sig->unblinded_sig) + { + GNUNET_CRYPTO_unblinded_sig_decref (denom_sig->unblinded_sig); + denom_sig->unblinded_sig = NULL; + } } @@ -206,8 +218,11 @@ void TALER_blinded_denom_sig_free ( struct TALER_BlindedDenominationSignature *denom_sig) { - GNUNET_CRYPTO_blinded_sig_decref (denom_sig->blinded_sig); - denom_sig->blinded_sig = NULL; + if (NULL != denom_sig->blinded_sig) + { + GNUNET_CRYPTO_blinded_sig_decref (denom_sig->blinded_sig); + denom_sig->blinded_sig = NULL; + } } |