diff options
author | ng0 <ng0@n0.is> | 2019-04-30 21:30:33 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-04-30 21:30:33 +0000 |
commit | 13cf7ee0cb8b91931370d602a31d2d5943eb101f (patch) | |
tree | c4e11af3d41679e97d8a33d189c6917536d2cfef /src | |
parent | e1cf1a48af5f486b6ef94a20335e5e7f52db367e (diff) |
refactor for GNUNET_memcmp
Diffstat (limited to 'src')
-rw-r--r-- | src/exchangedb/test_exchangedb.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c index 6bdb4ab24..c8d4fa041 100644 --- a/src/exchangedb/test_exchangedb.c +++ b/src/exchangedb/test_exchangedb.c @@ -433,14 +433,10 @@ check_refresh_reveal_cb (void *cls, GNUNET_CRYPTO_rsa_public_key_cmp (acoin->denom_pub.rsa_public_key, bcoin->denom_pub.rsa_public_key)); } - GNUNET_assert (0 == - memcmp (&tpub, - tpr, - sizeof (tpub))); - GNUNET_assert (0 == - memcmp (tprivs, - tprivsr, - sizeof (struct TALER_TransferPrivateKeyP) * (TALER_CNC_KAPPA - 1))); + GNUNET_assert(0 == GNUNET_memcmp(&tpub, tpr)); + GNUNET_assert(0 == memcmp(tprivs, tprivsr, + sizeof(struct TALER_TransferPrivateKeyP) * + (TALER_CNC_KAPPA - 1))); } @@ -609,14 +605,10 @@ test_melting (struct TALER_EXCHANGEDB_Session *session) FAILIF (0 != TALER_amount_cmp (&fee_refresh, &ret_refresh_session.melt_fee)); - FAILIF (0 != - memcmp (&refresh_session.rc, - &ret_refresh_session.session.rc, - sizeof (struct TALER_RefreshCommitmentP))); - FAILIF (0 != - memcmp (&refresh_session.coin_sig, - &ret_refresh_session.session.coin_sig, - sizeof (struct TALER_CoinSpendSignatureP))); + FAILIF(0 != + GNUNET_memcmp(&refresh_session.rc, &ret_refresh_session.session.rc)); + FAILIF(0 != GNUNET_memcmp(&refresh_session.coin_sig, + &ret_refresh_session.session.coin_sig)); FAILIF (0 != GNUNET_CRYPTO_rsa_signature_cmp (refresh_session.coin.denom_sig.rsa_signature, ret_refresh_session.session.coin.denom_sig.rsa_signature)); @@ -1741,12 +1733,8 @@ run (void *cls) &cbc.h_coin_envelope, &cbc2)); FAILIF (NULL == cbc2.denom_pub.rsa_public_key); - FAILIF (0 != memcmp (&cbc2.reserve_sig, - &cbc.reserve_sig, - sizeof (cbc2.reserve_sig))); - FAILIF (0 != memcmp (&cbc2.reserve_pub, - &cbc.reserve_pub, - sizeof (cbc2.reserve_pub))); + FAILIF(0 != GNUNET_memcmp(&cbc2.reserve_sig, &cbc.reserve_sig)); + FAILIF(0 != GNUNET_memcmp(&cbc2.reserve_pub, &cbc.reserve_pub)); result = 6; FAILIF (GNUNET_OK != GNUNET_CRYPTO_rsa_verify (&cbc.h_coin_envelope, |