summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_revoke_sign_key.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-12-01 09:19:58 +0100
committerChristian Grothoff <christian@grothoff.org>2020-12-01 09:19:58 +0100
commit06b8ed9ba8ed30181285b6c75089150d2662b366 (patch)
treea23cd37b036e90d1b85bf9c97d95f476342766ee /src/testing/testing_api_cmd_revoke_sign_key.c
parent65915731a93a3057bb1844187b1aa3b476c4bd42 (diff)
downloadexchange-06b8ed9ba8ed30181285b6c75089150d2662b366.tar.gz
exchange-06b8ed9ba8ed30181285b6c75089150d2662b366.tar.bz2
exchange-06b8ed9ba8ed30181285b6c75089150d2662b366.zip
start with exchange management test
Diffstat (limited to 'src/testing/testing_api_cmd_revoke_sign_key.c')
-rw-r--r--src/testing/testing_api_cmd_revoke_sign_key.c76
1 files changed, 10 insertions, 66 deletions
diff --git a/src/testing/testing_api_cmd_revoke_sign_key.c b/src/testing/testing_api_cmd_revoke_sign_key.c
index 72f288d78..d85f63053 100644
--- a/src/testing/testing_api_cmd_revoke_sign_key.c
+++ b/src/testing/testing_api_cmd_revoke_sign_key.c
@@ -159,7 +159,6 @@ revoke_run (void *cls,
struct RevokeState *rs = cls;
const struct TALER_TESTING_Command *coin_cmd;
const struct TALER_ExchangePublicKeyP *exchange_pub;
- char *exchange_url;
struct TALER_MasterSignatureP master_sig;
rs->is = is;
@@ -188,79 +187,24 @@ revoke_run (void *cls,
}
else
{
- char *fn;
- struct TALER_MasterPrivateKeyP master_priv;
-
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_filename (is->cfg,
- "exchange-offline",
- "MASTER_PRIV_FILE",
- &fn))
- {
- GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "exchange-offline",
- "MASTER_PRIV_FILE");
- TALER_TESTING_interpreter_next (rs->is);
- return;
- }
- if (GNUNET_SYSERR ==
- GNUNET_DISK_directory_create_for_file (fn))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Could not setup directory for master private key file `%s'\n",
- fn);
- GNUNET_free (fn);
- TALER_TESTING_interpreter_next (rs->is);
- return;
- }
- if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_key_from_file (fn,
- GNUNET_YES,
- &master_priv.eddsa_priv))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Could not load master private key from `%s'\n",
- fn);
- GNUNET_free (fn);
- TALER_TESTING_interpreter_next (rs->is);
- return;
- }
- GNUNET_free (fn);
-
- /* now sign */
- {
- struct TALER_MasterSigningKeyRevocationPS kv = {
- .purpose.purpose = htonl (
- TALER_SIGNATURE_MASTER_SIGNING_KEY_REVOKED),
- .purpose.size = htonl (sizeof (kv)),
- .exchange_pub = *exchange_pub
- };
+ struct TALER_MasterSigningKeyRevocationPS kv = {
+ .purpose.purpose = htonl (
+ TALER_SIGNATURE_MASTER_SIGNING_KEY_REVOKED),
+ .purpose.size = htonl (sizeof (kv)),
+ .exchange_pub = *exchange_pub
+ };
- GNUNET_CRYPTO_eddsa_sign (&master_priv.eddsa_priv,
- &kv,
- &master_sig.eddsa_signature);
- }
- }
- if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (is->cfg,
- "exchange",
- "BASE_URL",
- &exchange_url))
- {
- GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
- "exchange",
- "BASE_URL");
- TALER_TESTING_interpreter_next (rs->is);
- return;
+ GNUNET_CRYPTO_eddsa_sign (&is->master_priv.eddsa_priv,
+ &kv,
+ &master_sig.eddsa_signature);
}
rs->kh = TALER_EXCHANGE_management_revoke_signing_key (
is->ctx,
- exchange_url,
+ is->exchange_url,
exchange_pub,
&master_sig,
&success_cb,
rs);
- GNUNET_free (exchange_url);
if (NULL == rs->kh)
{
GNUNET_break (0);