[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] 02/03: modified testing cmd secret_share
From: |
gnunet |
Subject: |
[taler-anastasis] 02/03: modified testing cmd secret_share |
Date: |
Mon, 04 May 2020 09:47:42 +0200 |
This is an automated email from the git hooks/post-receive script.
dennis-neufeld pushed a commit to branch master
in repository anastasis.
commit 88ea9e25817987ac759790f6f3872f0d8a5e46ff
Author: Dennis Neufeld <address@hidden>
AuthorDate: Mon May 4 07:38:32 2020 +0000
modified testing cmd secret_share
---
src/lib/testing_cmd_secret_share.c | 88 ++++++++++++++++++++++++++++++++++++++
1 file changed, 88 insertions(+)
diff --git a/src/lib/testing_cmd_secret_share.c
b/src/lib/testing_cmd_secret_share.c
index ef7db5c..2ff8de0 100644
--- a/src/lib/testing_cmd_secret_share.c
+++ b/src/lib/testing_cmd_secret_share.c
@@ -27,6 +27,30 @@
#include <taler/taler_testing_lib.h>
+/**
+* Policy object to upload
+*/
+struct Policy
+{
+ /**
+ * Encrypted policy master key
+ */
+ struct ANASTASIS_CRYPTO_PolicyKeyP policy_key;
+ /**
+ * salt used to encrypt the master key
+ */
+ struct ANASTASIS_CRYPTO_SaltP salt;
+ /**
+ * set of truths inside this policy
+ */
+ uuid_t *uuids;
+ /**
+ * length of methods used
+ */
+ unsigned int uuid_length;
+};
+
+
/**
* State for a "secret share" CMD.
*/
@@ -92,6 +116,68 @@ secret_share_run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
struct SecretShareState *sss = cls;
+ struct Policy policies[sss->cmd_label_array_length];
+
+ GNUNET_assert (pcs->cmd_label_array_length > 0);
+ GNUNET_assert (NULL != pcs->cmd_label_array);
+
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "At %s:%d cmd label array length is %i\n", __FILE__, __LINE__,
+ sss->cmd_label_array_length);
+
+ sss->is = is;
+ if (NULL != sss->cmd_label_array)
+ {
+ for (unsigned int i = 0; i < sss->cmd_label_array_length; i++)
+ {
+ const struct TALER_TESTING_Command *ref;
+ struct Policy *policy;
+
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "At %s:%d policy create cmd is %s\n", __FILE__, __LINE__,
+ sss->cmd_label_array[i]);
+
+ ref = TALER_TESTING_interpreter_lookup_command
+ (is,
+ sss->cmd_label_array[i]);
+ if (NULL == ref)
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (sss->is);
+ return;
+ }
+ if (GNUNET_OK !=
+ ANASTASIS_TESTING_get_trait_policy (ref,
+ 0,
+ &policy))
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (sss->is);
+ return;
+ }
+ GNUNET_assert (NULL != policy);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "At %s:%d policy is %s-%llu b\n", __FILE__, __LINE__,
+ TALER_B2S (policy),
+ (unsigned long long) sizeof (*policy));
+ policies[i] = *policy;
+ GNUNET_assert (0 ==
+ GNUNET_memcmp (&policies[i],
+ policy));
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "At %s:%d policy is %s-%llu b\n", __FILE__, __LINE__,
+ TALER_B2S (&policies[i]),
+ (unsigned long long) sizeof (policies[i]));
+ }
+ }
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "At %s:%d policy array is %s\n", __FILE__, __LINE__,
+ TALER_b2s (&policies,
+ sss->cmd_label_array_length
+ * sizeof (struct Policy)));
+
+ // sss->sso = ANASTASIS_secret_share ();
+
sss->is = is;
// FIXME: Whole secret share procedure here
@@ -156,6 +242,7 @@ secret_share_traits (void *cls,
*
* @param label command label
* @param anastasis_url base URL of the anastasis serving our requests.
+ * @param id_data ID data to generate user identifier
* @param http_status expected HTTP status.
* @param sso secret share options
* @param ... NULL-terminated list of policy create commands
@@ -164,6 +251,7 @@ secret_share_traits (void *cls,
struct TALER_TESTING_Command
ANASTASIS_TESTING_cmd_secret_share (const char *label,
const char *anastasis_url,
+ json_t *id_data,
unsigned int http_status,
enum
ANASTASIS_TESTING_SecretShareOption sso,
--
To stop receiving notification emails like this one, please contact
address@hidden.