[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-merchant] branch master updated: testcase extracts m
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-merchant] branch master updated: testcase extracts merchant priv from config |
Date: |
Tue, 04 Jul 2017 19:33:25 +0200 |
This is an automated email from the git hooks/post-receive script.
marcello pushed a commit to branch master
in repository merchant.
The following commit(s) were added to refs/heads/master by this push:
new aef6d79 testcase extracts merchant priv from config
aef6d79 is described below
commit aef6d798c8982e93bc68c94b1c9c09b160672d54
Author: Marcello Stanisci <address@hidden>
AuthorDate: Tue Jul 4 19:32:44 2017 +0200
testcase extracts merchant priv from config
---
src/lib/test_merchant_api.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c
index 3474efb..78b9bb6 100644
--- a/src/lib/test_merchant_api.c
+++ b/src/lib/test_merchant_api.c
@@ -717,6 +717,40 @@ struct InterpreterState
*/
static struct GNUNET_DISK_PipeHandle *sigpipe;
+/**
+ * Return instance private key from config
+ *
+ * @param config configuration handle
+ * @param instance instance name
+ * @return pointer to private key, NULL on error
+ */
+struct GNUNET_CRYPTO_EddsaPrivateKey *
+get_instance_priv (struct GNUNET_CONFIGURATION_Handle *config,
+ const char *instance)
+{
+ char *config_section;
+ char *filename;
+ struct GNUNET_CRYPTO_EddsaPrivateKey *ret;
+
+ (void) GNUNET_asprintf (&config_section,
+ "merchant-instance-%s",
+ instance);
+
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_filename (config,
+ config_section,
+ "KEYFILE",
+ &filename))
+ {
+ GNUNET_break (0);
+ return NULL;
+ }
+ if (NULL ==
+ (ret = GNUNET_CRYPTO_eddsa_key_create_from_file (filename)))
+ GNUNET_break (0);
+
+ return ret;
+}
/**
* The testcase failed, return with an error code.
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [taler-merchant] branch master updated: testcase extracts merchant priv from config,
gnunet <=