From 4dea098f54757f618abcfdfd27514bdab281997a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 23 Feb 2019 14:47:44 +0100 Subject: actually disable 100 continue --- src/exchange-tools/taler-exchange-keycheck.c | 5 +- src/exchange-tools/taler-exchange-keyup.c | 93 ++++------------------------ 2 files changed, 13 insertions(+), 85 deletions(-) (limited to 'src/exchange-tools') diff --git a/src/exchange-tools/taler-exchange-keycheck.c b/src/exchange-tools/taler-exchange-keycheck.c index 74b73cd09..d58237738 100644 --- a/src/exchange-tools/taler-exchange-keycheck.c +++ b/src/exchange-tools/taler-exchange-keycheck.c @@ -120,7 +120,6 @@ exchange_signkeys_check () * @param cls closure (NULL) * @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! @@ -128,8 +127,7 @@ exchange_signkeys_check () static int denomkeys_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) { struct GNUNET_HashCode hc; @@ -206,7 +204,6 @@ exchange_denomkeys_check () return GNUNET_NO; } if (0 > TALER_EXCHANGEDB_denomination_keys_iterate (exchange_directory, - &master_public_key_from_cfg, &denomkeys_iter, NULL)) return GNUNET_NO; diff --git a/src/exchange-tools/taler-exchange-keyup.c b/src/exchange-tools/taler-exchange-keyup.c index cf774957f..f51ff961c 100644 --- a/src/exchange-tools/taler-exchange-keyup.c +++ b/src/exchange-tools/taler-exchange-keyup.c @@ -1111,73 +1111,6 @@ create_wire_fees () } -/** - * Closure for functions processing a request to revoke a denomination - * public key and request the wallets to initiate /payback. - */ -struct RevokeClosure -{ - /** - * Hash of the denomination public key to revoke. - */ - const struct GNUNET_HashCode *hc; - - /** - * Base directory for keys. - */ - char *basedir; - - /** - * Set to #GNUNET_OK if we found a matching key, - * Set to #GNUNET_SYSERR on error. - */ - int ok; -}; - - - -/** - * Revoke denomination keys matching the given hash. - * - * @param cls a `struct RevokeClosure` with information about what to revoke - * @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! - */ -static int -exchange_keys_revoke_by_dki (void *cls, - const char *alias, - const struct TALER_EXCHANGEDB_DenominationKeyIssueInformation *dki, - const struct TALER_MasterSignatureP *revocation_master_sig) -{ - struct RevokeClosure *rc = cls; - - if (NULL != revocation_master_sig) - return GNUNET_OK; /* refuse to do it twice */ - if (0 != memcmp (rc->hc, - &dki->issue.properties.denom_hash, - sizeof (struct GNUNET_HashCode))) - return GNUNET_OK; - rc->ok = GNUNET_OK; - if (GNUNET_OK != - TALER_EXCHANGEDB_denomination_key_revoke (rc->basedir, - alias, - dki, - &master_priv)) - { - rc->ok = GNUNET_SYSERR; - return GNUNET_SYSERR; - } - GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Successfully revoking denom '%s..'\n", - TALER_B2S (rc->hc)); - return GNUNET_NO; -} - - /** * Revoke the denomination key matching @a hc and request /payback to be * initiated. @@ -1190,32 +1123,30 @@ exchange_keys_revoke_by_dki (void *cls, static int revoke_denomination (const struct GNUNET_HashCode *hc) { - struct RevokeClosure rc; - - rc.hc = hc; - rc.ok = GNUNET_NO; + char *basedir; + if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_filename (kcfg, "exchange", - "KEYDIR", - &rc.basedir)) + "REVOCATION_DIR", + &basedir)) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "exchange", - "KEYDIR"); + "REVOCATION_DIR"); return GNUNET_SYSERR; } - if (-1 == - TALER_EXCHANGEDB_denomination_keys_iterate (rc.basedir, - &master_public_key, - &exchange_keys_revoke_by_dki, - &rc)) + if (GNUNET_OK != + TALER_EXCHANGEDB_denomination_key_revoke (basedir, + hc, + &master_priv)) { + GNUNET_free (basedir); GNUNET_break (0); return GNUNET_SYSERR; } - GNUNET_free (rc.basedir); - return rc.ok; + GNUNET_free (basedir); + return GNUNET_OK; } -- cgit v1.2.3