diff options
Diffstat (limited to 'src/reclaim/plugin_rest_reclaim.c')
-rw-r--r-- | src/reclaim/plugin_rest_reclaim.c | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/src/reclaim/plugin_rest_reclaim.c b/src/reclaim/plugin_rest_reclaim.c index 870baa7f3..a51d992e1 100644 --- a/src/reclaim/plugin_rest_reclaim.c +++ b/src/reclaim/plugin_rest_reclaim.c | |||
@@ -48,9 +48,9 @@ | |||
48 | #define GNUNET_REST_API_NS_RECLAIM_ATTRIBUTES "/reclaim/attributes" | 48 | #define GNUNET_REST_API_NS_RECLAIM_ATTRIBUTES "/reclaim/attributes" |
49 | 49 | ||
50 | /** | 50 | /** |
51 | * Attestation namespace | 51 | * Credential namespace |
52 | */ | 52 | */ |
53 | #define GNUNET_REST_API_NS_RECLAIM_ATTESTATION "/reclaim/attestation" | 53 | #define GNUNET_REST_API_NS_RECLAIM_CREDENTIAL "/reclaim/credential" |
54 | 54 | ||
55 | /** | 55 | /** |
56 | * Ticket namespace | 56 | * Ticket namespace |
@@ -202,7 +202,7 @@ struct RequestHandle | |||
202 | /** | 202 | /** |
203 | * Attribute iterator | 203 | * Attribute iterator |
204 | */ | 204 | */ |
205 | struct GNUNET_RECLAIM_AttestationIterator *attest_it; | 205 | struct GNUNET_RECLAIM_CredentialIterator *cred_it; |
206 | 206 | ||
207 | /** | 207 | /** |
208 | * Ticket iterator | 208 | * Ticket iterator |
@@ -282,8 +282,8 @@ cleanup_handle (void *cls) | |||
282 | GNUNET_SCHEDULER_cancel (handle->timeout_task); | 282 | GNUNET_SCHEDULER_cancel (handle->timeout_task); |
283 | if (NULL != handle->attr_it) | 283 | if (NULL != handle->attr_it) |
284 | GNUNET_RECLAIM_get_attributes_stop (handle->attr_it); | 284 | GNUNET_RECLAIM_get_attributes_stop (handle->attr_it); |
285 | if (NULL != handle->attest_it) | 285 | if (NULL != handle->cred_it) |
286 | GNUNET_RECLAIM_get_attestations_stop (handle->attest_it); | 286 | GNUNET_RECLAIM_get_credentials_stop (handle->cred_it); |
287 | if (NULL != handle->ticket_it) | 287 | if (NULL != handle->ticket_it) |
288 | GNUNET_RECLAIM_ticket_iteration_stop (handle->ticket_it); | 288 | GNUNET_RECLAIM_ticket_iteration_stop (handle->ticket_it); |
289 | if (NULL != handle->url) | 289 | if (NULL != handle->url) |
@@ -413,7 +413,7 @@ collect_finished_cb (void *cls) | |||
413 | 413 | ||
414 | // Done | 414 | // Done |
415 | handle->attr_it = NULL; | 415 | handle->attr_it = NULL; |
416 | handle->attest_it = NULL; | 416 | handle->cred_it = NULL; |
417 | handle->ticket_it = NULL; | 417 | handle->ticket_it = NULL; |
418 | GNUNET_SCHEDULER_add_now (&return_response, handle); | 418 | GNUNET_SCHEDULER_add_now (&return_response, handle); |
419 | } | 419 | } |
@@ -460,7 +460,7 @@ ticket_collect (void *cls, const struct GNUNET_RECLAIM_Ticket *ticket) | |||
460 | 460 | ||
461 | 461 | ||
462 | static void | 462 | static void |
463 | add_attestation_cont (struct GNUNET_REST_RequestHandle *con_handle, | 463 | add_credential_cont (struct GNUNET_REST_RequestHandle *con_handle, |
464 | const char *url, | 464 | const char *url, |
465 | void *cls) | 465 | void *cls) |
466 | { | 466 | { |
@@ -468,19 +468,19 @@ add_attestation_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
468 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity_priv; | 468 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity_priv; |
469 | const char *identity; | 469 | const char *identity; |
470 | struct EgoEntry *ego_entry; | 470 | struct EgoEntry *ego_entry; |
471 | struct GNUNET_RECLAIM_Attestation *attribute; | 471 | struct GNUNET_RECLAIM_Credential *attribute; |
472 | struct GNUNET_TIME_Relative exp; | 472 | struct GNUNET_TIME_Relative exp; |
473 | char term_data[handle->rest_handle->data_size + 1]; | 473 | char term_data[handle->rest_handle->data_size + 1]; |
474 | json_t *data_json; | 474 | json_t *data_json; |
475 | json_error_t err; | 475 | json_error_t err; |
476 | struct GNUNET_JSON_Specification attrspec[] = | 476 | struct GNUNET_JSON_Specification attrspec[] = |
477 | { GNUNET_RECLAIM_JSON_spec_claim_attest (&attribute), | 477 | { GNUNET_RECLAIM_JSON_spec_claim_cred (&attribute), |
478 | GNUNET_JSON_spec_end () }; | 478 | GNUNET_JSON_spec_end () }; |
479 | 479 | ||
480 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 480 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
481 | "Adding an attestation for %s.\n", | 481 | "Adding an credential for %s.\n", |
482 | handle->url); | 482 | handle->url); |
483 | if (strlen (GNUNET_REST_API_NS_RECLAIM_ATTESTATION) >= strlen ( | 483 | if (strlen (GNUNET_REST_API_NS_RECLAIM_CREDENTIAL) >= strlen ( |
484 | handle->url)) | 484 | handle->url)) |
485 | { | 485 | { |
486 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No identity given.\n"); | 486 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No identity given.\n"); |
@@ -488,7 +488,7 @@ add_attestation_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
488 | return; | 488 | return; |
489 | } | 489 | } |
490 | identity = handle->url + strlen ( | 490 | identity = handle->url + strlen ( |
491 | GNUNET_REST_API_NS_RECLAIM_ATTESTATION) + 1; | 491 | GNUNET_REST_API_NS_RECLAIM_CREDENTIAL) + 1; |
492 | 492 | ||
493 | for (ego_entry = ego_head; NULL != ego_entry; | 493 | for (ego_entry = ego_head; NULL != ego_entry; |
494 | ego_entry = ego_entry->next) | 494 | ego_entry = ego_entry->next) |
@@ -518,7 +518,7 @@ add_attestation_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
518 | if (NULL == attribute) | 518 | if (NULL == attribute) |
519 | { | 519 | { |
520 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 520 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
521 | "Unable to parse attestation from %s\n", | 521 | "Unable to parse credential from %s\n", |
522 | term_data); | 522 | term_data); |
523 | GNUNET_SCHEDULER_add_now (&do_error, handle); | 523 | GNUNET_SCHEDULER_add_now (&do_error, handle); |
524 | return; | 524 | return; |
@@ -529,7 +529,7 @@ add_attestation_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
529 | if (GNUNET_YES == GNUNET_RECLAIM_id_is_zero (&attribute->id)) | 529 | if (GNUNET_YES == GNUNET_RECLAIM_id_is_zero (&attribute->id)) |
530 | GNUNET_RECLAIM_id_generate (&attribute->id); | 530 | GNUNET_RECLAIM_id_generate (&attribute->id); |
531 | exp = GNUNET_TIME_UNIT_HOURS; | 531 | exp = GNUNET_TIME_UNIT_HOURS; |
532 | handle->idp_op = GNUNET_RECLAIM_attestation_store (idp, | 532 | handle->idp_op = GNUNET_RECLAIM_credential_store (idp, |
533 | identity_priv, | 533 | identity_priv, |
534 | attribute, | 534 | attribute, |
535 | &exp, | 535 | &exp, |
@@ -540,52 +540,52 @@ add_attestation_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
540 | 540 | ||
541 | 541 | ||
542 | /** | 542 | /** |
543 | * Collect all attestations for an ego | 543 | * Collect all credentials for an ego |
544 | * | 544 | * |
545 | */ | 545 | */ |
546 | static void | 546 | static void |
547 | attest_collect (void *cls, | 547 | cred_collect (void *cls, |
548 | const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, | 548 | const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, |
549 | const struct GNUNET_RECLAIM_Attestation *attest) | 549 | const struct GNUNET_RECLAIM_Credential *cred) |
550 | { | 550 | { |
551 | struct RequestHandle *handle = cls; | 551 | struct RequestHandle *handle = cls; |
552 | struct GNUNET_RECLAIM_AttributeList *attrs; | 552 | struct GNUNET_RECLAIM_AttributeList *attrs; |
553 | struct GNUNET_RECLAIM_AttributeListEntry *ale; | 553 | struct GNUNET_RECLAIM_AttributeListEntry *ale; |
554 | struct GNUNET_TIME_Absolute exp; | 554 | struct GNUNET_TIME_Absolute exp; |
555 | json_t *attr_obj; | 555 | json_t *attr_obj; |
556 | json_t *attest_obj; | 556 | json_t *cred_obj; |
557 | const char *type; | 557 | const char *type; |
558 | char *tmp_value; | 558 | char *tmp_value; |
559 | char *id_str; | 559 | char *id_str; |
560 | char *issuer; | 560 | char *issuer; |
561 | 561 | ||
562 | 562 | ||
563 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding attestation: %s\n", | 563 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding credential: %s\n", |
564 | attest->name); | 564 | cred->name); |
565 | attrs = GNUNET_RECLAIM_attestation_get_attributes (attest); | 565 | attrs = GNUNET_RECLAIM_credential_get_attributes (cred); |
566 | issuer = GNUNET_RECLAIM_attestation_get_issuer (attest); | 566 | issuer = GNUNET_RECLAIM_credential_get_issuer (cred); |
567 | tmp_value = GNUNET_RECLAIM_attestation_value_to_string (attest->type, | 567 | tmp_value = GNUNET_RECLAIM_credential_value_to_string (cred->type, |
568 | attest->data, | 568 | cred->data, |
569 | attest->data_size); | 569 | cred->data_size); |
570 | attest_obj = json_object (); | 570 | cred_obj = json_object (); |
571 | json_object_set_new (attest_obj, "value", json_string (tmp_value)); | 571 | json_object_set_new (cred_obj, "value", json_string (tmp_value)); |
572 | json_object_set_new (attest_obj, "name", json_string (attest->name)); | 572 | json_object_set_new (cred_obj, "name", json_string (cred->name)); |
573 | type = GNUNET_RECLAIM_attestation_number_to_typename (attest->type); | 573 | type = GNUNET_RECLAIM_credential_number_to_typename (cred->type); |
574 | json_object_set_new (attest_obj, "type", json_string (type)); | 574 | json_object_set_new (cred_obj, "type", json_string (type)); |
575 | if (NULL != issuer) | 575 | if (NULL != issuer) |
576 | { | 576 | { |
577 | json_object_set_new (attest_obj, "issuer", json_string (issuer)); | 577 | json_object_set_new (cred_obj, "issuer", json_string (issuer)); |
578 | GNUNET_free (issuer); | 578 | GNUNET_free (issuer); |
579 | } | 579 | } |
580 | if (GNUNET_OK == GNUNET_RECLAIM_attestation_get_expiration (attest, | 580 | if (GNUNET_OK == GNUNET_RECLAIM_credential_get_expiration (cred, |
581 | &exp)) | 581 | &exp)) |
582 | { | 582 | { |
583 | json_object_set_new (attest_obj, "expiration", json_integer ( | 583 | json_object_set_new (cred_obj, "expiration", json_integer ( |
584 | exp.abs_value_us)); | 584 | exp.abs_value_us)); |
585 | } | 585 | } |
586 | id_str = GNUNET_STRINGS_data_to_string_alloc (&attest->id, | 586 | id_str = GNUNET_STRINGS_data_to_string_alloc (&cred->id, |
587 | sizeof(attest->id)); | 587 | sizeof(cred->id)); |
588 | json_object_set_new (attest_obj, "id", json_string (id_str)); | 588 | json_object_set_new (cred_obj, "id", json_string (id_str)); |
589 | GNUNET_free (tmp_value); | 589 | GNUNET_free (tmp_value); |
590 | GNUNET_free (id_str); | 590 | GNUNET_free (id_str); |
591 | if (NULL != attrs) | 591 | if (NULL != attrs) |
@@ -606,27 +606,27 @@ attest_collect (void *cls, | |||
606 | type = GNUNET_RECLAIM_attribute_number_to_typename (ale->attribute->type); | 606 | type = GNUNET_RECLAIM_attribute_number_to_typename (ale->attribute->type); |
607 | json_object_set_new (attr_obj, "type", json_string (type)); | 607 | json_object_set_new (attr_obj, "type", json_string (type)); |
608 | json_object_set_new (attr_obj, "id", json_string ("")); | 608 | json_object_set_new (attr_obj, "id", json_string ("")); |
609 | json_object_set_new (attr_obj, "attestation", json_string ("")); | 609 | json_object_set_new (attr_obj, "credential", json_string ("")); |
610 | json_array_append_new (attr_arr, attr_obj); | 610 | json_array_append_new (attr_arr, attr_obj); |
611 | GNUNET_free (tmp_value); | 611 | GNUNET_free (tmp_value); |
612 | } | 612 | } |
613 | json_object_set_new (attest_obj, "attributes", attr_arr); | 613 | json_object_set_new (cred_obj, "attributes", attr_arr); |
614 | } | 614 | } |
615 | json_array_append_new (handle->resp_object, attest_obj); | 615 | json_array_append_new (handle->resp_object, cred_obj); |
616 | GNUNET_RECLAIM_attribute_list_destroy (attrs); | 616 | GNUNET_RECLAIM_attribute_list_destroy (attrs); |
617 | GNUNET_RECLAIM_get_attestations_next (handle->attest_it); | 617 | GNUNET_RECLAIM_get_credentials_next (handle->cred_it); |
618 | } | 618 | } |
619 | 619 | ||
620 | 620 | ||
621 | /** | 621 | /** |
622 | * Lists attestation for identity request | 622 | * Lists credential for identity request |
623 | * | 623 | * |
624 | * @param con_handle the connection handle | 624 | * @param con_handle the connection handle |
625 | * @param url the url | 625 | * @param url the url |
626 | * @param cls the RequestHandle | 626 | * @param cls the RequestHandle |
627 | */ | 627 | */ |
628 | static void | 628 | static void |
629 | list_attestation_cont (struct GNUNET_REST_RequestHandle *con_handle, | 629 | list_credential_cont (struct GNUNET_REST_RequestHandle *con_handle, |
630 | const char *url, | 630 | const char *url, |
631 | void *cls) | 631 | void *cls) |
632 | { | 632 | { |
@@ -636,9 +636,9 @@ list_attestation_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
636 | char *identity; | 636 | char *identity; |
637 | 637 | ||
638 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 638 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
639 | "Getting attestations for %s.\n", | 639 | "Getting credentials for %s.\n", |
640 | handle->url); | 640 | handle->url); |
641 | if (strlen (GNUNET_REST_API_NS_RECLAIM_ATTESTATION) >= strlen ( | 641 | if (strlen (GNUNET_REST_API_NS_RECLAIM_CREDENTIAL) >= strlen ( |
642 | handle->url)) | 642 | handle->url)) |
643 | { | 643 | { |
644 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No identity given.\n"); | 644 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No identity given.\n"); |
@@ -646,7 +646,7 @@ list_attestation_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
646 | return; | 646 | return; |
647 | } | 647 | } |
648 | identity = handle->url + strlen ( | 648 | identity = handle->url + strlen ( |
649 | GNUNET_REST_API_NS_RECLAIM_ATTESTATION) + 1; | 649 | GNUNET_REST_API_NS_RECLAIM_CREDENTIAL) + 1; |
650 | 650 | ||
651 | for (ego_entry = ego_head; NULL != ego_entry; | 651 | for (ego_entry = ego_head; NULL != ego_entry; |
652 | ego_entry = ego_entry->next) | 652 | ego_entry = ego_entry->next) |
@@ -663,11 +663,11 @@ list_attestation_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
663 | return; | 663 | return; |
664 | } | 664 | } |
665 | priv_key = GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego); | 665 | priv_key = GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego); |
666 | handle->attest_it = GNUNET_RECLAIM_get_attestations_start (idp, | 666 | handle->cred_it = GNUNET_RECLAIM_get_credentials_start (idp, |
667 | priv_key, | 667 | priv_key, |
668 | &collect_error_cb, | 668 | &collect_error_cb, |
669 | handle, | 669 | handle, |
670 | &attest_collect, | 670 | &cred_collect, |
671 | handle, | 671 | handle, |
672 | & | 672 | & |
673 | collect_finished_cb, | 673 | collect_finished_cb, |
@@ -676,27 +676,27 @@ list_attestation_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
676 | 676 | ||
677 | 677 | ||
678 | /** | 678 | /** |
679 | * Deletes attestation from an identity | 679 | * Deletes credential from an identity |
680 | * | 680 | * |
681 | * @param con_handle the connection handle | 681 | * @param con_handle the connection handle |
682 | * @param url the url | 682 | * @param url the url |
683 | * @param cls the RequestHandle | 683 | * @param cls the RequestHandle |
684 | */ | 684 | */ |
685 | static void | 685 | static void |
686 | delete_attestation_cont (struct GNUNET_REST_RequestHandle *con_handle, | 686 | delete_credential_cont (struct GNUNET_REST_RequestHandle *con_handle, |
687 | const char *url, | 687 | const char *url, |
688 | void *cls) | 688 | void *cls) |
689 | { | 689 | { |
690 | struct RequestHandle *handle = cls; | 690 | struct RequestHandle *handle = cls; |
691 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key; | 691 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *priv_key; |
692 | struct GNUNET_RECLAIM_Attestation attr; | 692 | struct GNUNET_RECLAIM_Credential attr; |
693 | struct EgoEntry *ego_entry; | 693 | struct EgoEntry *ego_entry; |
694 | char *identity_id_str; | 694 | char *identity_id_str; |
695 | char *identity; | 695 | char *identity; |
696 | char *id; | 696 | char *id; |
697 | 697 | ||
698 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Deleting attestation.\n"); | 698 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Deleting credential.\n"); |
699 | if (strlen (GNUNET_REST_API_NS_RECLAIM_ATTESTATION) >= strlen ( | 699 | if (strlen (GNUNET_REST_API_NS_RECLAIM_CREDENTIAL) >= strlen ( |
700 | handle->url)) | 700 | handle->url)) |
701 | { | 701 | { |
702 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No identity given.\n"); | 702 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No identity given.\n"); |
@@ -705,7 +705,7 @@ delete_attestation_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
705 | } | 705 | } |
706 | identity_id_str = | 706 | identity_id_str = |
707 | strdup (handle->url + strlen ( | 707 | strdup (handle->url + strlen ( |
708 | GNUNET_REST_API_NS_RECLAIM_ATTESTATION) + 1); | 708 | GNUNET_REST_API_NS_RECLAIM_CREDENTIAL) + 1); |
709 | identity = strtok (identity_id_str, "/"); | 709 | identity = strtok (identity_id_str, "/"); |
710 | id = strtok (NULL, "/"); | 710 | id = strtok (NULL, "/"); |
711 | if ((NULL == identity) || (NULL == id)) | 711 | if ((NULL == identity) || (NULL == id)) |
@@ -730,10 +730,10 @@ delete_attestation_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
730 | return; | 730 | return; |
731 | } | 731 | } |
732 | priv_key = GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego); | 732 | priv_key = GNUNET_IDENTITY_ego_get_private_key (ego_entry->ego); |
733 | memset (&attr, 0, sizeof(struct GNUNET_RECLAIM_Attestation)); | 733 | memset (&attr, 0, sizeof(struct GNUNET_RECLAIM_Credential)); |
734 | GNUNET_STRINGS_string_to_data (id, strlen (id), &attr.id, sizeof(attr.id)); | 734 | GNUNET_STRINGS_string_to_data (id, strlen (id), &attr.id, sizeof(attr.id)); |
735 | attr.name = ""; | 735 | attr.name = ""; |
736 | handle->idp_op = GNUNET_RECLAIM_attestation_delete (idp, | 736 | handle->idp_op = GNUNET_RECLAIM_credential_delete (idp, |
737 | priv_key, | 737 | priv_key, |
738 | &attr, | 738 | &attr, |
739 | &delete_finished_cb, | 739 | &delete_finished_cb, |
@@ -877,13 +877,13 @@ add_attribute_cont (struct GNUNET_REST_RequestHandle *con_handle, | |||
877 | /** | 877 | /** |
878 | * Parse a JWT and return the respective claim value as Attribute | 878 | * Parse a JWT and return the respective claim value as Attribute |
879 | * | 879 | * |
880 | * @param attest the jwt attestation | 880 | * @param cred the jwt credential |
881 | * @param claim the name of the claim in the JWT | 881 | * @param claim the name of the claim in the JWT |
882 | * | 882 | * |
883 | * @return a GNUNET_RECLAIM_Attribute, containing the new value | 883 | * @return a GNUNET_RECLAIM_Attribute, containing the new value |
884 | */ | 884 | */ |
885 | struct GNUNET_RECLAIM_Attribute * | 885 | struct GNUNET_RECLAIM_Attribute * |
886 | parse_jwt (const struct GNUNET_RECLAIM_Attestation *attest, | 886 | parse_jwt (const struct GNUNET_RECLAIM_Credential *cred, |
887 | const char *claim) | 887 | const char *claim) |
888 | { | 888 | { |
889 | char *jwt_string; | 889 | char *jwt_string; |
@@ -899,9 +899,9 @@ parse_jwt (const struct GNUNET_RECLAIM_Attestation *attest, | |||
899 | json_t *json_val; | 899 | json_t *json_val; |
900 | json_error_t *json_err = NULL; | 900 | json_error_t *json_err = NULL; |
901 | 901 | ||
902 | jwt_string = GNUNET_RECLAIM_attestation_value_to_string (attest->type, | 902 | jwt_string = GNUNET_RECLAIM_credential_value_to_string (cred->type, |
903 | attest->data, | 903 | cred->data, |
904 | attest->data_size); | 904 | cred->data_size); |
905 | char *jwt_body = strtok (jwt_string, delim); | 905 | char *jwt_body = strtok (jwt_string, delim); |
906 | jwt_body = strtok (NULL, delim); | 906 | jwt_body = strtok (NULL, delim); |
907 | GNUNET_STRINGS_base64_decode (jwt_body, strlen (jwt_body), | 907 | GNUNET_STRINGS_base64_decode (jwt_body, strlen (jwt_body), |
@@ -927,16 +927,16 @@ parse_jwt (const struct GNUNET_RECLAIM_Attestation *attest, | |||
927 | "Error: Referenced Claim Name not Found", | 927 | "Error: Referenced Claim Name not Found", |
928 | (void **) &data, | 928 | (void **) &data, |
929 | &data_size); | 929 | &data_size); |
930 | attr = GNUNET_RECLAIM_attribute_new (claim, &attest->id, | 930 | attr = GNUNET_RECLAIM_attribute_new (claim, &cred->id, |
931 | type, data, data_size); | 931 | type, data, data_size); |
932 | attr->id = attest->id; | 932 | attr->id = cred->id; |
933 | attr->flag = 1; | 933 | attr->flag = 1; |
934 | } | 934 | } |
935 | else | 935 | else |
936 | { | 936 | { |
937 | attr = GNUNET_RECLAIM_attribute_new (claim, &attest->id, | 937 | attr = GNUNET_RECLAIM_attribute_new (claim, &cred->id, |
938 | type, data, data_size); | 938 | type, data, data_size); |
939 | attr->id = attest->id; | 939 | attr->id = cred->id; |
940 | attr->flag = 1; | 940 | attr->flag = 1; |
941 | } | 941 | } |
942 | return attr; | 942 | return attr; |
@@ -965,7 +965,7 @@ attr_collect (void *cls, | |||
965 | json_object_set_new (attr_obj, "value", json_string (tmp_value)); | 965 | json_object_set_new (attr_obj, "value", json_string (tmp_value)); |
966 | json_object_set_new (attr_obj, "name", json_string (attr->name)); | 966 | json_object_set_new (attr_obj, "name", json_string (attr->name)); |
967 | 967 | ||
968 | if (GNUNET_RECLAIM_id_is_zero (&attr->attestation)) | 968 | if (GNUNET_RECLAIM_id_is_zero (&attr->credential)) |
969 | json_object_set_new (attr_obj, "flag", json_string ("0")); | 969 | json_object_set_new (attr_obj, "flag", json_string ("0")); |
970 | else | 970 | else |
971 | json_object_set_new (attr_obj, "flag", json_string ("1")); | 971 | json_object_set_new (attr_obj, "flag", json_string ("1")); |
@@ -974,9 +974,9 @@ attr_collect (void *cls, | |||
974 | id_str = GNUNET_STRINGS_data_to_string_alloc (&attr->id, | 974 | id_str = GNUNET_STRINGS_data_to_string_alloc (&attr->id, |
975 | sizeof(attr->id)); | 975 | sizeof(attr->id)); |
976 | json_object_set_new (attr_obj, "id", json_string (id_str)); | 976 | json_object_set_new (attr_obj, "id", json_string (id_str)); |
977 | id_str = GNUNET_STRINGS_data_to_string_alloc (&attr->attestation, | 977 | id_str = GNUNET_STRINGS_data_to_string_alloc (&attr->credential, |
978 | sizeof(attr->attestation)); | 978 | sizeof(attr->credential)); |
979 | json_object_set_new (attr_obj, "attestation", json_string (id_str)); | 979 | json_object_set_new (attr_obj, "credential", json_string (id_str)); |
980 | json_array_append (handle->resp_object, attr_obj); | 980 | json_array_append (handle->resp_object, attr_obj); |
981 | json_decref (attr_obj); | 981 | json_decref (attr_obj); |
982 | GNUNET_free (tmp_value); | 982 | GNUNET_free (tmp_value); |
@@ -1180,7 +1180,7 @@ static void | |||
1180 | consume_cont (void *cls, | 1180 | consume_cont (void *cls, |
1181 | const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, | 1181 | const struct GNUNET_CRYPTO_EcdsaPublicKey *identity, |
1182 | const struct GNUNET_RECLAIM_Attribute *attr, | 1182 | const struct GNUNET_RECLAIM_Attribute *attr, |
1183 | const struct GNUNET_RECLAIM_Attestation *attest) | 1183 | const struct GNUNET_RECLAIM_Credential *cred) |
1184 | { | 1184 | { |
1185 | struct RequestHandle *handle = cls; | 1185 | struct RequestHandle *handle = cls; |
1186 | char *val_str; | 1186 | char *val_str; |
@@ -1427,11 +1427,11 @@ rest_identity_process_request (struct GNUNET_REST_RequestHandle *rest_handle, | |||
1427 | { MHD_HTTP_METHOD_DELETE, | 1427 | { MHD_HTTP_METHOD_DELETE, |
1428 | GNUNET_REST_API_NS_RECLAIM_ATTRIBUTES, &delete_attribute_cont }, | 1428 | GNUNET_REST_API_NS_RECLAIM_ATTRIBUTES, &delete_attribute_cont }, |
1429 | { MHD_HTTP_METHOD_GET, | 1429 | { MHD_HTTP_METHOD_GET, |
1430 | GNUNET_REST_API_NS_RECLAIM_ATTESTATION, &list_attestation_cont }, | 1430 | GNUNET_REST_API_NS_RECLAIM_CREDENTIAL, &list_credential_cont }, |
1431 | { MHD_HTTP_METHOD_POST, | 1431 | { MHD_HTTP_METHOD_POST, |
1432 | GNUNET_REST_API_NS_RECLAIM_ATTESTATION, &add_attestation_cont }, | 1432 | GNUNET_REST_API_NS_RECLAIM_CREDENTIAL, &add_credential_cont }, |
1433 | { MHD_HTTP_METHOD_DELETE, | 1433 | { MHD_HTTP_METHOD_DELETE, |
1434 | GNUNET_REST_API_NS_RECLAIM_ATTESTATION, &delete_attestation_cont }, | 1434 | GNUNET_REST_API_NS_RECLAIM_CREDENTIAL, &delete_credential_cont }, |
1435 | { MHD_HTTP_METHOD_GET, | 1435 | { MHD_HTTP_METHOD_GET, |
1436 | GNUNET_REST_API_NS_IDENTITY_TICKETS, &list_tickets_cont }, | 1436 | GNUNET_REST_API_NS_IDENTITY_TICKETS, &list_tickets_cont }, |
1437 | { MHD_HTTP_METHOD_POST, | 1437 | { MHD_HTTP_METHOD_POST, |