diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_gnsrecord_lib.h | 7 | ||||
-rw-r--r-- | src/include/gnunet_reclaim_lib.h | 13 | ||||
-rw-r--r-- | src/include/gnunet_reclaim_plugin.h | 10 | ||||
-rw-r--r-- | src/include/gnunet_reclaim_service.h | 18 |
4 files changed, 40 insertions, 8 deletions
diff --git a/src/include/gnunet_gnsrecord_lib.h b/src/include/gnunet_gnsrecord_lib.h index c976c89c5..960203fb1 100644 --- a/src/include/gnunet_gnsrecord_lib.h +++ b/src/include/gnunet_gnsrecord_lib.h | |||
@@ -143,12 +143,13 @@ extern "C" { | |||
143 | /** | 143 | /** |
144 | * Record type for an attribute attestation | 144 | * Record type for an attribute attestation |
145 | */ | 145 | */ |
146 | #define GNUNET_GNSRECORD_TYPE_RECLAIM_ATTESTATION 65554 | 146 | #define GNUNET_GNSRECORD_TYPE_RECLAIM_CREDENTIAL 65554 |
147 | 147 | ||
148 | /** | 148 | /** |
149 | * Record type for an attestation reference in a ticket | 149 | * Record type for a presentation of a credential (used |
150 | * in a ticket record set) | ||
150 | */ | 151 | */ |
151 | #define GNUNET_GNSRECORD_TYPE_RECLAIM_ATTESTATION_REF 65555 | 152 | #define GNUNET_GNSRECORD_TYPE_RECLAIM_PRESENTATION 65555 |
152 | 153 | ||
153 | 154 | ||
154 | /** | 155 | /** |
diff --git a/src/include/gnunet_reclaim_lib.h b/src/include/gnunet_reclaim_lib.h index f5c3d3864..bbf1c3ad3 100644 --- a/src/include/gnunet_reclaim_lib.h +++ b/src/include/gnunet_reclaim_lib.h | |||
@@ -780,6 +780,11 @@ GNUNET_RECLAIM_presentation_value_to_string (uint32_t type, | |||
780 | const void *data, | 780 | const void *data, |
781 | size_t data_size); | 781 | size_t data_size); |
782 | 782 | ||
783 | struct GNUNET_RECLAIM_Presentation * | ||
784 | GNUNET_RECLAIM_presentation_new (uint32_t type, | ||
785 | const void *data, | ||
786 | size_t data_size); | ||
787 | |||
783 | /** | 788 | /** |
784 | * Convert human-readable version of a 'claim' of a presentation to the binary | 789 | * Convert human-readable version of a 'claim' of a presentation to the binary |
785 | * representation | 790 | * representation |
@@ -828,14 +833,16 @@ GNUNET_RECLAIM_presentation_get_expiration (const struct | |||
828 | * | 833 | * |
829 | * @param cred the credential to use | 834 | * @param cred the credential to use |
830 | * @param attrs the attributes to present from the credential | 835 | * @param attrs the attributes to present from the credential |
831 | * @return the credential presentation presenting the attributes according | 836 | * @param presentation the credential presentation presenting the attributes according |
832 | * to the presentation mechanism of the credential | 837 | * to the presentation mechanism of the credential |
833 | * or NULL on error. | 838 | * or NULL on error. |
839 | * @return GNUNET_OK on success. | ||
834 | */ | 840 | */ |
835 | struct GNUNET_RECLAIM_Presentation* | 841 | int |
836 | GNUNET_RECLAIM_credential_get_presentation ( | 842 | GNUNET_RECLAIM_credential_get_presentation ( |
837 | const struct GNUNET_RECLAIM_Credential *cred, | 843 | const struct GNUNET_RECLAIM_Credential *cred, |
838 | const struct GNUNET_RECLAIM_AttributeList *attrs); | 844 | const struct GNUNET_RECLAIM_AttributeList *attrs, |
845 | struct GNUNET_RECLAIM_Presentation **presentation); | ||
839 | 846 | ||
840 | 847 | ||
841 | #if 0 /* keep Emacsens' auto-indent happy */ | 848 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_reclaim_plugin.h b/src/include/gnunet_reclaim_plugin.h index af6c74e0b..2ba8fc8a0 100644 --- a/src/include/gnunet_reclaim_plugin.h +++ b/src/include/gnunet_reclaim_plugin.h | |||
@@ -301,6 +301,11 @@ typedef int (*GNUNET_RECLAIM_PresentationGetExpirationFunction) ( | |||
301 | const struct GNUNET_RECLAIM_Presentation *cred, | 301 | const struct GNUNET_RECLAIM_Presentation *cred, |
302 | struct GNUNET_TIME_Absolute *expiration); | 302 | struct GNUNET_TIME_Absolute *expiration); |
303 | 303 | ||
304 | typedef int (*GNUNET_RECLAIM_CredentialToPresentation) ( | ||
305 | void *cls, | ||
306 | const struct GNUNET_RECLAIM_Credential *cred, | ||
307 | const struct GNUNET_RECLAIM_AttributeList *attrs, | ||
308 | struct GNUNET_RECLAIM_Presentation **presentation); | ||
304 | 309 | ||
305 | /** | 310 | /** |
306 | * Each plugin is required to return a pointer to a struct of this | 311 | * Each plugin is required to return a pointer to a struct of this |
@@ -416,6 +421,11 @@ struct GNUNET_RECLAIM_CredentialPluginFunctions | |||
416 | */ | 421 | */ |
417 | GNUNET_RECLAIM_PresentationGetExpirationFunction get_expiration_p; | 422 | GNUNET_RECLAIM_PresentationGetExpirationFunction get_expiration_p; |
418 | 423 | ||
424 | /** | ||
425 | * Get presentation | ||
426 | */ | ||
427 | GNUNET_RECLAIM_CredentialToPresentation create_presentation; | ||
428 | |||
419 | }; | 429 | }; |
420 | 430 | ||
421 | 431 | ||
diff --git a/src/include/gnunet_reclaim_service.h b/src/include/gnunet_reclaim_service.h index 8387c79b0..368058f56 100644 --- a/src/include/gnunet_reclaim_service.h +++ b/src/include/gnunet_reclaim_service.h | |||
@@ -92,7 +92,21 @@ struct GNUNET_RECLAIM_Ticket | |||
92 | * @param ticket the ticket | 92 | * @param ticket the ticket |
93 | */ | 93 | */ |
94 | typedef void (*GNUNET_RECLAIM_TicketCallback) ( | 94 | typedef void (*GNUNET_RECLAIM_TicketCallback) ( |
95 | void *cls, const struct GNUNET_RECLAIM_Ticket *ticket); | 95 | void *cls, |
96 | const struct GNUNET_RECLAIM_Ticket *ticket); | ||
97 | |||
98 | /** | ||
99 | * Method called when a token has been issued. | ||
100 | * On success returns a ticket that can be given to a relying party | ||
101 | * in order for it retrive identity attributes | ||
102 | * | ||
103 | * @param cls closure | ||
104 | * @param ticket the ticket | ||
105 | */ | ||
106 | typedef void (*GNUNET_RECLAIM_IssueTicketCallback) ( | ||
107 | void *cls, | ||
108 | const struct GNUNET_RECLAIM_Ticket *ticket, | ||
109 | const struct GNUNET_RECLAIM_PresentationList *presentations); | ||
96 | 110 | ||
97 | 111 | ||
98 | /** | 112 | /** |
@@ -369,7 +383,7 @@ GNUNET_RECLAIM_ticket_issue ( | |||
369 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, | 383 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, |
370 | const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, | 384 | const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, |
371 | const struct GNUNET_RECLAIM_AttributeList *attrs, | 385 | const struct GNUNET_RECLAIM_AttributeList *attrs, |
372 | GNUNET_RECLAIM_TicketCallback cb, void *cb_cls); | 386 | GNUNET_RECLAIM_IssueTicketCallback cb, void *cb_cls); |
373 | 387 | ||
374 | 388 | ||
375 | /** | 389 | /** |