summaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-11-29 16:21:10 +0100
committerChristian Grothoff <christian@grothoff.org>2020-11-29 16:21:10 +0100
commit6b434c626f6335f8174e0164ead61b3874752c4a (patch)
treef26d256d8912721de26413ef259975112aab4e09 /src/exchange
parent3240844e48dc62b80c6167558677bcd7b83dd3c0 (diff)
downloadexchange-6b434c626f6335f8174e0164ead61b3874752c4a.tar.gz
exchange-6b434c626f6335f8174e0164ead61b3874752c4a.tar.bz2
exchange-6b434c626f6335f8174e0164ead61b3874752c4a.zip
work on DB logic, add auditor_name to /management/auditors API
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/taler-exchange-httpd_management_auditors.c13
-rw-r--r--src/exchange/taler-exchange-httpd_management_auditors_AP_disable.c13
2 files changed, 15 insertions, 11 deletions
diff --git a/src/exchange/taler-exchange-httpd_management_auditors.c b/src/exchange/taler-exchange-httpd_management_auditors.c
index adfe94d9..c794c987 100644
--- a/src/exchange/taler-exchange-httpd_management_auditors.c
+++ b/src/exchange/taler-exchange-httpd_management_auditors.c
@@ -51,6 +51,11 @@ struct AddAuditorContext
const char *auditor_url;
/**
+ * Human readable name of the auditor.
+ */
+ const char *auditor_name;
+
+ /**
* Timestamp for checking against replay attacks.
*/
struct GNUNET_TIME_Absolute validity_start;
@@ -112,15 +117,15 @@ add_auditor (void *cls,
session,
&aac->auditor_pub,
aac->auditor_url,
- aac->validity_start,
- &aac->master_sig);
+ aac->auditor_name,
+ aac->validity_start);
else
qs = TEH_plugin->update_auditor (TEH_plugin->cls,
session,
&aac->auditor_pub,
aac->auditor_url,
+ aac->auditor_name,
aac->validity_start,
- &aac->master_sig,
true);
if (qs < 0)
{
@@ -159,6 +164,8 @@ TEH_handler_management_auditors (
&aac.auditor_pub),
GNUNET_JSON_spec_string ("auditor_url",
&aac.auditor_url),
+ GNUNET_JSON_spec_string ("auditor_name",
+ &aac.auditor_name),
TALER_JSON_spec_absolute_time ("validity_start",
&aac.validity_start),
GNUNET_JSON_spec_end ()
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 60f0f539..0a1d2c54 100644
--- a/src/exchange/taler-exchange-httpd_management_auditors_AP_disable.c
+++ b/src/exchange/taler-exchange-httpd_management_auditors_AP_disable.c
@@ -35,10 +35,6 @@
*/
struct DelAuditorContext
{
- /**
- * Master signature to store.
- */
- struct TALER_MasterSignatureP master_sig;
/**
* Auditor public key this is about.
@@ -119,9 +115,9 @@ del_auditor (void *cls,
qs = TEH_plugin->update_auditor (TEH_plugin->cls,
session,
&dac->auditor_pub,
- "",
+ "", /* auditor URL */
+ "", /* auditor name */
dac->validity_end,
- &dac->master_sig,
false);
if (qs < 0)
{
@@ -152,10 +148,11 @@ TEH_handler_management_auditors_AP_disable (
const struct GNUNET_HashCode *h_denom_pub,
const json_t *root)
{
+ struct TALER_MasterSignatureP master_sig;
struct DelAuditorContext dac;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed_auto ("master_sig",
- &dac.master_sig),
+ &master_sig),
GNUNET_JSON_spec_fixed_auto ("auditor_pub",
&dac.auditor_pub),
TALER_JSON_spec_absolute_time ("validity_end",
@@ -189,7 +186,7 @@ TEH_handler_management_auditors_AP_disable (
GNUNET_CRYPTO_eddsa_verify (
TALER_SIGNATURE_MASTER_DEL_AUDITOR,
&da,
- &dac.master_sig.eddsa_signature,
+ &master_sig.eddsa_signature,
&TEH_master_public_key.eddsa_pub))
{
GNUNET_break_op (0);