gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] branch master updated: hash and public key


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated: hash and public key traits.
Date: Sat, 17 Feb 2018 15:40:03 +0100

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

marcello pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 844f39c  hash and public key traits.
844f39c is described below

commit 844f39c85ecd85f1a49881b264bf4f10c93401e2
Author: Marcello Stanisci <address@hidden>
AuthorDate: Sat Feb 17 15:39:44 2018 +0100

    hash and public key traits.
---
 src/exchange-lib/testing_api_trait_hash.c     |  1 +
 src/exchange-lib/testing_api_trait_key_peer.c | 49 ++++++++++++++++++++++++---
 src/include/taler_testing_lib.h               | 27 +++++++++++++++
 3 files changed, 72 insertions(+), 5 deletions(-)

diff --git a/src/exchange-lib/testing_api_trait_hash.c 
b/src/exchange-lib/testing_api_trait_hash.c
index 5a8ed7d..2ecc98e 100644
--- a/src/exchange-lib/testing_api_trait_hash.c
+++ b/src/exchange-lib/testing_api_trait_hash.c
@@ -52,6 +52,7 @@ TALER_TESTING_get_trait_hash
                       index);
 }
 
+
 /**
  * @param index associate the hash code with this index
  * @param hash which hash code should be returned
diff --git a/src/exchange-lib/testing_api_trait_key_peer.c 
b/src/exchange-lib/testing_api_trait_key_peer.c
index d4e207c..e4aee5d 100644
--- a/src/exchange-lib/testing_api_trait_key_peer.c
+++ b/src/exchange-lib/testing_api_trait_key_peer.c
@@ -29,12 +29,8 @@
 #include "taler_signatures.h"
 #include "taler_testing_lib.h"
 
-/**
- * NOTE: calling it "peer" key to make clear it is _not a coin_
- *       key.
- */
-
 #define TALER_TESTING_TRAIT_KEY_PEER "key-peer"
+#define TALER_TESTING_TRAIT_KEY_PEER_PUB "key-peer-pub"
 
 /**
  * Obtain a private key from a "peer".  Used e.g. to obtain
@@ -79,4 +75,47 @@ TALER_TESTING_make_trait_peer_key
   return ret;
 }
 
+
+/**
+ * Obtain a public key from a "peer".  Used e.g. to obtain
+ * a merchant's public key to use backend's API.
+ *
+ * @param index (tipically zero) which key to return if they
+ *        exist in an array.
+ * @param pub[out] set to the key coming from @a cmd.
+ * @return #GNUNET_OK on success
+ */
+int
+TALER_TESTING_get_trait_peer_key_pub
+  (const struct TALER_TESTING_Command *cmd,
+   unsigned int index,
+   const struct GNUNET_CRYPTO_EddsaPublicKey **pub)
+{
+  return cmd->traits (cmd->cls,
+                      (void **) pub,
+                      TALER_TESTING_TRAIT_KEY_PEER_PUB,
+                      index);
+}
+
+/**
+ * @param index (tipically zero) which key to return if they
+ *        exist in an array.
+ * @param pub which object should be returned
+ *
+ * @return the trait, to be put in the traits array of the command
+ */
+struct TALER_TESTING_Trait
+TALER_TESTING_make_trait_peer_key_pub
+  (unsigned int index,
+   struct GNUNET_CRYPTO_EddsaPublicKey *pub)
+{
+  struct TALER_TESTING_Trait ret = {
+    .index = index,
+    .trait_name = TALER_TESTING_TRAIT_KEY_PEER_PUB,
+    .ptr = (const void *) pub
+  };
+  return ret;
+}
+
+
 /* end of testing_api_trait_key_peer.c */
diff --git a/src/include/taler_testing_lib.h b/src/include/taler_testing_lib.h
index 34f3217..f2219dc 100644
--- a/src/include/taler_testing_lib.h
+++ b/src/include/taler_testing_lib.h
@@ -1167,6 +1167,33 @@ TALER_TESTING_make_trait_peer_key
 
 
 /**
+ * Obtain a public key from a "peer".  Used e.g. to obtain
+ * a merchant's public key to use backend's API.
+ *
+ * @param index (tipically zero) which key to return if they
+ *        exist in an array.
+ * @param pub[out] set to the key coming from @a cmd.
+ * @return #GNUNET_OK on success
+ */
+int
+TALER_TESTING_get_trait_peer_key_pub
+  (const struct TALER_TESTING_Command *cmd,
+   unsigned int index,
+   const struct GNUNET_CRYPTO_EddsaPublicKey **pub);
+
+/**
+ * @param index (tipically zero) which key to return if they
+ *        exist in an array.
+ * @param pub which object should be returned
+ *
+ * @return the trait, to be put in the traits array of the command
+ */
+struct TALER_TESTING_Trait
+TALER_TESTING_make_trait_peer_key_pub
+  (unsigned int index,
+   struct GNUNET_CRYPTO_EddsaPublicKey *pub);
+
+/**
  * Obtain a transfer subject from @a cmd.
  *
  * @param cmd command to extract trait from

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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