diff options
Diffstat (limited to 'src/credential/gnunet-service-credential.c')
-rw-r--r-- | src/credential/gnunet-service-credential.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/credential/gnunet-service-credential.c b/src/credential/gnunet-service-credential.c index 01b955726..8f7d71b28 100644 --- a/src/credential/gnunet-service-credential.c +++ b/src/credential/gnunet-service-credential.c | |||
@@ -472,7 +472,7 @@ send_lookup_response (struct VerifyRequestHandle *vrh) | |||
472 | * Append at the end of rmsg | 472 | * Append at the end of rmsg |
473 | */ | 473 | */ |
474 | cred.issuer_key = vrh->credential->issuer_key; | 474 | cred.issuer_key = vrh->credential->issuer_key; |
475 | cred.subject_key = vrh->credential->issuer_key; | 475 | cred.subject_key = vrh->credential->subject_key; |
476 | cred.issuer_attribute_len = strlen((char*)&vrh->credential[1]); | 476 | cred.issuer_attribute_len = strlen((char*)&vrh->credential[1]); |
477 | cred.issuer_attribute = (char*)&vrh->credential[1]; | 477 | cred.issuer_attribute = (char*)&vrh->credential[1]; |
478 | size = GNUNET_CREDENTIAL_delegation_chain_get_size (vrh->d_count, | 478 | size = GNUNET_CREDENTIAL_delegation_chain_get_size (vrh->d_count, |
@@ -520,6 +520,7 @@ backward_resolution (void* cls, | |||
520 | struct DelegationQueueEntry *current_delegation; | 520 | struct DelegationQueueEntry *current_delegation; |
521 | struct DelegationQueueEntry *dq_entry; | 521 | struct DelegationQueueEntry *dq_entry; |
522 | char *expanded_attr; | 522 | char *expanded_attr; |
523 | char *lookup_attribute; | ||
523 | int i; | 524 | int i; |
524 | 525 | ||
525 | 526 | ||
@@ -605,6 +606,9 @@ backward_resolution (void* cls, | |||
605 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 606 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
606 | "Found issuer\n"); | 607 | "Found issuer\n"); |
607 | vrh->credential = GNUNET_malloc (cred_pointer->data_size); | 608 | vrh->credential = GNUNET_malloc (cred_pointer->data_size); |
609 | memcpy (vrh->credential, | ||
610 | cred, | ||
611 | cred_pointer->data_size); | ||
608 | vrh->credential_size = cred_pointer->data_size; | 612 | vrh->credential_size = cred_pointer->data_size; |
609 | vrh->chain_end = dq_entry; | 613 | vrh->chain_end = dq_entry; |
610 | vrh->d_count = dq_entry->d_count; | 614 | vrh->d_count = dq_entry->d_count; |
@@ -620,9 +624,12 @@ backward_resolution (void* cls, | |||
620 | strcpy (issuer_attribute_name, | 624 | strcpy (issuer_attribute_name, |
621 | dq_entry->unresolved_attribute_delegation); | 625 | dq_entry->unresolved_attribute_delegation); |
622 | char *next_attr = strtok (issuer_attribute_name, "."); | 626 | char *next_attr = strtok (issuer_attribute_name, "."); |
623 | GNUNET_asprintf (&dq_entry->lookup_attribute, | 627 | GNUNET_asprintf (&lookup_attribute, |
624 | "%s.gnu", | 628 | "%s.gnu", |
625 | next_attr); | 629 | next_attr); |
630 | GNUNET_asprintf (&dq_entry->lookup_attribute, | ||
631 | "%s", | ||
632 | next_attr); | ||
626 | if (strlen (next_attr) == strlen (dq_entry->unresolved_attribute_delegation)) | 633 | if (strlen (next_attr) == strlen (dq_entry->unresolved_attribute_delegation)) |
627 | { | 634 | { |
628 | dq_entry->attr_trailer = NULL; | 635 | dq_entry->attr_trailer = NULL; |
@@ -640,13 +647,14 @@ backward_resolution (void* cls, | |||
640 | vrh->pending_lookups++; | 647 | vrh->pending_lookups++; |
641 | dq_entry->handle = vrh; | 648 | dq_entry->handle = vrh; |
642 | dq_entry->lookup_request = GNUNET_GNS_lookup (gns, | 649 | dq_entry->lookup_request = GNUNET_GNS_lookup (gns, |
643 | dq_entry->lookup_attribute, | 650 | lookup_attribute, |
644 | dq_entry->issuer_key, //issuer_key, | 651 | dq_entry->issuer_key, //issuer_key, |
645 | GNUNET_GNSRECORD_TYPE_ATTRIBUTE, | 652 | GNUNET_GNSRECORD_TYPE_ATTRIBUTE, |
646 | GNUNET_GNS_LO_DEFAULT, | 653 | GNUNET_GNS_LO_DEFAULT, |
647 | NULL, //shorten_key, always NULL | 654 | NULL, //shorten_key, always NULL |
648 | &backward_resolution, | 655 | &backward_resolution, |
649 | dq_entry); | 656 | dq_entry); |
657 | GNUNET_free (lookup_attribute); | ||
650 | } | 658 | } |
651 | 659 | ||
652 | if(0 == vrh->pending_lookups) | 660 | if(0 == vrh->pending_lookups) |