summaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-12-16 12:56:35 +0100
committerChristian Grothoff <christian@grothoff.org>2020-12-16 12:56:35 +0100
commit96b4c139ee9997f827e9559a186c9684a5978f4b (patch)
tree483f6bf7bd2a5f4a253921c7586432d831e1b8d3 /src/exchange
parent18c12f62347c2c3767a36577f352fc39df532801 (diff)
downloadexchange-96b4c139ee9997f827e9559a186c9684a5978f4b.tar.gz
exchange-96b4c139ee9997f827e9559a186c9684a5978f4b.tar.bz2
exchange-96b4c139ee9997f827e9559a186c9684a5978f4b.zip
add auditor-enable /-disable commands to taler-exchange-offline tool
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/taler-exchange-httpd_management_auditors.c38
-rw-r--r--src/exchange/taler-exchange-httpd_management_auditors_AP_disable.c34
2 files changed, 25 insertions, 47 deletions
diff --git a/src/exchange/taler-exchange-httpd_management_auditors.c b/src/exchange/taler-exchange-httpd_management_auditors.c
index acb8f2c5..6d700d61 100644
--- a/src/exchange/taler-exchange-httpd_management_auditors.c
+++ b/src/exchange/taler-exchange-httpd_management_auditors.c
@@ -176,32 +176,20 @@ TEH_handler_management_auditors (
if (GNUNET_NO == res)
return MHD_YES; /* failure */
}
+ if (GNUNET_OK !=
+ TALER_exchange_offline_auditor_add_verify (
+ &aac.auditor_pub,
+ aac.auditor_url,
+ aac.validity_start,
+ &TEH_master_public_key,
+ &aac.master_sig))
{
- struct TALER_MasterAddAuditorPS aa = {
- .purpose.purpose = htonl (
- TALER_SIGNATURE_MASTER_ADD_AUDITOR),
- .purpose.size = htonl (sizeof (aa)),
- .start_date = GNUNET_TIME_absolute_hton (aac.validity_start),
- .auditor_pub = aac.auditor_pub
- };
-
- GNUNET_CRYPTO_hash (aac.auditor_url,
- strlen (aac.auditor_url) + 1,
- &aa.h_auditor_url);
- if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (
- TALER_SIGNATURE_MASTER_ADD_AUDITOR,
- &aa,
- &aac.master_sig.eddsa_signature,
- &TEH_master_public_key.eddsa_pub))
- {
- GNUNET_break_op (0);
- return TALER_MHD_reply_with_error (
- connection,
- MHD_HTTP_FORBIDDEN,
- TALER_EC_EXCHANGE_MANAGEMENT_AUDITOR_ADD_SIGNATURE_INVALID,
- NULL);
- }
+ GNUNET_break_op (0);
+ return TALER_MHD_reply_with_error (
+ connection,
+ MHD_HTTP_FORBIDDEN,
+ TALER_EC_EXCHANGE_MANAGEMENT_AUDITOR_ADD_SIGNATURE_INVALID,
+ NULL);
}
qs = TEH_DB_run_transaction (connection,
diff --git a/src/exchange/taler-exchange-httpd_management_auditors_AP_disable.c b/src/exchange/taler-exchange-httpd_management_auditors_AP_disable.c
index 222af60e..eba392a0 100644
--- a/src/exchange/taler-exchange-httpd_management_auditors_AP_disable.c
+++ b/src/exchange/taler-exchange-httpd_management_auditors_AP_disable.c
@@ -165,29 +165,19 @@ TEH_handler_management_auditors_AP_disable (
if (GNUNET_NO == res)
return MHD_YES; /* failure */
}
+ if (GNUNET_OK !=
+ TALER_exchange_offline_auditor_del_verify (
+ auditor_pub,
+ dac.validity_end,
+ &TEH_master_public_key,
+ &master_sig))
{
- struct TALER_MasterDelAuditorPS da = {
- .purpose.purpose = htonl (
- TALER_SIGNATURE_MASTER_DEL_AUDITOR),
- .purpose.size = htonl (sizeof (da)),
- .end_date = GNUNET_TIME_absolute_hton (dac.validity_end),
- .auditor_pub = *auditor_pub
- };
-
- if (GNUNET_OK !=
- GNUNET_CRYPTO_eddsa_verify (
- TALER_SIGNATURE_MASTER_DEL_AUDITOR,
- &da,
- &master_sig.eddsa_signature,
- &TEH_master_public_key.eddsa_pub))
- {
- GNUNET_break_op (0);
- return TALER_MHD_reply_with_error (
- connection,
- MHD_HTTP_FORBIDDEN,
- TALER_EC_EXCHANGE_MANAGEMENT_AUDITOR_DEL_SIGNATURE_INVALID,
- NULL);
- }
+ GNUNET_break_op (0);
+ return TALER_MHD_reply_with_error (
+ connection,
+ MHD_HTTP_FORBIDDEN,
+ TALER_EC_EXCHANGE_MANAGEMENT_AUDITOR_DEL_SIGNATURE_INVALID,
+ NULL);
}
qs = TEH_DB_run_transaction (connection,