diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-02-03 21:51:57 +0100 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2020-02-09 20:38:10 +0100 |
commit | 5b6bb2ce4d60635b2af950d72b45f12686fd5218 (patch) | |
tree | ef3b5786591f6a8473a4a2174dd95a439f22af68 /src/reclaim/json_reclaim.c | |
parent | 99d70615e37294d4f964992c6be0495e95777a27 (diff) | |
download | gnunet-5b6bb2ce4d60635b2af950d72b45f12686fd5218.tar.gz gnunet-5b6bb2ce4d60635b2af950d72b45f12686fd5218.zip |
move to 256-bit identifier; some cleanups
Diffstat (limited to 'src/reclaim/json_reclaim.c')
-rw-r--r-- | src/reclaim/json_reclaim.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/reclaim/json_reclaim.c b/src/reclaim/json_reclaim.c index a464a9088..6ac60a704 100644 --- a/src/reclaim/json_reclaim.c +++ b/src/reclaim/json_reclaim.c | |||
@@ -94,12 +94,12 @@ parse_attr (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) | |||
94 | } | 94 | } |
95 | attr = GNUNET_RECLAIM_ATTRIBUTE_claim_new (name_str, type, data, data_size); | 95 | attr = GNUNET_RECLAIM_ATTRIBUTE_claim_new (name_str, type, data, data_size); |
96 | if ((NULL == id_str) || (0 == strlen (id_str))) | 96 | if ((NULL == id_str) || (0 == strlen (id_str))) |
97 | attr->id = 0; | 97 | memset (&attr->id, 0, sizeof (attr->id)); |
98 | else | 98 | else |
99 | GNUNET_STRINGS_string_to_data (id_str, | 99 | GNUNET_STRINGS_string_to_data (id_str, |
100 | strlen (id_str), | 100 | strlen (id_str), |
101 | &attr->id, | 101 | &attr->id, |
102 | sizeof(uint64_t)); | 102 | sizeof(attr->id)); |
103 | 103 | ||
104 | *(struct GNUNET_RECLAIM_ATTRIBUTE_Claim **) spec->ptr = attr; | 104 | *(struct GNUNET_RECLAIM_ATTRIBUTE_Claim **) spec->ptr = attr; |
105 | return GNUNET_OK; | 105 | return GNUNET_OK; |
@@ -192,7 +192,7 @@ parse_ticket (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) | |||
192 | if (GNUNET_OK != GNUNET_STRINGS_string_to_data (rnd_str, | 192 | if (GNUNET_OK != GNUNET_STRINGS_string_to_data (rnd_str, |
193 | strlen (rnd_str), | 193 | strlen (rnd_str), |
194 | &ticket->rnd, | 194 | &ticket->rnd, |
195 | sizeof(uint64_t))) | 195 | sizeof(ticket->rnd))) |
196 | { | 196 | { |
197 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Rnd invalid\n"); | 197 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Rnd invalid\n"); |
198 | GNUNET_free (ticket); | 198 | GNUNET_free (ticket); |
@@ -327,12 +327,12 @@ parse_attest (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec) | |||
327 | } | 327 | } |
328 | attr = GNUNET_RECLAIM_ATTESTATION_claim_new (name_str, type, data, data_size); | 328 | attr = GNUNET_RECLAIM_ATTESTATION_claim_new (name_str, type, data, data_size); |
329 | if ((NULL == id_str) || (0 == strlen (id_str))) | 329 | if ((NULL == id_str) || (0 == strlen (id_str))) |
330 | attr->id = 0; | 330 | memset (&attr->id, 0, sizeof (attr->id)); |
331 | else | 331 | else |
332 | GNUNET_STRINGS_string_to_data (id_str, | 332 | GNUNET_STRINGS_string_to_data (id_str, |
333 | strlen (id_str), | 333 | strlen (id_str), |
334 | &attr->id, | 334 | &attr->id, |
335 | sizeof(uint64_t)); | 335 | sizeof(attr->id)); |
336 | 336 | ||
337 | *(struct GNUNET_RECLAIM_ATTESTATION_Claim **) spec->ptr = attr; | 337 | *(struct GNUNET_RECLAIM_ATTESTATION_Claim **) spec->ptr = attr; |
338 | return GNUNET_OK; | 338 | return GNUNET_OK; |
@@ -425,16 +425,15 @@ parse_attest_ref (void *cls, json_t *root, struct | |||
425 | } | 425 | } |
426 | 426 | ||
427 | attr = GNUNET_RECLAIM_ATTESTATION_reference_new (name_str, ref_val_str); | 427 | attr = GNUNET_RECLAIM_ATTESTATION_reference_new (name_str, ref_val_str); |
428 | 428 | memset (&attr->id, 0, sizeof (attr->id)); | |
429 | attr->id = 0; | ||
430 | 429 | ||
431 | if ((NULL == ref_id_str) || (0 == strlen (ref_id_str))) | 430 | if ((NULL == ref_id_str) || (0 == strlen (ref_id_str))) |
432 | attr->id_attest = 0; | 431 | memset (&attr->id_attest, 0, sizeof (attr->id_attest)); |
433 | else | 432 | else |
434 | GNUNET_STRINGS_string_to_data (ref_id_str, | 433 | GNUNET_STRINGS_string_to_data (ref_id_str, |
435 | strlen (ref_id_str), | 434 | strlen (ref_id_str), |
436 | &attr->id_attest, | 435 | &attr->id_attest, |
437 | sizeof(uint64_t)); | 436 | sizeof(attr->id_attest)); |
438 | 437 | ||
439 | *(struct GNUNET_RECLAIM_ATTESTATION_REFERENCE **) spec->ptr = attr; | 438 | *(struct GNUNET_RECLAIM_ATTESTATION_REFERENCE **) spec->ptr = attr; |
440 | return GNUNET_OK; | 439 | return GNUNET_OK; |
@@ -480,4 +479,4 @@ GNUNET_RECLAIM_JSON_spec_claim_attest_ref (struct | |||
480 | 479 | ||
481 | *attr = NULL; | 480 | *attr = NULL; |
482 | return ret; | 481 | return ret; |
483 | } \ No newline at end of file | 482 | } |