aboutsummaryrefslogtreecommitdiff
path: root/src/zklaim/zklaim_functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/zklaim/zklaim_functions.c')
-rw-r--r--src/zklaim/zklaim_functions.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/zklaim/zklaim_functions.c b/src/zklaim/zklaim_functions.c
index 3c968cfea..7f83ecb22 100644
--- a/src/zklaim/zklaim_functions.c
+++ b/src/zklaim/zklaim_functions.c
@@ -67,18 +67,20 @@ ZKLAIM_context_attributes_iterate (const struct GNUNET_ZKLAIM_Context *ctx,
67 tmp = GNUNET_strdup (ctx->attrs); 67 tmp = GNUNET_strdup (ctx->attrs);
68 attr_name = strtok (tmp, ","); 68 attr_name = strtok (tmp, ",");
69 plw = ctx->ctx->pl_ctx_head; 69 plw = ctx->ctx->pl_ctx_head;
70
71 for (i = 0; i < ctx->ctx->num_of_payloads; i++) 70 for (i = 0; i < ctx->ctx->num_of_payloads; i++)
72 { 71 {
73 for (j = 0; j < ZKLAIM_MAX_PAYLOAD_ATTRIBUTES; j++) 72 for (j = 0; j < ZKLAIM_MAX_PAYLOAD_ATTRIBUTES; j++)
74 { 73 {
75 GNUNET_assert (NULL != attr_name); 74 if (NULL == attr_name)
75 break;
76 iter (iter_cls, attr_name, &data); 76 iter (iter_cls, attr_name, &data);
77 zklaim_set_attr (&plw->pl, 77 zklaim_set_attr (&plw->pl,
78 data, 78 data,
79 j); 79 j);
80 attr_name = strtok (NULL, ","); 80 attr_name = strtok (attr_name + strlen (attr_name) + 1, ",");
81 } 81 }
82 if (NULL == attr_name)
83 break;
82 plw = plw->next; 84 plw = plw->next;
83 GNUNET_assert (NULL != plw); 85 GNUNET_assert (NULL != plw);
84 } 86 }
@@ -86,7 +88,7 @@ ZKLAIM_context_attributes_iterate (const struct GNUNET_ZKLAIM_Context *ctx,
86 88
87} 89}
88 90
89void 91int
90ZKLAIM_context_issue (struct GNUNET_ZKLAIM_Context *ctx, 92ZKLAIM_context_issue (struct GNUNET_ZKLAIM_Context *ctx,
91 const struct GNUNET_CRYPTO_EcdsaPrivateKey *key, 93 const struct GNUNET_CRYPTO_EcdsaPrivateKey *key,
92 GNUNET_ZKLAIM_PayloadIterator iter, 94 GNUNET_ZKLAIM_PayloadIterator iter,
@@ -95,8 +97,8 @@ ZKLAIM_context_issue (struct GNUNET_ZKLAIM_Context *ctx,
95 ZKLAIM_context_attributes_iterate (ctx, 97 ZKLAIM_context_attributes_iterate (ctx,
96 iter, 98 iter,
97 iter_cls); 99 iter_cls);
98 ZKLAIM_context_sign (ctx, 100 return ZKLAIM_context_sign (ctx,
99 key); 101 key);
100} 102}
101 103
102void 104void