summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-08-17 22:52:47 +0200
committerSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-08-17 22:52:47 +0200
commitf348649e3c2238bbe49c0b52cb940b114e86574f (patch)
treed6223c41e693511d176ca4ed228ee3dea932ea71
parent9c616547f2e77f01a3a8d1b50a764625e0269104 (diff)
cleanup
-rw-r--r--src/zklaim/gnunet-zklaim.c12
-rw-r--r--src/zklaim/zklaim_functions.c14
2 files changed, 7 insertions, 19 deletions
diff --git a/src/zklaim/gnunet-zklaim.c b/src/zklaim/gnunet-zklaim.c
index 4146b983e..ef77b48e5 100644
--- a/src/zklaim/gnunet-zklaim.c
+++ b/src/zklaim/gnunet-zklaim.c
@@ -251,14 +251,9 @@ prove_iter (void *cls,
char *val;
char *op;
tmp = GNUNET_strdup (prove_predicate);
- fprintf (stderr,
- "%s\n",
- prove_predicate);
attr = strtok (tmp, " ");
while (NULL != attr)
{
- fprintf (stderr,
- "Got %s\n", attr);
op = strtok (NULL, " ");
if (NULL == op)
break;
@@ -275,7 +270,6 @@ prove_iter (void *cls,
fprintf (stderr,
"Failed parse %s %s %s\n",
attr, op, val);
- fprintf (stdout, "Setting %s %s %lu\n", name, op, *ref);
attr = strtok (NULL, " ");
}
GNUNET_free (tmp);
@@ -322,15 +316,13 @@ handle_arguments ()
ctx = GNUNET_ZKLAIM_context_deserialize (data,
len);
- fprintf (stderr,
- "%s\n",
- prove_predicate);
+ fprintf (stdout, "Proving %s...", prove_predicate);
ret = GNUNET_ZKLAIM_context_prove_with_keyfile (ctx,
pkey_fn,
&prove_iter,
NULL);
fprintf (stdout,
- "Prove result: %d\n", ret);
+ "%s\n", ret ? "failed." : "success.");
}
cleanup_task = GNUNET_SCHEDULER_add_now (&do_cleanup, NULL);
}
diff --git a/src/zklaim/zklaim_functions.c b/src/zklaim/zklaim_functions.c
index c24549ee4..0c6ea67cc 100644
--- a/src/zklaim/zklaim_functions.c
+++ b/src/zklaim/zklaim_functions.c
@@ -77,6 +77,11 @@ ZKLAIM_context_attributes_iterate (const struct GNUNET_ZKLAIM_Context *ctx,
zklaim_set_attr (&plw->pl,
data,
j);
+ if ((attr_name - tmp) == (strlen (attr_name) + 1))
+ {
+ attr_name = NULL;
+ break;
+ }
attr_name = strtok (attr_name + strlen (attr_name) + 1, ",");
}
if (NULL == attr_name)
@@ -115,10 +120,6 @@ ZKLAIM_context_prove (struct GNUNET_ZKLAIM_Context *ctx,
tmp = GNUNET_strdup (ctx->attrs);
attr_name = strtok (tmp, ",");
plw = ctx->ctx->pl_ctx_head;
- fprintf (stderr,
- "Num payloads: %lu, attrs: %s\n",
- ctx->ctx->num_of_payloads,
- ctx->attrs);
for (i = 0; i < ctx->ctx->num_of_payloads; i++)
{
for (j = 0; j < ZKLAIM_MAX_PAYLOAD_ATTRIBUTES; j++)
@@ -130,10 +131,6 @@ ZKLAIM_context_prove (struct GNUNET_ZKLAIM_Context *ctx,
plw = ctx->ctx->pl_ctx_head;
for (i = 0; i < ctx->ctx->num_of_payloads; i++)
{
- fprintf (stderr,
- "Payload #%d\n",
- i);
-
for (j = 0; j < ZKLAIM_MAX_PAYLOAD_ATTRIBUTES; j++)
{
@@ -156,7 +153,6 @@ ZKLAIM_context_prove (struct GNUNET_ZKLAIM_Context *ctx,
GNUNET_assert (NULL != plw);
}
GNUNET_free (tmp);
- zklaim_print (ctx->ctx);
return zklaim_proof_generate (ctx->ctx);
}