summaryrefslogtreecommitdiff
path: root/src/exchangedb/test_exchangedb_denomkeys.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-02-23 14:47:44 +0100
committerChristian Grothoff <christian@grothoff.org>2019-03-02 19:18:12 +0100
commit4dea098f54757f618abcfdfd27514bdab281997a (patch)
tree00da52fef7b03681f75433009b37c56e99689e44 /src/exchangedb/test_exchangedb_denomkeys.c
parent3219c14674743302f943c3884e8383de4c4427e6 (diff)
downloadexchange-4dea098f54757f618abcfdfd27514bdab281997a.tar.gz
exchange-4dea098f54757f618abcfdfd27514bdab281997a.tar.bz2
exchange-4dea098f54757f618abcfdfd27514bdab281997a.zip
actually disable 100 continue
Diffstat (limited to 'src/exchangedb/test_exchangedb_denomkeys.c')
-rw-r--r--src/exchangedb/test_exchangedb_denomkeys.c57
1 files changed, 18 insertions, 39 deletions
diff --git a/src/exchangedb/test_exchangedb_denomkeys.c b/src/exchangedb/test_exchangedb_denomkeys.c
index 06465a4ea..b558b3b3b 100644
--- a/src/exchangedb/test_exchangedb_denomkeys.c
+++ b/src/exchangedb/test_exchangedb_denomkeys.c
@@ -38,7 +38,6 @@
* @param cls closure with expected DKI
* @param dki the denomination key
* @param alias coin alias
- * @param revocation_master_sig non-NULL if @a dki was revoked
* @return #GNUNET_OK to continue to iterate,
* #GNUNET_NO to stop iteration with no error,
* #GNUNET_SYSERR to abort iteration with error!
@@ -46,16 +45,10 @@
static int
dki_iter (void *cls,
const char *alias,
- const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki,
- const struct TALER_MasterSignatureP *revocation_master_sig)
+ const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki)
{
const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *exp = cls;
- if (NULL != revocation_master_sig)
- {
- GNUNET_break (0);
- return GNUNET_SYSERR;
- }
if (0 != memcmp (&exp->issue,
&dki->issue,
sizeof (struct TALER_EXCHANGEDB_DenominationKeyInformationP)))
@@ -85,8 +78,7 @@ dki_iter (void *cls,
* @brief Iterator called on revoked denomination key.
*
* @param cls closure with expected DKI
- * @param dki the denomination key
- * @param alias coin alias
+ * @param denom_hash hash of the revoked denomination key
* @param revocation_master_sig non-NULL if @a dki was revoked
* @return #GNUNET_OK to continue to iterate,
* #GNUNET_NO to stop iteration with no error,
@@ -94,8 +86,7 @@ dki_iter (void *cls,
*/
static int
dki_iter_revoked (void *cls,
- const char *alias,
- const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki,
+ const struct GNUNET_HashCode *denom_hash,
const struct TALER_MasterSignatureP *revocation_master_sig)
{
const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *exp = cls;
@@ -105,28 +96,13 @@ dki_iter_revoked (void *cls,
GNUNET_break (0);
return GNUNET_SYSERR;
}
- if (0 != memcmp (&exp->issue,
- &dki->issue,
- sizeof (struct TALER_EXCHANGEDB_DenominationKeyInformationP)))
+ if (0 != memcmp (denom_hash,
+ &exp->issue.properties.denom_hash,
+ sizeof (struct GNUNET_HashCode)))
{
GNUNET_break (0);
return GNUNET_SYSERR;
}
- if (0 !=
- GNUNET_CRYPTO_rsa_private_key_cmp (exp->denom_priv.rsa_private_key,
- dki->denom_priv.rsa_private_key))
- {
- GNUNET_break (0);
- return GNUNET_SYSERR;
- }
- if (0 !=
- GNUNET_CRYPTO_rsa_public_key_cmp (exp->denom_pub.rsa_public_key,
- dki->denom_pub.rsa_public_key))
- {
- GNUNET_break (0);
- return GNUNET_SYSERR;
- }
-
return GNUNET_OK;
}
@@ -146,6 +122,7 @@ main (int argc,
size_t enc_read_size;
char *tmpfile;
char *tmpdir;
+ char *revdir;
int ret;
struct GNUNET_TIME_Absolute start;
@@ -180,6 +157,10 @@ main (int argc,
TALER_EXCHANGEDB_DIR_DENOMINATION_KEYS,
"cur-unit-uuid",
(unsigned long long) start.abs_value_us);
+ GNUNET_asprintf (&revdir,
+ "%s/revocations/",
+ tmpdir,
+ TALER_EXCHANGEDB_DIR_DENOMINATION_KEYS);
EXITIF (GNUNET_OK !=
TALER_EXCHANGEDB_denomination_key_write (tmpfile,
&dki));
@@ -188,21 +169,19 @@ main (int argc,
&dki_read));
EXITIF (1 !=
TALER_EXCHANGEDB_denomination_keys_iterate (tmpdir,
- &master_pub,
&dki_iter,
&dki));
EXITIF (GNUNET_OK !=
- TALER_EXCHANGEDB_denomination_key_revoke (tmpdir,
- "cur-unit-uuid",
- &dki,
+ TALER_EXCHANGEDB_denomination_key_revoke (revdir,
+ &dki.issue.properties.denom_hash,
&master_priv));
EXITIF (1 !=
- TALER_EXCHANGEDB_denomination_keys_iterate (tmpdir,
- &master_pub,
- &dki_iter_revoked,
- &dki));
-
+ TALER_EXCHANGEDB_revocations_iterate (revdir,
+ &master_pub,
+ &dki_iter_revoked,
+ &dki));
+ GNUNET_free (revdir);
enc_read_size = GNUNET_CRYPTO_rsa_private_key_encode (dki_read.denom_priv.rsa_private_key,
&enc_read);