-fix tests

This commit is contained in:
Christian Grothoff 2021-10-31 18:01:19 +01:00
parent 3eae999efc
commit b1197c16a4
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
2 changed files with 17 additions and 15 deletions

View File

@ -88,7 +88,7 @@ test_planchets (void)
struct TALER_DenominationPrivateKey dk_priv;
struct TALER_DenominationPublicKey dk_pub;
struct TALER_PlanchetDetail pd;
struct GNUNET_CRYPTO_RsaSignature *blind_sig;
struct TALER_BlindedDenominationSignature blind_sig;
struct TALER_FreshCoin coin;
struct TALER_CoinPubHash c_hash;
@ -104,20 +104,22 @@ test_planchets (void)
&ps,
&c_hash,
&pd));
blind_sig = GNUNET_CRYPTO_rsa_sign_blinded (dk_priv.details.rsa_private_key,
pd.coin_ev,
pd.coin_ev_size);
GNUNET_assert (NULL != blind_sig);
blind_sig.cipher = TALER_DENOMINATION_RSA;
blind_sig.details.blinded_rsa_signature
= GNUNET_CRYPTO_rsa_sign_blinded (dk_priv.details.rsa_private_key,
pd.coin_ev,
pd.coin_ev_size);
GNUNET_assert (NULL != blind_sig.details.blinded_rsa_signature);
GNUNET_assert (GNUNET_OK ==
TALER_planchet_to_coin (&dk_pub,
blind_sig,
&blind_sig,
&ps,
&c_hash,
&coin));
GNUNET_CRYPTO_rsa_signature_free (blind_sig);
GNUNET_CRYPTO_rsa_signature_free (coin.sig.details.rsa_signature);
GNUNET_CRYPTO_rsa_private_key_free (dk_priv.details.rsa_private_key);
GNUNET_CRYPTO_rsa_public_key_free (dk_pub.details.rsa_public_key);
TALER_blinded_denom_sig_free (&blind_sig);
TALER_denom_sig_free (&coin.sig);
TALER_denom_priv_free (&dk_priv);
TALER_denom_pub_free (&dk_pub);
return 0;
}

View File

@ -237,7 +237,7 @@ test_revocation (struct TALER_CRYPTO_DenominationHelper *dh)
static int
test_signing (struct TALER_CRYPTO_DenominationHelper *dh)
{
struct TALER_DenominationSignature ds;
struct TALER_BlindedDenominationSignature ds;
enum TALER_ErrorCode ec;
bool success = false;
struct TALER_CoinPubHash m_hash;
@ -296,7 +296,7 @@ test_signing (struct TALER_CRYPTO_DenominationHelper *dh)
rs.cipher = TALER_DENOMINATION_RSA;
rs.details.rsa_signature
= TALER_rsa_unblind (ds.details.rsa_signature,
= TALER_rsa_unblind (ds.details.blinded_rsa_signature,
&bks,
keys[i].denom_pub.details.rsa_public_key);
if (NULL == rs.details.rsa_signature)
@ -304,7 +304,7 @@ test_signing (struct TALER_CRYPTO_DenominationHelper *dh)
GNUNET_break (0);
return 6;
}
GNUNET_CRYPTO_rsa_signature_free (ds.details.rsa_signature);
TALER_blinded_denom_sig_free (&ds);
if (GNUNET_OK !=
TALER_denom_pub_verify (&keys[i].denom_pub,
&rs,
@ -386,7 +386,7 @@ test_signing (struct TALER_CRYPTO_DenominationHelper *dh)
static int
perf_signing (struct TALER_CRYPTO_DenominationHelper *dh)
{
struct TALER_DenominationSignature ds;
struct TALER_BlindedDenominationSignature ds;
enum TALER_ErrorCode ec;
struct TALER_CoinPubHash m_hash;
struct GNUNET_CRYPTO_RsaBlindingKeySecret bks;
@ -438,7 +438,7 @@ perf_signing (struct TALER_CRYPTO_DenominationHelper *dh)
delay = GNUNET_TIME_absolute_get_duration (start);
duration = GNUNET_TIME_relative_add (duration,
delay);
GNUNET_CRYPTO_rsa_signature_free (ds.details.rsa_signature);
TALER_blinded_denom_sig_free (&ds);
j++;
if (NUM_SIGN_TESTS == j)
break;