diff options
author | Andreas Ebner <pansy007@googlemail.com> | 2019-08-25 12:23:33 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-10-07 12:17:29 +0200 |
commit | d4790594a33a4688641f66841f05533b3c0956b9 (patch) | |
tree | ee136e65e4154a7d4bb6eb947f19b631329cdce2 /src/credential/gnunet-service-credential.c | |
parent | 418b7f2cef91e344672edf3926b82a5a3043e9ba (diff) | |
download | gnunet-d4790594a33a4688641f66841f05533b3c0956b9.tar.gz gnunet-d4790594a33a4688641f66841f05533b3c0956b9.zip |
Introduction of intermediate result reporting, removed some stuff, new test:
- new message, message type and api function to handle intermediate result reporting
- removed GNUNET_SIGNATURE_PURPOSE_CREDENTIAL completely and the one usage that was still around
- new test: AND with both parts having a bidirectional forward match
Diffstat (limited to 'src/credential/gnunet-service-credential.c')
-rw-r--r-- | src/credential/gnunet-service-credential.c | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/src/credential/gnunet-service-credential.c b/src/credential/gnunet-service-credential.c index 90316f203..cb0dca6b8 100644 --- a/src/credential/gnunet-service-credential.c +++ b/src/credential/gnunet-service-credential.c | |||
@@ -246,7 +246,6 @@ struct DelegationSetQueueEntry | |||
246 | */ | 246 | */ |
247 | struct VerifyRequestHandle | 247 | struct VerifyRequestHandle |
248 | { | 248 | { |
249 | |||
250 | /** | 249 | /** |
251 | * We keep these in a DLL. | 250 | * We keep these in a DLL. |
252 | */ | 251 | */ |
@@ -480,6 +479,48 @@ shutdown_task (void *cls) | |||
480 | } | 479 | } |
481 | } | 480 | } |
482 | 481 | ||
482 | static void | ||
483 | send_intermediate_response(struct VerifyRequestHandle *vrh, struct DelegationChainEntry *ch_entry){ | ||
484 | struct DelegationChainIntermediateMessage *rmsg; | ||
485 | struct GNUNET_MQ_Envelope *env; | ||
486 | struct GNUNET_CREDENTIAL_Delegation *dd; | ||
487 | size_t size; | ||
488 | |||
489 | dd = GNUNET_new (struct GNUNET_CREDENTIAL_Delegation); | ||
490 | dd->issuer_key = ch_entry->issuer_key; | ||
491 | dd->subject_key = ch_entry->subject_key; | ||
492 | dd->issuer_attribute = ch_entry->issuer_attribute; | ||
493 | dd->issuer_attribute_len = strlen (ch_entry->issuer_attribute) + 1; | ||
494 | dd->subject_attribute_len = 0; | ||
495 | dd->subject_attribute = NULL; | ||
496 | if (NULL != ch_entry->subject_attribute) | ||
497 | { | ||
498 | dd->subject_attribute = ch_entry->subject_attribute; | ||
499 | dd->subject_attribute_len = strlen (ch_entry->subject_attribute) + 1; | ||
500 | } | ||
501 | |||
502 | |||
503 | size = GNUNET_CREDENTIAL_delegation_chain_get_size (1, | ||
504 | dd, | ||
505 | 0, | ||
506 | NULL); | ||
507 | |||
508 | env = GNUNET_MQ_msg_extra (rmsg, | ||
509 | size, | ||
510 | GNUNET_MESSAGE_TYPE_CREDENTIAL_INTERMEDIATE_RESULT); | ||
511 | // Assign id so that client can find associated request | ||
512 | rmsg->id = vrh->request_id; | ||
513 | rmsg->size = htonl(size); | ||
514 | |||
515 | GNUNET_assert ( | ||
516 | -1 != GNUNET_CREDENTIAL_delegation_chain_serialize (1, | ||
517 | dd, | ||
518 | 0, | ||
519 | NULL, | ||
520 | size, | ||
521 | (char *) &rmsg[1])); | ||
522 | GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq (vrh->client), env); | ||
523 | } | ||
483 | 524 | ||
484 | static void | 525 | static void |
485 | send_lookup_response (struct VerifyRequestHandle *vrh) | 526 | send_lookup_response (struct VerifyRequestHandle *vrh) |
@@ -821,6 +862,9 @@ forward_resolution (void *cls, | |||
821 | ds_entry->delegation_chain_entry->issuer_key = del->issuer_key; | 862 | ds_entry->delegation_chain_entry->issuer_key = del->issuer_key; |
822 | ds_entry->delegation_chain_entry->issuer_attribute = | 863 | ds_entry->delegation_chain_entry->issuer_attribute = |
823 | GNUNET_strdup (del->issuer_attribute); | 864 | GNUNET_strdup (del->issuer_attribute); |
865 | |||
866 | // Found new entry, repoting intermediate result | ||
867 | send_intermediate_response(vrh, ds_entry->delegation_chain_entry); | ||
824 | 868 | ||
825 | // current delegation as parent | 869 | // current delegation as parent |
826 | ds_entry->parent_queue_entry = dq_entry; | 870 | ds_entry->parent_queue_entry = dq_entry; |
@@ -1035,6 +1079,9 @@ backward_resolution (void *cls, | |||
1035 | ds_entry->delegation_chain_entry->issuer_attribute = | 1079 | ds_entry->delegation_chain_entry->issuer_attribute = |
1036 | GNUNET_strdup (current_set->lookup_attribute); | 1080 | GNUNET_strdup (current_set->lookup_attribute); |
1037 | 1081 | ||
1082 | // Found new entry, repoting intermediate result | ||
1083 | send_intermediate_response(vrh, ds_entry->delegation_chain_entry); | ||
1084 | |||
1038 | ds_entry->parent_queue_entry = dq_entry; // current_delegation; | 1085 | ds_entry->parent_queue_entry = dq_entry; // current_delegation; |
1039 | 1086 | ||
1040 | /** | 1087 | /** |