aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim/reclaim_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/reclaim/reclaim_api.c')
-rw-r--r--src/reclaim/reclaim_api.c219
1 files changed, 128 insertions, 91 deletions
diff --git a/src/reclaim/reclaim_api.c b/src/reclaim/reclaim_api.c
index b432b4f2a..1e0251519 100644
--- a/src/reclaim/reclaim_api.c
+++ b/src/reclaim/reclaim_api.c
@@ -77,9 +77,9 @@ struct GNUNET_RECLAIM_Operation
77 GNUNET_RECLAIM_AttributeTicketResult atr_cb; 77 GNUNET_RECLAIM_AttributeTicketResult atr_cb;
78 78
79 /** 79 /**
80 * Attestation result callback 80 * Credential result callback
81 */ 81 */
82 GNUNET_RECLAIM_AttestationResult at_cb; 82 GNUNET_RECLAIM_CredentialResult at_cb;
83 83
84 /** 84 /**
85 * Revocation result callback 85 * Revocation result callback
@@ -92,6 +92,11 @@ struct GNUNET_RECLAIM_Operation
92 GNUNET_RECLAIM_TicketCallback tr_cb; 92 GNUNET_RECLAIM_TicketCallback tr_cb;
93 93
94 /** 94 /**
95 * Ticket issue result callback
96 */
97 GNUNET_RECLAIM_IssueTicketCallback ti_cb;
98
99 /**
95 * Envelope with the message for this queue entry. 100 * Envelope with the message for this queue entry.
96 */ 101 */
97 struct GNUNET_MQ_Envelope *env; 102 struct GNUNET_MQ_Envelope *env;
@@ -239,19 +244,19 @@ struct GNUNET_RECLAIM_AttributeIterator
239}; 244};
240 245
241/** 246/**
242 * Handle for a attestation iterator operation 247 * Handle for a credential iterator operation
243 */ 248 */
244struct GNUNET_RECLAIM_AttestationIterator 249struct GNUNET_RECLAIM_CredentialIterator
245{ 250{
246 /** 251 /**
247 * Kept in a DLL. 252 * Kept in a DLL.
248 */ 253 */
249 struct GNUNET_RECLAIM_AttestationIterator *next; 254 struct GNUNET_RECLAIM_CredentialIterator *next;
250 255
251 /** 256 /**
252 * Kept in a DLL. 257 * Kept in a DLL.
253 */ 258 */
254 struct GNUNET_RECLAIM_AttestationIterator *prev; 259 struct GNUNET_RECLAIM_CredentialIterator *prev;
255 260
256 /** 261 /**
257 * Main handle to access the service. 262 * Main handle to access the service.
@@ -271,7 +276,7 @@ struct GNUNET_RECLAIM_AttestationIterator
271 /** 276 /**
272 * The continuation to call with the results 277 * The continuation to call with the results
273 */ 278 */
274 GNUNET_RECLAIM_AttestationResult proc; 279 GNUNET_RECLAIM_CredentialResult proc;
275 280
276 /** 281 /**
277 * Closure for @e proc. 282 * Closure for @e proc.
@@ -349,12 +354,12 @@ struct GNUNET_RECLAIM_Handle
349 /** 354 /**
350 * Head of active iterations 355 * Head of active iterations
351 */ 356 */
352 struct GNUNET_RECLAIM_AttestationIterator *ait_head; 357 struct GNUNET_RECLAIM_CredentialIterator *ait_head;
353 358
354 /** 359 /**
355 * Tail of active iterations 360 * Tail of active iterations
356 */ 361 */
357 struct GNUNET_RECLAIM_AttestationIterator *ait_tail; 362 struct GNUNET_RECLAIM_CredentialIterator *ait_tail;
358 363
359 /** 364 /**
360 * Head of active iterations 365 * Head of active iterations
@@ -464,7 +469,7 @@ free_it (struct GNUNET_RECLAIM_AttributeIterator *it)
464 * @param ait entry to free 469 * @param ait entry to free
465 */ 470 */
466static void 471static void
467free_ait (struct GNUNET_RECLAIM_AttestationIterator *ait) 472free_ait (struct GNUNET_RECLAIM_CredentialIterator *ait)
468{ 473{
469 struct GNUNET_RECLAIM_Handle *h = ait->h; 474 struct GNUNET_RECLAIM_Handle *h = ait->h;
470 475
@@ -561,13 +566,13 @@ check_consume_ticket_result (void *cls,
561{ 566{
562 size_t msg_len; 567 size_t msg_len;
563 size_t attrs_len; 568 size_t attrs_len;
564 size_t attests_len; 569 size_t pl_len;
565 570
566 msg_len = ntohs (msg->header.size); 571 msg_len = ntohs (msg->header.size);
567 attrs_len = ntohs (msg->attrs_len); 572 attrs_len = ntohs (msg->attrs_len);
568 attests_len = ntohs (msg->attestations_len); 573 pl_len = ntohs (msg->presentations_len);
569 if (msg_len != 574 if (msg_len !=
570 sizeof(struct ConsumeTicketResultMessage) + attrs_len + attests_len) 575 sizeof(struct ConsumeTicketResultMessage) + attrs_len + pl_len)
571 { 576 {
572 GNUNET_break (0); 577 GNUNET_break (0);
573 return GNUNET_SYSERR; 578 return GNUNET_SYSERR;
@@ -590,12 +595,12 @@ handle_consume_ticket_result (void *cls,
590 struct GNUNET_RECLAIM_Handle *h = cls; 595 struct GNUNET_RECLAIM_Handle *h = cls;
591 struct GNUNET_RECLAIM_Operation *op; 596 struct GNUNET_RECLAIM_Operation *op;
592 size_t attrs_len; 597 size_t attrs_len;
593 size_t attests_len; 598 size_t pl_len;
594 uint32_t r_id = ntohl (msg->id); 599 uint32_t r_id = ntohl (msg->id);
595 char *read_ptr; 600 char *read_ptr;
596 601
597 attrs_len = ntohs (msg->attrs_len); 602 attrs_len = ntohs (msg->attrs_len);
598 attests_len = ntohs (msg->attestations_len); 603 pl_len = ntohs (msg->presentations_len);
599 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing ticket result.\n"); 604 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Processing ticket result.\n");
600 605
601 606
@@ -608,13 +613,12 @@ handle_consume_ticket_result (void *cls,
608 { 613 {
609 struct GNUNET_RECLAIM_AttributeList *attrs; 614 struct GNUNET_RECLAIM_AttributeList *attrs;
610 struct GNUNET_RECLAIM_AttributeListEntry *le; 615 struct GNUNET_RECLAIM_AttributeListEntry *le;
611 struct GNUNET_RECLAIM_AttestationList *attests; 616 struct GNUNET_RECLAIM_PresentationList *pl;
612 struct GNUNET_RECLAIM_AttestationListEntry *ale; 617 struct GNUNET_RECLAIM_PresentationListEntry *ple;
613 attrs = 618 attrs =
614 GNUNET_RECLAIM_attribute_list_deserialize ((char *) &msg[1], attrs_len); 619 GNUNET_RECLAIM_attribute_list_deserialize ((char *) &msg[1], attrs_len);
615 read_ptr = ((char *) &msg[1]) + attrs_len; 620 read_ptr = ((char *) &msg[1]) + attrs_len;
616 attests = 621 pl = GNUNET_RECLAIM_presentation_list_deserialize (read_ptr, pl_len);
617 GNUNET_RECLAIM_attestation_list_deserialize (read_ptr, attests_len);
618 if (NULL != op->atr_cb) 622 if (NULL != op->atr_cb)
619 { 623 {
620 if (NULL == attrs) 624 if (NULL == attrs)
@@ -626,22 +630,22 @@ handle_consume_ticket_result (void *cls,
626 for (le = attrs->list_head; NULL != le; le = le->next) 630 for (le = attrs->list_head; NULL != le; le = le->next)
627 { 631 {
628 if (GNUNET_NO == 632 if (GNUNET_NO ==
629 GNUNET_RECLAIM_id_is_zero (&le->attribute->attestation)) 633 GNUNET_RECLAIM_id_is_zero (&le->attribute->credential))
630 { 634 {
631 for (ale = attests->list_head; NULL != ale; ale = ale->next) 635 for (ple = pl->list_head; NULL != ple; ple = ple->next)
632 { 636 {
633 if (GNUNET_YES == 637 if (GNUNET_YES ==
634 GNUNET_RECLAIM_id_is_equal (&le->attribute->attestation, 638 GNUNET_RECLAIM_id_is_equal (&le->attribute->credential,
635 &ale->attestation->id)) 639 &ple->presentation->credential_id))
636 { 640 {
637 op->atr_cb (op->cls, &msg->identity, 641 op->atr_cb (op->cls, &msg->identity,
638 le->attribute, ale->attestation); 642 le->attribute, ple->presentation);
639 break; 643 break;
640 } 644 }
641 645
642 } 646 }
643 } 647 }
644 else // No attestations 648 else // No credentials
645 { 649 {
646 op->atr_cb (op->cls, &msg->identity, 650 op->atr_cb (op->cls, &msg->identity,
647 le->attribute, NULL); 651 le->attribute, NULL);
@@ -649,10 +653,10 @@ handle_consume_ticket_result (void *cls,
649 } 653 }
650 if (NULL != attrs) 654 if (NULL != attrs)
651 GNUNET_RECLAIM_attribute_list_destroy (attrs); 655 GNUNET_RECLAIM_attribute_list_destroy (attrs);
652 if (NULL != attests) 656 if (NULL != pl)
653 GNUNET_RECLAIM_attestation_list_destroy (attests); 657 GNUNET_RECLAIM_presentation_list_destroy (pl);
654 attrs = NULL; 658 attrs = NULL;
655 attests = NULL; 659 pl = NULL;
656 } 660 }
657 op->atr_cb (op->cls, NULL, NULL, NULL); 661 op->atr_cb (op->cls, NULL, NULL, NULL);
658 } 662 }
@@ -768,21 +772,21 @@ handle_attribute_result (void *cls, const struct AttributeResultMessage *msg)
768 772
769/** 773/**
770 * Handle an incoming message of type 774 * Handle an incoming message of type
771 * #GNUNET_MESSAGE_TYPE_RECLAIM_attestation_RESULT 775 * #GNUNET_MESSAGE_TYPE_RECLAIM_credential_RESULT
772 * 776 *
773 * @param cls 777 * @param cls
774 * @param msg the message we received 778 * @param msg the message we received
775 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 779 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
776 */ 780 */
777static int 781static int
778check_attestation_result (void *cls, const struct AttestationResultMessage *msg) 782check_credential_result (void *cls, const struct CredentialResultMessage *msg)
779{ 783{
780 size_t msg_len; 784 size_t msg_len;
781 size_t attest_len; 785 size_t cred_len;
782 786
783 msg_len = ntohs (msg->header.size); 787 msg_len = ntohs (msg->header.size);
784 attest_len = ntohs (msg->attestation_len); 788 cred_len = ntohs (msg->credential_len);
785 if (msg_len != sizeof(struct AttestationResultMessage) + attest_len) 789 if (msg_len != sizeof(struct CredentialResultMessage) + cred_len)
786 { 790 {
787 GNUNET_break (0); 791 GNUNET_break (0);
788 return GNUNET_SYSERR; 792 return GNUNET_SYSERR;
@@ -793,24 +797,24 @@ check_attestation_result (void *cls, const struct AttestationResultMessage *msg)
793 797
794/** 798/**
795 * Handle an incoming message of type 799 * Handle an incoming message of type
796 * #GNUNET_MESSAGE_TYPE_RECLAIM_attestation_RESULT 800 * #GNUNET_MESSAGE_TYPE_RECLAIM_credential_RESULT
797 * 801 *
798 * @param cls 802 * @param cls
799 * @param msg the message we received 803 * @param msg the message we received
800 */ 804 */
801static void 805static void
802handle_attestation_result (void *cls, const struct 806handle_credential_result (void *cls, const struct
803 AttestationResultMessage *msg) 807 CredentialResultMessage *msg)
804{ 808{
805 static struct GNUNET_CRYPTO_EcdsaPrivateKey identity_dummy; 809 static struct GNUNET_CRYPTO_EcdsaPrivateKey identity_dummy;
806 struct GNUNET_RECLAIM_Handle *h = cls; 810 struct GNUNET_RECLAIM_Handle *h = cls;
807 struct GNUNET_RECLAIM_AttestationIterator *it; 811 struct GNUNET_RECLAIM_CredentialIterator *it;
808 struct GNUNET_RECLAIM_Operation *op; 812 struct GNUNET_RECLAIM_Operation *op;
809 size_t att_len; 813 size_t att_len;
810 uint32_t r_id = ntohl (msg->id); 814 uint32_t r_id = ntohl (msg->id);
811 815
812 att_len = ntohs (msg->attestation_len); 816 att_len = ntohs (msg->credential_len);
813 LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing attestation result.\n"); 817 LOG (GNUNET_ERROR_TYPE_DEBUG, "Processing credential result.\n");
814 818
815 819
816 for (it = h->ait_head; NULL != it; it = it->next) 820 for (it = h->ait_head; NULL != it; it = it->next)
@@ -848,8 +852,8 @@ handle_attestation_result (void *cls, const struct
848 } 852 }
849 853
850 { 854 {
851 struct GNUNET_RECLAIM_Attestation *att; 855 struct GNUNET_RECLAIM_Credential *att;
852 att = GNUNET_RECLAIM_attestation_deserialize ((char *) &msg[1], att_len); 856 att = GNUNET_RECLAIM_credential_deserialize ((char *) &msg[1], att_len);
853 857
854 if (NULL != it) 858 if (NULL != it)
855 { 859 {
@@ -867,6 +871,30 @@ handle_attestation_result (void *cls, const struct
867 GNUNET_assert (0); 871 GNUNET_assert (0);
868} 872}
869 873
874/**
875 * Handle an incoming message of type
876 * #GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT
877 *
878 * @param cls
879 * @param msg the message we received
880 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
881 */
882static int
883check_ticket_result (void *cls, const struct TicketResultMessage *msg)
884{
885 size_t msg_len;
886 size_t pres_len;
887
888 msg_len = ntohs (msg->header.size);
889 pres_len = ntohs (msg->presentations_len);
890 if (msg_len != sizeof(struct TicketResultMessage) + pres_len)
891 {
892 GNUNET_break (0);
893 return GNUNET_SYSERR;
894 }
895 return GNUNET_OK;
896}
897
870 898
871/** 899/**
872 * Handle an incoming message of type 900 * Handle an incoming message of type
@@ -881,8 +909,10 @@ handle_ticket_result (void *cls, const struct TicketResultMessage *msg)
881 struct GNUNET_RECLAIM_Handle *handle = cls; 909 struct GNUNET_RECLAIM_Handle *handle = cls;
882 struct GNUNET_RECLAIM_Operation *op; 910 struct GNUNET_RECLAIM_Operation *op;
883 struct GNUNET_RECLAIM_TicketIterator *it; 911 struct GNUNET_RECLAIM_TicketIterator *it;
912 struct GNUNET_RECLAIM_PresentationList *pres;
884 uint32_t r_id = ntohl (msg->id); 913 uint32_t r_id = ntohl (msg->id);
885 static const struct GNUNET_RECLAIM_Ticket ticket; 914 static const struct GNUNET_RECLAIM_Ticket ticket;
915 uint32_t pres_len = ntohs (msg->presentations_len);
886 916
887 for (op = handle->op_head; NULL != op; op = op->next) 917 for (op = handle->op_head; NULL != op; op = op->next)
888 if (op->r_id == r_id) 918 if (op->r_id == r_id)
@@ -894,18 +924,25 @@ handle_ticket_result (void *cls, const struct TicketResultMessage *msg)
894 return; 924 return;
895 if (NULL != op) 925 if (NULL != op)
896 { 926 {
927 if (0 < pres_len)
928 pres = GNUNET_RECLAIM_presentation_list_deserialize ((char*)&msg[1],
929 pres_len);
897 GNUNET_CONTAINER_DLL_remove (handle->op_head, handle->op_tail, op); 930 GNUNET_CONTAINER_DLL_remove (handle->op_head, handle->op_tail, op);
898 if (0 == 931 if (0 ==
899 memcmp (&msg->ticket, &ticket, sizeof(struct GNUNET_RECLAIM_Ticket))) 932 memcmp (&msg->ticket, &ticket, sizeof(struct GNUNET_RECLAIM_Ticket)))
900 { 933 {
901 if (NULL != op->tr_cb) 934 if (NULL != op->ti_cb)
902 op->tr_cb (op->cls, NULL); 935 op->ti_cb (op->cls, NULL, NULL);
903 } 936 }
904 else 937 else
905 { 938 {
906 if (NULL != op->tr_cb) 939 if (NULL != op->ti_cb)
907 op->tr_cb (op->cls, &msg->ticket); 940 op->ti_cb (op->cls,
941 &msg->ticket,
942 (0 < pres_len) ? pres : NULL);
908 } 943 }
944 if (0 < pres_len)
945 GNUNET_RECLAIM_presentation_list_destroy (pres);
909 free_op (op); 946 free_op (op);
910 return; 947 return;
911 } 948 }
@@ -986,14 +1023,14 @@ reconnect (struct GNUNET_RECLAIM_Handle *h)
986 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT, 1023 GNUNET_MESSAGE_TYPE_RECLAIM_ATTRIBUTE_RESULT,
987 struct AttributeResultMessage, 1024 struct AttributeResultMessage,
988 h), 1025 h),
989 GNUNET_MQ_hd_var_size (attestation_result, 1026 GNUNET_MQ_hd_var_size (credential_result,
990 GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_RESULT, 1027 GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_RESULT,
991 struct AttestationResultMessage, 1028 struct CredentialResultMessage,
1029 h),
1030 GNUNET_MQ_hd_var_size (ticket_result,
1031 GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT,
1032 struct TicketResultMessage,
992 h), 1033 h),
993 GNUNET_MQ_hd_fixed_size (ticket_result,
994 GNUNET_MESSAGE_TYPE_RECLAIM_TICKET_RESULT,
995 struct TicketResultMessage,
996 h),
997 GNUNET_MQ_hd_var_size (consume_ticket_result, 1034 GNUNET_MQ_hd_var_size (consume_ticket_result,
998 GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET_RESULT, 1035 GNUNET_MESSAGE_TYPE_RECLAIM_CONSUME_TICKET_RESULT,
999 struct ConsumeTicketResultMessage, 1036 struct ConsumeTicketResultMessage,
@@ -1175,22 +1212,22 @@ GNUNET_RECLAIM_attribute_delete (
1175 1212
1176 1213
1177/** 1214/**
1178 * Store an attestation. If the attestation is already present, 1215 * Store an credential. If the credential is already present,
1179 * it is replaced with the new attestation. 1216 * it is replaced with the new credential.
1180 * 1217 *
1181 * @param h handle to the re:claimID service 1218 * @param h handle to the re:claimID service
1182 * @param pkey private key of the identity 1219 * @param pkey private key of the identity
1183 * @param attr the attestation value 1220 * @param attr the credential value
1184 * @param exp_interval the relative expiration interval for the attestation 1221 * @param exp_interval the relative expiration interval for the credential
1185 * @param cont continuation to call when done 1222 * @param cont continuation to call when done
1186 * @param cont_cls closure for @a cont 1223 * @param cont_cls closure for @a cont
1187 * @return handle to abort the request 1224 * @return handle to abort the request
1188 */ 1225 */
1189struct GNUNET_RECLAIM_Operation * 1226struct GNUNET_RECLAIM_Operation *
1190GNUNET_RECLAIM_attestation_store ( 1227GNUNET_RECLAIM_credential_store (
1191 struct GNUNET_RECLAIM_Handle *h, 1228 struct GNUNET_RECLAIM_Handle *h,
1192 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, 1229 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
1193 const struct GNUNET_RECLAIM_Attestation *attr, 1230 const struct GNUNET_RECLAIM_Credential *attr,
1194 const struct GNUNET_TIME_Relative *exp_interval, 1231 const struct GNUNET_TIME_Relative *exp_interval,
1195 GNUNET_RECLAIM_ContinuationWithStatus cont, 1232 GNUNET_RECLAIM_ContinuationWithStatus cont,
1196 void *cont_cls) 1233 void *cont_cls)
@@ -1205,15 +1242,15 @@ GNUNET_RECLAIM_attestation_store (
1205 op->cls = cont_cls; 1242 op->cls = cont_cls;
1206 op->r_id = h->r_id_gen++; 1243 op->r_id = h->r_id_gen++;
1207 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); 1244 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1208 attr_len = GNUNET_RECLAIM_attestation_serialize_get_size (attr); 1245 attr_len = GNUNET_RECLAIM_credential_serialize_get_size (attr);
1209 op->env = GNUNET_MQ_msg_extra (sam, 1246 op->env = GNUNET_MQ_msg_extra (sam,
1210 attr_len, 1247 attr_len,
1211 GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_STORE); 1248 GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_STORE);
1212 sam->identity = *pkey; 1249 sam->identity = *pkey;
1213 sam->id = htonl (op->r_id); 1250 sam->id = htonl (op->r_id);
1214 sam->exp = GNUNET_htonll (exp_interval->rel_value_us); 1251 sam->exp = GNUNET_htonll (exp_interval->rel_value_us);
1215 1252
1216 GNUNET_RECLAIM_attestation_serialize (attr, (char *) &sam[1]); 1253 GNUNET_RECLAIM_credential_serialize (attr, (char *) &sam[1]);
1217 1254
1218 sam->attr_len = htons (attr_len); 1255 sam->attr_len = htons (attr_len);
1219 if (NULL != h->mq) 1256 if (NULL != h->mq)
@@ -1223,21 +1260,21 @@ GNUNET_RECLAIM_attestation_store (
1223 1260
1224 1261
1225/** 1262/**
1226 * Delete an attestation. Tickets used to share this attestation are updated 1263 * Delete an credential. Tickets used to share this credential are updated
1227 * accordingly. 1264 * accordingly.
1228 * 1265 *
1229 * @param h handle to the re:claimID service 1266 * @param h handle to the re:claimID service
1230 * @param pkey Private key of the identity to add an attribute to 1267 * @param pkey Private key of the identity to add an attribute to
1231 * @param attr The attestation 1268 * @param attr The credential
1232 * @param cont Continuation to call when done 1269 * @param cont Continuation to call when done
1233 * @param cont_cls Closure for @a cont 1270 * @param cont_cls Closure for @a cont
1234 * @return handle Used to to abort the request 1271 * @return handle Used to to abort the request
1235 */ 1272 */
1236struct GNUNET_RECLAIM_Operation * 1273struct GNUNET_RECLAIM_Operation *
1237GNUNET_RECLAIM_attestation_delete ( 1274GNUNET_RECLAIM_credential_delete (
1238 struct GNUNET_RECLAIM_Handle *h, 1275 struct GNUNET_RECLAIM_Handle *h,
1239 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey, 1276 const struct GNUNET_CRYPTO_EcdsaPrivateKey *pkey,
1240 const struct GNUNET_RECLAIM_Attestation *attr, 1277 const struct GNUNET_RECLAIM_Credential *attr,
1241 GNUNET_RECLAIM_ContinuationWithStatus cont, 1278 GNUNET_RECLAIM_ContinuationWithStatus cont,
1242 void *cont_cls) 1279 void *cont_cls)
1243{ 1280{
@@ -1251,13 +1288,13 @@ GNUNET_RECLAIM_attestation_delete (
1251 op->cls = cont_cls; 1288 op->cls = cont_cls;
1252 op->r_id = h->r_id_gen++; 1289 op->r_id = h->r_id_gen++;
1253 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); 1290 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);
1254 attr_len = GNUNET_RECLAIM_attestation_serialize_get_size (attr); 1291 attr_len = GNUNET_RECLAIM_credential_serialize_get_size (attr);
1255 op->env = GNUNET_MQ_msg_extra (dam, 1292 op->env = GNUNET_MQ_msg_extra (dam,
1256 attr_len, 1293 attr_len,
1257 GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_DELETE); 1294 GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_DELETE);
1258 dam->identity = *pkey; 1295 dam->identity = *pkey;
1259 dam->id = htonl (op->r_id); 1296 dam->id = htonl (op->r_id);
1260 GNUNET_RECLAIM_attestation_serialize (attr, (char *) &dam[1]); 1297 GNUNET_RECLAIM_credential_serialize (attr, (char *) &dam[1]);
1261 1298
1262 dam->attr_len = htons (attr_len); 1299 dam->attr_len = htons (attr_len);
1263 if (NULL != h->mq) 1300 if (NULL != h->mq)
@@ -1376,12 +1413,12 @@ GNUNET_RECLAIM_get_attributes_stop (struct GNUNET_RECLAIM_AttributeIterator *it)
1376 1413
1377 1414
1378/** 1415/**
1379 * List all attestations for a local identity. 1416 * List all credentials for a local identity.
1380 * This MUST lock the `struct GNUNET_RECLAIM_Handle` 1417 * This MUST lock the `struct GNUNET_RECLAIM_Handle`
1381 * for any other calls than #GNUNET_RECLAIM_get_attestations_next() and 1418 * for any other calls than #GNUNET_RECLAIM_get_credentials_next() and
1382 * #GNUNET_RECLAIM_get_attestations_stop. @a proc will be called once 1419 * #GNUNET_RECLAIM_get_credentials_stop. @a proc will be called once
1383 * immediately, and then again after 1420 * immediately, and then again after
1384 * #GNUNET_RECLAIM_get_attestations_next() is invoked. 1421 * #GNUNET_RECLAIM_get_credentials_next() is invoked.
1385 * 1422 *
1386 * On error (disconnect), @a error_cb will be invoked. 1423 * On error (disconnect), @a error_cb will be invoked.
1387 * On normal completion, @a finish_cb proc will be 1424 * On normal completion, @a finish_cb proc will be
@@ -1392,31 +1429,31 @@ GNUNET_RECLAIM_get_attributes_stop (struct GNUNET_RECLAIM_AttributeIterator *it)
1392 * @param error_cb Function to call on error (i.e. disconnect), 1429 * @param error_cb Function to call on error (i.e. disconnect),
1393 * the handle is afterwards invalid 1430 * the handle is afterwards invalid
1394 * @param error_cb_cls Closure for @a error_cb 1431 * @param error_cb_cls Closure for @a error_cb
1395 * @param proc Function to call on each attestation 1432 * @param proc Function to call on each credential
1396 * @param proc_cls Closure for @a proc 1433 * @param proc_cls Closure for @a proc
1397 * @param finish_cb Function to call on completion 1434 * @param finish_cb Function to call on completion
1398 * the handle is afterwards invalid 1435 * the handle is afterwards invalid
1399 * @param finish_cb_cls Closure for @a finish_cb 1436 * @param finish_cb_cls Closure for @a finish_cb
1400 * @return an iterator Handle to use for iteration 1437 * @return an iterator Handle to use for iteration
1401 */ 1438 */
1402struct GNUNET_RECLAIM_AttestationIterator * 1439struct GNUNET_RECLAIM_CredentialIterator *
1403GNUNET_RECLAIM_get_attestations_start ( 1440GNUNET_RECLAIM_get_credentials_start (
1404 struct GNUNET_RECLAIM_Handle *h, 1441 struct GNUNET_RECLAIM_Handle *h,
1405 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, 1442 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
1406 GNUNET_SCHEDULER_TaskCallback error_cb, 1443 GNUNET_SCHEDULER_TaskCallback error_cb,
1407 void *error_cb_cls, 1444 void *error_cb_cls,
1408 GNUNET_RECLAIM_AttestationResult proc, 1445 GNUNET_RECLAIM_CredentialResult proc,
1409 void *proc_cls, 1446 void *proc_cls,
1410 GNUNET_SCHEDULER_TaskCallback finish_cb, 1447 GNUNET_SCHEDULER_TaskCallback finish_cb,
1411 void *finish_cb_cls) 1448 void *finish_cb_cls)
1412{ 1449{
1413 struct GNUNET_RECLAIM_AttestationIterator *ait; 1450 struct GNUNET_RECLAIM_CredentialIterator *ait;
1414 struct GNUNET_MQ_Envelope *env; 1451 struct GNUNET_MQ_Envelope *env;
1415 struct AttestationIterationStartMessage *msg; 1452 struct CredentialIterationStartMessage *msg;
1416 uint32_t rid; 1453 uint32_t rid;
1417 1454
1418 rid = h->r_id_gen++; 1455 rid = h->r_id_gen++;
1419 ait = GNUNET_new (struct GNUNET_RECLAIM_AttestationIterator); 1456 ait = GNUNET_new (struct GNUNET_RECLAIM_CredentialIterator);
1420 ait->h = h; 1457 ait->h = h;
1421 ait->error_cb = error_cb; 1458 ait->error_cb = error_cb;
1422 ait->error_cb_cls = error_cb_cls; 1459 ait->error_cb_cls = error_cb_cls;
@@ -1429,7 +1466,7 @@ GNUNET_RECLAIM_get_attestations_start (
1429 GNUNET_CONTAINER_DLL_insert_tail (h->ait_head, h->ait_tail, ait); 1466 GNUNET_CONTAINER_DLL_insert_tail (h->ait_head, h->ait_tail, ait);
1430 env = 1467 env =
1431 GNUNET_MQ_msg (msg, 1468 GNUNET_MQ_msg (msg,
1432 GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_ITERATION_START); 1469 GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_START);
1433 msg->id = htonl (rid); 1470 msg->id = htonl (rid);
1434 msg->identity = *identity; 1471 msg->identity = *identity;
1435 if (NULL == h->mq) 1472 if (NULL == h->mq)
@@ -1441,21 +1478,21 @@ GNUNET_RECLAIM_get_attestations_start (
1441 1478
1442 1479
1443/** 1480/**
1444 * Calls the record processor specified in #GNUNET_RECLAIM_get_attestation_start 1481 * Calls the record processor specified in #GNUNET_RECLAIM_get_credential_start
1445 * for the next record. 1482 * for the next record.
1446 * 1483 *
1447 * @param it the iterator 1484 * @param it the iterator
1448 */ 1485 */
1449void 1486void
1450GNUNET_RECLAIM_get_attestations_next (struct 1487GNUNET_RECLAIM_get_credentials_next (struct
1451 GNUNET_RECLAIM_AttestationIterator *ait) 1488 GNUNET_RECLAIM_CredentialIterator *ait)
1452{ 1489{
1453 struct GNUNET_RECLAIM_Handle *h = ait->h; 1490 struct GNUNET_RECLAIM_Handle *h = ait->h;
1454 struct AttestationIterationNextMessage *msg; 1491 struct CredentialIterationNextMessage *msg;
1455 struct GNUNET_MQ_Envelope *env; 1492 struct GNUNET_MQ_Envelope *env;
1456 1493
1457 env = 1494 env =
1458 GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_ITERATION_NEXT); 1495 GNUNET_MQ_msg (msg, GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_NEXT);
1459 msg->id = htonl (ait->r_id); 1496 msg->id = htonl (ait->r_id);
1460 GNUNET_MQ_send (h->mq, env); 1497 GNUNET_MQ_send (h->mq, env);
1461} 1498}
@@ -1469,18 +1506,18 @@ GNUNET_RECLAIM_get_attestations_next (struct
1469 * @param it the iterator 1506 * @param it the iterator
1470 */ 1507 */
1471void 1508void
1472GNUNET_RECLAIM_get_attestations_stop (struct 1509GNUNET_RECLAIM_get_credentials_stop (struct
1473 GNUNET_RECLAIM_AttestationIterator *ait) 1510 GNUNET_RECLAIM_CredentialIterator *ait)
1474{ 1511{
1475 struct GNUNET_RECLAIM_Handle *h = ait->h; 1512 struct GNUNET_RECLAIM_Handle *h = ait->h;
1476 struct GNUNET_MQ_Envelope *env; 1513 struct GNUNET_MQ_Envelope *env;
1477 struct AttestationIterationStopMessage *msg; 1514 struct CredentialIterationStopMessage *msg;
1478 1515
1479 if (NULL != h->mq) 1516 if (NULL != h->mq)
1480 { 1517 {
1481 env = 1518 env =
1482 GNUNET_MQ_msg (msg, 1519 GNUNET_MQ_msg (msg,
1483 GNUNET_MESSAGE_TYPE_RECLAIM_ATTESTATION_ITERATION_STOP); 1520 GNUNET_MESSAGE_TYPE_RECLAIM_CREDENTIAL_ITERATION_STOP);
1484 msg->id = htonl (ait->r_id); 1521 msg->id = htonl (ait->r_id);
1485 GNUNET_MQ_send (h->mq, env); 1522 GNUNET_MQ_send (h->mq, env);
1486 } 1523 }
@@ -1507,7 +1544,7 @@ GNUNET_RECLAIM_ticket_issue (
1507 const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, 1544 const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss,
1508 const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, 1545 const struct GNUNET_CRYPTO_EcdsaPublicKey *rp,
1509 const struct GNUNET_RECLAIM_AttributeList *attrs, 1546 const struct GNUNET_RECLAIM_AttributeList *attrs,
1510 GNUNET_RECLAIM_TicketCallback cb, 1547 GNUNET_RECLAIM_IssueTicketCallback cb,
1511 void *cb_cls) 1548 void *cb_cls)
1512{ 1549{
1513 struct GNUNET_RECLAIM_Operation *op; 1550 struct GNUNET_RECLAIM_Operation *op;
@@ -1517,7 +1554,7 @@ GNUNET_RECLAIM_ticket_issue (
1517 fprintf (stderr, "Issuing ticket\n"); 1554 fprintf (stderr, "Issuing ticket\n");
1518 op = GNUNET_new (struct GNUNET_RECLAIM_Operation); 1555 op = GNUNET_new (struct GNUNET_RECLAIM_Operation);
1519 op->h = h; 1556 op->h = h;
1520 op->tr_cb = cb; 1557 op->ti_cb = cb;
1521 op->cls = cb_cls; 1558 op->cls = cb_cls;
1522 op->r_id = h->r_id_gen++; 1559 op->r_id = h->r_id_gen++;
1523 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op); 1560 GNUNET_CONTAINER_DLL_insert_tail (h->op_head, h->op_tail, op);