aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_helper_rsa.c
diff options
context:
space:
mode:
authorLucien Heuzeveldt <lucienclaude.heuzeveldt@students.bfh.ch>2022-01-16 17:02:15 +0100
committerGian Demarmels <gian@demarmels.org>2022-02-04 15:37:30 +0100
commit8d85c8b5b6c514ce093d856a2e4b931b4108ece5 (patch)
tree6ab878e42ad4a99337b7d42e7d89f358429165dd /src/util/test_helper_rsa.c
parentea97729ba891dc94ed2323aba01b15ca8e6a52d4 (diff)
downloadexchange-8d85c8b5b6c514ce093d856a2e4b931b4108ece5.tar.xz
implement feedback
Diffstat (limited to 'src/util/test_helper_rsa.c')
-rw-r--r--src/util/test_helper_rsa.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/util/test_helper_rsa.c b/src/util/test_helper_rsa.c
index 8cfea4bef..f9f1a860d 100644
--- a/src/util/test_helper_rsa.c
+++ b/src/util/test_helper_rsa.c
@@ -268,21 +268,25 @@ test_signing (struct TALER_CRYPTO_RsaDenominationHelper *dh)
enum TALER_ErrorCode ec;
bool success = false;
struct TALER_PlanchetSecretsP ps;
+ struct TALER_ExchangeWithdrawValues alg_values;
struct TALER_CoinPubHash c_hash;
- TALER_planchet_setup_random (&ps, TALER_DENOMINATION_RSA);
+ alg_values.cipher = TALER_DENOMINATION_RSA;
+ TALER_planchet_setup_random (&ps,
+ &alg_values);
for (unsigned int i = 0; i<MAX_KEYS; i++)
{
if (! keys[i].valid)
continue;
+ if (TALER_DENOMINATION_RSA != keys[i].denom_pub.cipher)
+ continue;
{
struct TALER_PlanchetDetail pd;
pd.blinded_planchet.cipher = TALER_DENOMINATION_RSA;
- // keys[i].denom_pub.cipher = TALER_DENOMINATION_CS;
GNUNET_assert (GNUNET_YES ==
TALER_planchet_prepare (&keys[i].denom_pub,
- NULL, /* not needed in RSA*/
+ &alg_values,
&ps,
&c_hash,
&pd));
@@ -299,8 +303,7 @@ test_signing (struct TALER_CRYPTO_RsaDenominationHelper *dh)
pd.blinded_planchet.details.
rsa_blinded_planchet.blinded_msg_size,
&ec);
- GNUNET_free (
- pd.blinded_planchet.details.rsa_blinded_planchet.blinded_msg);
+ TALER_blinded_planchet_free (&pd.blinded_planchet);
}
switch (ec)
{
@@ -426,8 +429,11 @@ perf_signing (struct TALER_CRYPTO_RsaDenominationHelper *dh,
enum TALER_ErrorCode ec;
struct GNUNET_TIME_Relative duration;
struct TALER_PlanchetSecretsP ps;
+ struct TALER_ExchangeWithdrawValues alg_values;
- TALER_planchet_setup_random (&ps, TALER_DENOMINATION_RSA);
+ alg_values.cipher = TALER_DENOMINATION_RSA;
+ TALER_planchet_setup_random (&ps,
+ &alg_values);
duration = GNUNET_TIME_UNIT_ZERO;
TALER_CRYPTO_helper_rsa_poll (dh);
for (unsigned int j = 0; j<NUM_SIGN_PERFS;)
@@ -436,6 +442,8 @@ perf_signing (struct TALER_CRYPTO_RsaDenominationHelper *dh,
{
if (! keys[i].valid)
continue;
+ if (TALER_DENOMINATION_RSA != keys[i].denom_pub.cipher)
+ continue;
if (GNUNET_TIME_relative_cmp (GNUNET_TIME_absolute_get_remaining (
keys[i].start_time.abs_time),
>,
@@ -452,7 +460,7 @@ perf_signing (struct TALER_CRYPTO_RsaDenominationHelper *dh,
GNUNET_assert (GNUNET_YES ==
TALER_planchet_prepare (&keys[i].denom_pub,
- NULL, /* not needed in RSA*/
+ &alg_values,
&ps,
&c_hash,
&pd));
@@ -480,8 +488,7 @@ perf_signing (struct TALER_CRYPTO_RsaDenominationHelper *dh,
if (NUM_SIGN_PERFS <= j)
break;
}
- GNUNET_free (
- pd.blinded_planchet.details.rsa_blinded_planchet.blinded_msg);
+ TALER_blinded_planchet_free (&pd.blinded_planchet);
}
} /* for i */
} /* for j */