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

View File

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