aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-11-26 22:48:56 +0100
committerChristian Grothoff <christian@grothoff.org>2020-11-26 22:49:42 +0100
commit1c1d4d9974d7a97bd157197adeb11cd759e2b931 (patch)
tree212e52cdd71ced0d8b02d369da44e657e642aeed /src/include
parent2c88cff2837cb6f8b1b95822dd53f1d338055474 (diff)
cmd to add auditor
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_crypto_lib.h12
-rw-r--r--src/include/taler_signatures.h67
-rw-r--r--src/include/taler_testing_lib.h116
3 files changed, 192 insertions, 3 deletions
diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h
index d6f19f449..8be0bad4a 100644
--- a/src/include/taler_crypto_lib.h
+++ b/src/include/taler_crypto_lib.h
@@ -223,6 +223,18 @@ struct TALER_MasterPublicKeyP
/**
+ * @brief Type of the private key used by the auditor.
+ */
+struct TALER_AuditorPrivateKeyP
+{
+ /**
+ * Taler uses EdDSA for the auditor's signing key.
+ */
+ struct GNUNET_CRYPTO_EddsaPrivateKey eddsa_priv;
+};
+
+
+/**
* @brief Type of the public key used by the auditor.
*/
struct TALER_AuditorPublicKeyP
diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h
index d72dd11b9..e732f13b6 100644
--- a/src/include/taler_signatures.h
+++ b/src/include/taler_signatures.h
@@ -57,6 +57,16 @@
#define TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY 1025
/**
+ * Add an auditor to the list of our auditors.
+ */
+#define TALER_SIGNATURE_MASTER_ADD_AUDITOR 1026
+
+/**
+ * Remove an auditor from the list of our auditors.
+ */
+#define TALER_SIGNATURE_MASTER_DEL_AUDITOR 1027
+
+/**
* Fees charged per (aggregate) wire transfer to the merchant.
*/
#define TALER_SIGNATURE_MASTER_WIRE_FEES 1028
@@ -72,6 +82,7 @@
*/
#define TALER_SIGNATURE_MASTER_WIRE_DETAILS 1030
+
/*********************************************/
/* Exchange online signatures (with signing key) */
/*********************************************/
@@ -792,6 +803,62 @@ struct TALER_ExchangeKeySetPS
/**
+ * @brief Signature made by the exchange offline key over the information of
+ * an auditor to be added to the exchange's set of auditors.
+ */
+struct TALER_ExchangeAddAuditorPS
+{
+
+ /**
+ * Purpose is #TALER_SIGNATURE_MASTER_ADD_AUDITOR. Signed
+ * by a `struct TALER_MasterPublicKeyP` using EdDSA.
+ */
+ struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+
+ /**
+ * Time of the change.
+ */
+ struct GNUNET_TIME_AbsoluteNBO start_date;
+
+ /**
+ * Public key of the auditor.
+ */
+ struct TALER_AuditorPublicKeyP auditor_pub;
+
+ /**
+ * Hash over the auditor's URL.
+ */
+ struct GNUNET_HashCode h_auditor_url GNUNET_PACKED;
+};
+
+
+/**
+ * @brief Signature made by the exchange offline key over the information of
+ * an auditor to be removed to the exchange's set of auditors.
+ */
+struct TALER_ExchangeDelAuditorPS
+{
+
+ /**
+ * Purpose is #TALER_SIGNATURE_MASTER_DEL_AUDITOR. Signed
+ * by a `struct TALER_MasterPublicKeyP` using EdDSA.
+ */
+ struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+
+ /**
+ * Time of the change.
+ */
+ struct GNUNET_TIME_AbsoluteNBO end_date;
+
+ /**
+ * Public key of the auditor.
+ */
+ struct TALER_AuditorPublicKeyP auditor_pub;
+
+};
+
+
+/**
* @brief Information about a denomination key. Denomination keys
* are used to sign coins of a certain value into existence.
*/
diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h
index 74148b8f5..61f1c50a6 100644
--- a/src/include/taler_testing_lib.h
+++ b/src/include/taler_testing_lib.h
@@ -417,7 +417,7 @@ struct TALER_TESTING_Interpreter
struct GNUNET_OS_Process *exchanged;
/**
- * GNUNET_OK if key state should be reloaded. NOTE: this
+ * #GNUNET_OK if key state should be reloaded. NOTE: this
* field can be removed because a new "send signal" command
* has been introduced.
*/
@@ -1083,8 +1083,6 @@ struct TALER_TESTING_Command
TALER_TESTING_cmd_exchanges_with_retry (struct TALER_TESTING_Command cmd);
-/* ***** Commands ONLY for testing (/admin-API) **** */
-
/**
* Create /admin/add-incoming command.
*
@@ -2021,6 +2019,118 @@ struct TALER_TESTING_Command
TALER_TESTING_cmd_stat (struct TALER_TESTING_Timer *timers);
+/**
+ * Add the auditor to the exchange's list of auditors.
+ * The information about the auditor is taken from the
+ * "[auditor]" section in the configuration file.
+ *
+ * @param label command label.
+ * @param expected_http_status expected HTTP status from exchange
+ * @param bad_sig should we use a bogus signature?
+ * @return the command
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_auditor_add (const char *label,
+ unsigned int expected_http_status,
+ bool bad_sig);
+
+
+/**
+ * Remove the auditor from the exchange's list of auditors.
+ * The information about the auditor is taken from the
+ * "[auditor]" section in the configuration file.
+ *
+ * @param label command label.
+ * @return the command
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_auditor_del (const char *label);
+
+
+/**
+ * Add the given payto-URI bank account to the list of bank
+ * accounts used by the exchange.
+ *
+ * @param label command label.
+ * @param payto_uri URI identifying the bank account
+ * @return the command
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_wire_add (const char *label,
+ const char *payto_uri);
+
+
+/**
+ * Remove the given payto-URI bank account from the list of bank
+ * accounts used by the exchange.
+ *
+ * @param label command label.
+ * @param payto_uri URI identifying the bank account
+ * @return the command
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_wire_del (const char *label,
+ const char *payto_uri);
+
+
+/**
+ * Sign all exchange denomination and online signing keys
+ * with the "offline" key and provide those signatures to
+ * the exchange. (Downloads the keys, makes the signature
+ * and uploads the result, all in one.)
+ *
+ * @param label command label.
+ * @param config_filename configuration filename.
+ * @return the command
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_offline_sign_keys (const char *label,
+ const char *config_filename);
+
+
+/**
+ * Revoke an exchange denomination key.
+ *
+ * @param label command label.
+ * @param denom_ref reference to a command that identifies
+ * a denomination key (i.e. because it was used to
+ * withdraw a coin).
+ * @return the command
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_revoke_denom_key (const char *label,
+ const char *denom_ref);
+
+
+/**
+ * Have the auditor affirm that it is auditing the given
+ * denomination key and upload the auditor's signature to
+ * the exchange.
+ *
+ * @param label command label.
+ * @param denom_ref reference to a command that identifies
+ * a denomination key (i.e. because it was used to
+ * withdraw a coin).
+ * @return the command
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_auditor_add_denom_key (const char *denom_ref);
+
+
+/**
+ * Revoke an exchange signing key.
+ *
+ * @param label command label.
+ * @param denom_ref reference to a command that identifies
+ * a signing key (i.e. because it was used to
+ * sign a deposit confirmation).
+ * @return the command
+ */
+struct TALER_TESTING_Command
+TALER_TESTING_cmd_revoke_denom_key (const char *label,
+ const char *signkey_ref);
+
+
/* *** Generic trait logic for implementing traits ********* */
/**