diff options
author | Andreas Ebner <a.e.bner@web.de> | 2019-09-20 10:49:02 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-10-07 12:18:20 +0200 |
commit | 3099a7c25cf6b11b0f1909e5a2651d65c0e921c7 (patch) | |
tree | c8f10fe3551b35e40d6adcb5e1c68771a12a104e /src/credential/gnunet-credential.c | |
parent | 5be14856a356b087ad97b479efd9b06172fdfd2f (diff) | |
download | gnunet-3099a7c25cf6b11b0f1909e5a2651d65c0e921c7.tar.gz gnunet-3099a7c25cf6b11b0f1909e5a2651d65c0e921c7.zip |
Cleanup TODOs, bugfix in cleanup and start of bidirectional chain resolution:
- removed and/or implemented all remaining TODOs
- fixed a bug in cleanup_handle() which caused to not cleanup correctly when a solution was prematurely found
- delegation_chain_bw/fw_resolution_start() not has a return value to indicate whether a solution was prematurely found
- cleaned up the test_... files (an additional cleanup commit might follow)
Diffstat (limited to 'src/credential/gnunet-credential.c')
-rw-r--r-- | src/credential/gnunet-credential.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/credential/gnunet-credential.c b/src/credential/gnunet-credential.c index 0d742d1ef..58f7cf50d 100644 --- a/src/credential/gnunet-credential.c +++ b/src/credential/gnunet-credential.c | |||
@@ -274,13 +274,12 @@ handle_intermediate_result(void *cls, | |||
274 | bool is_bw) | 274 | bool is_bw) |
275 | { | 275 | { |
276 | char *prefix = ""; | 276 | char *prefix = ""; |
277 | // TODO change to printf | ||
278 | if(is_bw) | 277 | if(is_bw) |
279 | prefix = "Backward -"; | 278 | prefix = "Backward -"; |
280 | else | 279 | else |
281 | prefix = "Forward -"; | 280 | prefix = "Forward -"; |
282 | 281 | ||
283 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%s Intermediate result: %s.%s <- %s.%s\n", | 282 | printf ("%s Intermediate result: %s.%s <- %s.%s\n", |
284 | prefix, | 283 | prefix, |
285 | GNUNET_CRYPTO_ecdsa_public_key_to_string (&dd->issuer_key), | 284 | GNUNET_CRYPTO_ecdsa_public_key_to_string (&dd->issuer_key), |
286 | dd->issuer_attribute, | 285 | dd->issuer_attribute, |
@@ -416,7 +415,7 @@ identity_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego) | |||
416 | 415 | ||
417 | collect_request = GNUNET_CREDENTIAL_collect (credential, | 416 | collect_request = GNUNET_CREDENTIAL_collect (credential, |
418 | &issuer_pkey, | 417 | &issuer_pkey, |
419 | issuer_attr, //TODO argument | 418 | issuer_attr, |
420 | privkey, | 419 | privkey, |
421 | direction, | 420 | direction, |
422 | &handle_collect_result, | 421 | &handle_collect_result, |
@@ -487,7 +486,6 @@ error_cb (void *cls) | |||
487 | static void | 486 | static void |
488 | add_continuation (void *cls, int32_t success, const char *emsg) | 487 | add_continuation (void *cls, int32_t success, const char *emsg) |
489 | { | 488 | { |
490 | // TODO what does that do, can I somehow parse an empty callback on success or do I have to set the qe* to NULL? | ||
491 | struct GNUNET_NAMESTORE_QueueEntry **qe = cls; | 489 | struct GNUNET_NAMESTORE_QueueEntry **qe = cls; |
492 | *qe = NULL; | 490 | *qe = NULL; |
493 | 491 | ||
@@ -510,9 +508,8 @@ get_existing_record (void *cls, | |||
510 | rde->data = data; | 508 | rde->data = data; |
511 | rde->data_size = data_size; | 509 | rde->data_size = data_size; |
512 | rde->record_type = type; | 510 | rde->record_type = type; |
513 | // Flags not required , TODO what have we said we do with that now? Look it up in my writing | 511 | |
514 | /*if (1 == is_shadow) | 512 | // Set flags |
515 | rde->flags |= GNUNET_GNSRECORD_RF_SHADOW_RECORD;*/ | ||
516 | if (GNUNET_YES == is_private) | 513 | if (GNUNET_YES == is_private) |
517 | rde->flags |= GNUNET_GNSRECORD_RF_PRIVATE; | 514 | rde->flags |= GNUNET_GNSRECORD_RF_PRIVATE; |
518 | rde->expiration_time = etime; | 515 | rde->expiration_time = etime; |
@@ -520,6 +517,7 @@ get_existing_record (void *cls, | |||
520 | rde->flags |= GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION; | 517 | rde->flags |= GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION; |
521 | else if (GNUNET_NO != etime_is_rel) | 518 | else if (GNUNET_NO != etime_is_rel) |
522 | rde->expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; | 519 | rde->expiration_time = GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us; |
520 | |||
523 | GNUNET_assert (NULL != rec_name); | 521 | GNUNET_assert (NULL != rec_name); |
524 | add_qe = GNUNET_NAMESTORE_records_store (ns, | 522 | add_qe = GNUNET_NAMESTORE_records_store (ns, |
525 | &zone_pkey, | 523 | &zone_pkey, |
@@ -551,7 +549,6 @@ store_cb (void *cls, const struct GNUNET_IDENTITY_Ego *ego) | |||
551 | // Key handling | 549 | // Key handling |
552 | zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (ego); | 550 | zone_pkey = *GNUNET_IDENTITY_ego_get_private_key (ego); |
553 | 551 | ||
554 | // TODO maybe dont have to set subject, if only used in if/else can use import here instead!! | ||
555 | if (GNUNET_GNSRECORD_TYPE_DELEGATE == type) | 552 | if (GNUNET_GNSRECORD_TYPE_DELEGATE == type) |
556 | { | 553 | { |
557 | // Parse import | 554 | // Parse import |
@@ -922,7 +919,7 @@ run (void *cls, | |||
922 | 919 | ||
923 | verify_request = GNUNET_CREDENTIAL_verify (credential, | 920 | verify_request = GNUNET_CREDENTIAL_verify (credential, |
924 | &issuer_pkey, | 921 | &issuer_pkey, |
925 | issuer_attr, //TODO argument | 922 | issuer_attr, |
926 | &subject_pkey, | 923 | &subject_pkey, |
927 | count, | 924 | count, |
928 | delegates, | 925 | delegates, |
@@ -1053,7 +1050,7 @@ main (int argc, char *const *argv) | |||
1053 | return 2; | 1050 | return 2; |
1054 | 1051 | ||
1055 | GNUNET_log_setup ("gnunet-credential", "WARNING", NULL); | 1052 | GNUNET_log_setup ("gnunet-credential", "WARNING", NULL); |
1056 | if (GNUNET_OK == GNUNET_PROGRAM_run (argc, | 1053 | if (GNUNET_OK != GNUNET_PROGRAM_run (argc, |
1057 | argv, | 1054 | argv, |
1058 | "gnunet-credential", | 1055 | "gnunet-credential", |
1059 | _ ("GNUnet credential resolver tool"), | 1056 | _ ("GNUnet credential resolver tool"), |