gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: add cmd to revoke exchange onlin


From: gnunet
Subject: [taler-exchange] branch master updated: add cmd to revoke exchange online signing key
Date: Fri, 27 Nov 2020 00:36:21 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new a69079ef add cmd to revoke exchange online signing key
a69079ef is described below

commit a69079ef6c4278a4653028e9587a4ecd84ae4aff
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Fri Nov 27 00:36:19 2020 +0100

    add cmd to revoke exchange online signing key
---
 src/include/taler_signatures.h                     | 18 ++++++++++
 src/include/taler_testing_lib.h                    | 31 ++++++++++-------
 src/testing/Makefile.am                            |  1 +
 src/testing/testing_api_cmd_revoke_denom_key.c     |  2 +-
 ...nom_key.c => testing_api_cmd_revoke_sign_key.c} | 40 +++++++++++-----------
 5 files changed, 58 insertions(+), 34 deletions(-)

diff --git a/src/include/taler_signatures.h b/src/include/taler_signatures.h
index 90d77244..d80b267c 100644
--- a/src/include/taler_signatures.h
+++ b/src/include/taler_signatures.h
@@ -1204,6 +1204,24 @@ struct TALER_MasterDenominationKeyRevocationPS
 };
 
 
+/**
+ * @brief Message confirming that an exchange online signing key was revoked.
+ */
+struct TALER_MasterSigningKeyRevocationPS
+{
+  /**
+   * Purpose is #TALER_SIGNATURE_MASTER_SIGNING_KEY_REVOKED.
+   */
+  struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+
+  /**
+   * The exchange's public key.
+   */
+  struct TALER_ExchangePublicKeyP exchange_pub;
+
+};
+
+
 /**
  * @brief Format used to generate the signature on a request to obtain
  * the wire transfer identifier associated with a deposit.
diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h
index 9ddc28a3..65df9494 100644
--- a/src/include/taler_testing_lib.h
+++ b/src/include/taler_testing_lib.h
@@ -2112,7 +2112,7 @@ TALER_TESTING_cmd_offline_sign_keys (const char *label,
  * @return the command
  */
 struct TALER_TESTING_Command
-TALER_TESTING_cmd_revoke_denomination (
+TALER_TESTING_cmd_revoke_denom_key (
   const char *label,
   unsigned int expected_response_code,
   bool bad_sig,
@@ -2120,32 +2120,37 @@ TALER_TESTING_cmd_revoke_denomination (
 
 
 /**
- * Have the auditor affirm that it is auditing the given
- * denomination key and upload the auditor's signature to
- * the exchange.
+ * Revoke an exchange online signing 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).
+ * @param expected_http_status expected HTTP status from exchange
+ * @param bad_sig should we use a bogus signature?
+ * @param signkey_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_auditor_add_denom_key (const char *denom_ref);
+TALER_TESTING_cmd_revoke_sign_key (
+  const char *label,
+  unsigned int expected_response_code,
+  bool bad_sig,
+  const char *signkey_ref);
 
 
 /**
- * Revoke an exchange signing key.
+ * 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 signing key (i.e. because it was used to
- *        sign a deposit confirmation).
+ *        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 *signkey_ref);
+TALER_TESTING_cmd_auditor_add_denom_key (const char *denom_ref);
 
 
 /* *** Generic trait logic for implementing traits ********* */
diff --git a/src/testing/Makefile.am b/src/testing/Makefile.am
index a2a016ac..7539cecc 100644
--- a/src/testing/Makefile.am
+++ b/src/testing/Makefile.am
@@ -65,6 +65,7 @@ libtalertesting_la_SOURCES = \
   testing_api_cmd_refresh.c \
   testing_api_cmd_revoke.c \
   testing_api_cmd_revoke_denom_key.c \
+  testing_api_cmd_revoke_sign_key.c \
   testing_api_cmd_rewind.c \
   testing_api_cmd_serialize_keys.c \
   testing_api_cmd_signal.c \
diff --git a/src/testing/testing_api_cmd_revoke_denom_key.c 
b/src/testing/testing_api_cmd_revoke_denom_key.c
index 133838e3..2e524338 100644
--- a/src/testing/testing_api_cmd_revoke_denom_key.c
+++ b/src/testing/testing_api_cmd_revoke_denom_key.c
@@ -271,7 +271,7 @@ revoke_run (void *cls,
 
 
 struct TALER_TESTING_Command
-TALER_TESTING_cmd_revoke_denomination (
+TALER_TESTING_cmd_revoke_denom_key (
   const char *label,
   unsigned int expected_response_code,
   bool bad_sig,
diff --git a/src/testing/testing_api_cmd_revoke_denom_key.c 
b/src/testing/testing_api_cmd_revoke_sign_key.c
similarity index 87%
copy from src/testing/testing_api_cmd_revoke_denom_key.c
copy to src/testing/testing_api_cmd_revoke_sign_key.c
index 133838e3..72f288d7 100644
--- a/src/testing/testing_api_cmd_revoke_denom_key.c
+++ b/src/testing/testing_api_cmd_revoke_sign_key.c
@@ -17,7 +17,7 @@
   <http://www.gnu.org/licenses/>
 */
 /**
- * @file testing/testing_api_cmd_revoke_denom_key.c
+ * @file testing/testing_api_cmd_revoke_sign_key.c
  * @brief Implement the revoke test command.
  * @author Christian Grothoff
  */
@@ -39,7 +39,7 @@ struct RevokeState
   unsigned int expected_response_code;
 
   /**
-   * Command that offers a denomination to revoke.
+   * Command that offers a signination to revoke.
    */
   const char *coin_reference;
 
@@ -51,7 +51,7 @@ struct RevokeState
   /**
    * Handle for the operation.
    */
-  struct TALER_EXCHANGE_ManagementRevokeDenominationKeyHandle *kh;
+  struct TALER_EXCHANGE_ManagementRevokeSigningKeyHandle *kh;
 
   /**
    * Should we use a bogus signature?
@@ -107,7 +107,7 @@ revoke_cleanup (void *cls,
 
   if (NULL != rs->kh)
   {
-    TALER_EXCHANGE_management_revoke_denomination_key_cancel (rs->kh);
+    TALER_EXCHANGE_management_revoke_signing_key_cancel (rs->kh);
     rs->kh = NULL;
   }
   GNUNET_free (rs);
@@ -145,7 +145,7 @@ revoke_traits (void *cls,
 /**
  * Run the "revoke" command.  The core of the function
  * is to call the "keyup" utility passing it the base32
- * encoding of the denomination to revoke.
+ * encoding of the signination to revoke.
  *
  * @param cls closure.
  * @param cmd the command to execute.
@@ -158,12 +158,12 @@ revoke_run (void *cls,
 {
   struct RevokeState *rs = cls;
   const struct TALER_TESTING_Command *coin_cmd;
-  const struct TALER_EXCHANGE_DenomPublicKey *denom_pub;
+  const struct TALER_ExchangePublicKeyP *exchange_pub;
   char *exchange_url;
   struct TALER_MasterSignatureP master_sig;
 
   rs->is = is;
-  /* Get denom pub from trait */
+  /* Get sign pub from trait */
   coin_cmd = TALER_TESTING_interpreter_lookup_command (is,
                                                        rs->coin_reference);
 
@@ -174,12 +174,12 @@ revoke_run (void *cls,
     return;
   }
   GNUNET_assert (GNUNET_OK ==
-                 TALER_TESTING_get_trait_denom_pub (coin_cmd,
-                                                    0,
-                                                    &denom_pub));
+                 TALER_TESTING_get_trait_exchange_pub (coin_cmd,
+                                                       0,
+                                                       &exchange_pub));
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-              "Trying to revoke denom '%s..'\n",
-              TALER_B2S (&denom_pub->h_key));
+              "Trying to revoke sign '%s..'\n",
+              TALER_B2S (exchange_pub));
   if (rs->bad_sig)
   {
     memset (&master_sig,
@@ -229,11 +229,11 @@ revoke_run (void *cls,
 
     /* now sign */
     {
-      struct TALER_MasterDenominationKeyRevocationPS kv = {
+      struct TALER_MasterSigningKeyRevocationPS kv = {
         .purpose.purpose = htonl (
-          TALER_SIGNATURE_MASTER_DENOMINATION_KEY_REVOKED),
+          TALER_SIGNATURE_MASTER_SIGNING_KEY_REVOKED),
         .purpose.size = htonl (sizeof (kv)),
-        .h_denom_pub = denom_pub->h_key
+        .exchange_pub = *exchange_pub
       };
 
       GNUNET_CRYPTO_eddsa_sign (&master_priv.eddsa_priv,
@@ -253,10 +253,10 @@ revoke_run (void *cls,
     TALER_TESTING_interpreter_next (rs->is);
     return;
   }
-  rs->kh = TALER_EXCHANGE_management_revoke_denomination_key (
+  rs->kh = TALER_EXCHANGE_management_revoke_signing_key (
     is->ctx,
     exchange_url,
-    &denom_pub->h_key,
+    exchange_pub,
     &master_sig,
     &success_cb,
     rs);
@@ -271,17 +271,17 @@ revoke_run (void *cls,
 
 
 struct TALER_TESTING_Command
-TALER_TESTING_cmd_revoke_denomination (
+TALER_TESTING_cmd_revoke_sign_key (
   const char *label,
   unsigned int expected_response_code,
   bool bad_sig,
-  const char *denom_ref)
+  const char *sign_ref)
 {
   struct RevokeState *rs;
 
   rs = GNUNET_new (struct RevokeState);
   rs->expected_response_code = expected_response_code;
-  rs->coin_reference = denom_ref;
+  rs->coin_reference = sign_ref;
   rs->bad_sig = bad_sig;
   {
     struct TALER_TESTING_Command cmd = {

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]