diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2016-12-14 08:18:14 +0100 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2016-12-14 08:18:14 +0100 |
commit | 8052eb6445f29eec791e7c473a15334a66c91141 (patch) | |
tree | 43807435f1689898de04cb44f0ccbc052b807afd /src/credential/gnunet-service-credential.c | |
parent | 80bdda1c79efb648cb56bdfb63da0c2c0db3ff45 (diff) | |
download | gnunet-8052eb6445f29eec791e7c473a15334a66c91141.tar.gz gnunet-8052eb6445f29eec791e7c473a15334a66c91141.zip |
-fix gns mq; fix serializer
Diffstat (limited to 'src/credential/gnunet-service-credential.c')
-rw-r--r-- | src/credential/gnunet-service-credential.c | 41 |
1 files changed, 3 insertions, 38 deletions
diff --git a/src/credential/gnunet-service-credential.c b/src/credential/gnunet-service-credential.c index 74e1e1cd2..01b955726 100644 --- a/src/credential/gnunet-service-credential.c +++ b/src/credential/gnunet-service-credential.c | |||
@@ -457,12 +457,12 @@ send_lookup_response (struct VerifyRequestHandle *vrh) | |||
457 | dd[i].issuer_key = dq_entry->delegation_chain_entry->issuer_key; | 457 | dd[i].issuer_key = dq_entry->delegation_chain_entry->issuer_key; |
458 | dd[i].subject_key = dq_entry->delegation_chain_entry->subject_key; | 458 | dd[i].subject_key = dq_entry->delegation_chain_entry->subject_key; |
459 | dd[i].issuer_attribute = dq_entry->delegation_chain_entry->issuer_attribute; | 459 | dd[i].issuer_attribute = dq_entry->delegation_chain_entry->issuer_attribute; |
460 | dd[i].issuer_attribute_len = strlen (dq_entry->delegation_chain_entry->issuer_attribute); | 460 | dd[i].issuer_attribute_len = strlen (dq_entry->delegation_chain_entry->issuer_attribute)+1; |
461 | dd[i].subject_attribute_len = 0; | 461 | dd[i].subject_attribute_len = 0; |
462 | if (NULL != dq_entry->delegation_chain_entry->subject_attribute) | 462 | if (NULL != dq_entry->delegation_chain_entry->subject_attribute) |
463 | { | 463 | { |
464 | dd[i].subject_attribute = dq_entry->delegation_chain_entry->subject_attribute; | 464 | dd[i].subject_attribute = dq_entry->delegation_chain_entry->subject_attribute; |
465 | dd[i].subject_attribute_len = strlen(dq_entry->delegation_chain_entry->subject_attribute); | 465 | dd[i].subject_attribute_len = strlen(dq_entry->delegation_chain_entry->subject_attribute)+1; |
466 | } | 466 | } |
467 | dq_entry = dq_entry->parent; | 467 | dq_entry = dq_entry->parent; |
468 | } | 468 | } |
@@ -471,7 +471,7 @@ send_lookup_response (struct VerifyRequestHandle *vrh) | |||
471 | * Get serialized record data | 471 | * Get serialized record data |
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->issuer_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]; |
@@ -496,41 +496,6 @@ send_lookup_response (struct VerifyRequestHandle *vrh) | |||
496 | size, | 496 | size, |
497 | (char*)&rmsg[1])); | 497 | (char*)&rmsg[1])); |
498 | 498 | ||
499 | |||
500 | /*for (dq_entry = vrh->chain_end; NULL != dq_entry; dq_entry = dq_entry->parent) | ||
501 | { | ||
502 | if (NULL == dq_entry->delegation_chain_entry) | ||
503 | break; | ||
504 | size += sizeof (struct GNUNET_CREDENTIAL_DelegationChainEntry); | ||
505 | if (NULL != dq_entry->delegation_chain_entry->subject_attribute) | ||
506 | size += strlen (dq_entry->delegation_chain_entry->subject_attribute) + 1; | ||
507 | size += strlen(dq_entry->delegation_chain_entry->issuer_attribute) + 1; | ||
508 | d_count++; | ||
509 | }*/ | ||
510 | |||
511 | //TODO refactor into serializer module | ||
512 | /*write_ptr = (char*)&rmsg[1] + vrh->credential_size; | ||
513 | for (dq_entry = vrh->chain_end; NULL != dq_entry; dq_entry = dq_entry->parent) | ||
514 | { | ||
515 | if (NULL == dq_entry->delegation_chain_entry) | ||
516 | break; | ||
517 | memcpy (write_ptr, | ||
518 | dq_entry->delegation_chain_entry, | ||
519 | sizeof (struct GNUNET_CREDENTIAL_DelegationChainEntry)); | ||
520 | write_ptr += sizeof (struct GNUNET_CREDENTIAL_DelegationChainEntry); | ||
521 | if (NULL != dq_entry->delegation_chain_entry->subject_attribute) | ||
522 | { | ||
523 | GNUNET_snprintf (write_ptr, | ||
524 | strlen (dq_entry->delegation_chain_entry->subject_attribute) + 2, | ||
525 | "%s;", | ||
526 | dq_entry->delegation_chain_entry->subject_attribute); | ||
527 | write_ptr += strlen (dq_entry->delegation_chain_entry->subject_attribute) + 1; | ||
528 | } | ||
529 | memcpy (write_ptr, | ||
530 | dq_entry->delegation_chain_entry->issuer_attribute, | ||
531 | strlen(dq_entry->delegation_chain_entry->issuer_attribute)); | ||
532 | write_ptr += strlen(dq_entry->delegation_chain_entry->issuer_attribute) + 1; | ||
533 | }*/ | ||
534 | GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq(vrh->client), | 499 | GNUNET_MQ_send (GNUNET_SERVICE_client_get_mq(vrh->client), |
535 | env); | 500 | env); |
536 | GNUNET_CONTAINER_DLL_remove (vrh_head, vrh_tail, vrh); | 501 | GNUNET_CONTAINER_DLL_remove (vrh_head, vrh_tail, vrh); |