aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-01-04 15:28:02 +0100
committerSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2018-01-04 15:29:45 +0100
commit78705d5a49d7066a01b832546d2507456a3c5d2c (patch)
treeb0e5f72bdde4574f20c0b89ee56295f83b954800 /src/include
parent272921672ec094644a1ddbbfacb96581e72ed443 (diff)
downloadgnunet-78705d5a49d7066a01b832546d2507456a3c5d2c.tar.gz
gnunet-78705d5a49d7066a01b832546d2507456a3c5d2c.zip
-cleanup doc; fixes
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_abe_lib.h74
-rw-r--r--src/include/gnunet_credential_service.h33
-rw-r--r--src/include/gnunet_identity_attribute_lib.h2
-rw-r--r--src/include/gnunet_identity_provider_service.h19
-rw-r--r--src/include/gnunet_rest_lib.h4
-rw-r--r--src/include/gnunet_rest_plugin.h2
6 files changed, 84 insertions, 50 deletions
diff --git a/src/include/gnunet_abe_lib.h b/src/include/gnunet_abe_lib.h
index 77b0f9e99..f73ea2431 100644
--- a/src/include/gnunet_abe_lib.h
+++ b/src/include/gnunet_abe_lib.h
@@ -19,8 +19,8 @@
19*/ 19*/
20 20
21/** 21/**
22 * @file include/gnunet_crypto_lib.h 22 * @file include/gnunet_abe_lib.h
23 * @brief cryptographic primitives for GNUnet 23 * @brief Attribute-Based Encryption primitives for GNUnet
24 * 24 *
25 * @author Martin Schanzenbach 25 * @author Martin Schanzenbach
26 * 26 *
@@ -57,10 +57,18 @@ struct GNUNET_CRYPTO_AbeKey;
57 * @ingroup abe 57 * @ingroup abe
58 * Create a new CP-ABE master key. Caller must free return value. 58 * Create a new CP-ABE master key. Caller must free return value.
59 * 59 *
60 * @return fresh private key; free using #GNUNET_free 60 * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_master_key
61 */ 61 */
62struct GNUNET_ABE_AbeMasterKey * 62struct GNUNET_ABE_AbeMasterKey *
63GNUNET_ABE_cpabe_create_master_key (void); 63GNUNET_ABE_cpabe_create_master_key (void);
64
65/**
66 * @ingroup abe
67 * Delete a CP-ABE master key.
68 *
69 * @param key the master key
70 * @return fresh private key; free using #GNUNET_free
71 */
64void 72void
65GNUNET_ABE_cpabe_delete_master_key (struct GNUNET_ABE_AbeMasterKey *key); 73GNUNET_ABE_cpabe_delete_master_key (struct GNUNET_ABE_AbeMasterKey *key);
66 74
@@ -68,11 +76,22 @@ GNUNET_ABE_cpabe_delete_master_key (struct GNUNET_ABE_AbeMasterKey *key);
68 * @ingroup abe 76 * @ingroup abe
69 * Create a new CP-ABE key. Caller must free return value. 77 * Create a new CP-ABE key. Caller must free return value.
70 * 78 *
71 * @return fresh private key; free using #GNUNET_free 79 * @param key the master key
80 * @param attrs the attributes to append to the key
81 * @return fresh private key; free using #GNUNET_ABE_cpabe_delete_key
72 */ 82 */
73struct GNUNET_ABE_AbeKey * 83struct GNUNET_ABE_AbeKey *
74GNUNET_ABE_cpabe_create_key (struct GNUNET_ABE_AbeMasterKey *msk, 84GNUNET_ABE_cpabe_create_key (struct GNUNET_ABE_AbeMasterKey *key,
75 char **attrs); 85 char **attrs);
86
87/**
88 * @ingroup abe
89 * Delete a CP-ABE key.
90 *
91 * @param key the key to delete
92 * @param delete_pub GNUNE_YES if the public key should also be freed (bug in gabe)
93 * @return fresh private key; free using #GNUNET_free
94 */
76void 95void
77GNUNET_ABE_cpabe_delete_key (struct GNUNET_ABE_AbeKey *key, 96GNUNET_ABE_cpabe_delete_key (struct GNUNET_ABE_AbeKey *key,
78 int delete_pub); 97 int delete_pub);
@@ -84,9 +103,9 @@ GNUNET_ABE_cpabe_delete_key (struct GNUNET_ABE_AbeKey *key,
84 * 103 *
85 * @param block the block to encrypt 104 * @param block the block to encrypt
86 * @param size the size of the @a block 105 * @param size the size of the @a block
87 * @param sessionkey the key used to encrypt 106 * @param policy the ABE policy
88 * @param iv the initialization vector to use, use INITVALUE 107 * @param key the key used to encrypt
89 * for streams. 108 * @param result the result buffer. Will be allocated. Free using #GNUNET_free
90 * @return the size of the encrypted block, -1 for errors 109 * @return the size of the encrypted block, -1 for errors
91 */ 110 */
92ssize_t 111ssize_t
@@ -98,13 +117,12 @@ GNUNET_ABE_cpabe_encrypt (const void *block,
98 117
99/** 118/**
100 * @ingroup abe 119 * @ingroup abe
101 * Encrypt a block using sessionkey. 120 * Decrypt a block using the ABE key.
102 * 121 *
103 * @param block the block to encrypt 122 * @param block the block to encrypt
104 * @param size the size of the @a block 123 * @param size the size of the @a block
105 * @param sessionkey the key used to encrypt 124 * @param key the key used to decrypt
106 * @param iv the initialization vector to use, use INITVALUE 125 * @param result the result buffer. Will be allocated. Free using #GNUNET_free
107 * for streams.
108 * @return the size of the encrypted block, -1 for errors 126 * @return the size of the encrypted block, -1 for errors
109 */ 127 */
110ssize_t 128ssize_t
@@ -113,18 +131,50 @@ GNUNET_ABE_cpabe_decrypt (const void *block,
113 const struct GNUNET_ABE_AbeKey *key, 131 const struct GNUNET_ABE_AbeKey *key,
114 void **result); 132 void **result);
115 133
134/**
135 * @ingroup abe
136 * Serialize an ABE key.
137 *
138 * @param key the key to serialize
139 * @param result the result buffer. Will be allocated. Free using #GNUNET_free
140 * @return the size of the encrypted block, -1 for errors
141 */
116ssize_t 142ssize_t
117GNUNET_ABE_cpabe_serialize_key (const struct GNUNET_ABE_AbeKey *key, 143GNUNET_ABE_cpabe_serialize_key (const struct GNUNET_ABE_AbeKey *key,
118 void **result); 144 void **result);
119 145
146/**
147 * @ingroup abe
148 * Deserialize a serialized ABE key.
149 *
150 * @param data the data to deserialize
151 * @param len the length of the data.
152 * @return the ABE key. NULL of unsuccessful
153 */
120struct GNUNET_ABE_AbeKey* 154struct GNUNET_ABE_AbeKey*
121GNUNET_ABE_cpabe_deserialize_key (const void *data, 155GNUNET_ABE_cpabe_deserialize_key (const void *data,
122 size_t len); 156 size_t len);
123 157
158/**
159 * @ingroup abe
160 * Serialize an ABE master key.
161 *
162 * @param key the key to serialize
163 * @param result the result buffer. Will be allocated. Free using #GNUNET_free
164 * @return the size of the encrypted block, -1 for errors
165 */
124ssize_t 166ssize_t
125GNUNET_ABE_cpabe_serialize_master_key (const struct GNUNET_ABE_AbeMasterKey *key, 167GNUNET_ABE_cpabe_serialize_master_key (const struct GNUNET_ABE_AbeMasterKey *key,
126 void **result); 168 void **result);
127 169
170/**
171 * @ingroup abe
172 * Deserialize an ABE master key.
173 *
174 * @param data the data to deserialize
175 * @param len the length of the data.
176 * @return the ABE key. NULL of unsuccessful
177 */
128struct GNUNET_ABE_AbeMasterKey* 178struct GNUNET_ABE_AbeMasterKey*
129GNUNET_ABE_cpabe_deserialize_master_key (const void *data, 179GNUNET_ABE_cpabe_deserialize_master_key (const void *data,
130 size_t len); 180 size_t len);
diff --git a/src/include/gnunet_credential_service.h b/src/include/gnunet_credential_service.h
index 67c2f2b4c..7d6f9e973 100644
--- a/src/include/gnunet_credential_service.h
+++ b/src/include/gnunet_credential_service.h
@@ -20,7 +20,6 @@
20 20
21/** 21/**
22 * @author Martin Schanzenbach 22 * @author Martin Schanzenbach
23 * @author Adnan Husain
24 * 23 *
25 * @file 24 * @file
26 * API to the Credential service 25 * API to the Credential service
@@ -274,7 +273,8 @@ typedef void (*GNUNET_CREDENTIAL_RemoveDelegateResultProcessor) (void *cls,
274 * @param issuer_key the issuer public key 273 * @param issuer_key the issuer public key
275 * @param issuer_attribute the issuer attribute 274 * @param issuer_attribute the issuer attribute
276 * @param subject_key the subject public key 275 * @param subject_key the subject public key
277 * @param subject_attribute the attribute claimed by the subject 276 * @param credential_count number of credentials
277 * @param credentials the subject credentials
278 * @param proc function to call on result 278 * @param proc function to call on result
279 * @param proc_cls closure for processor 279 * @param proc_cls closure for processor
280 * @return handle to the queued request 280 * @return handle to the queued request
@@ -305,6 +305,8 @@ GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle,
305 * @param attribute the name of the attribute to delegate 305 * @param attribute the name of the attribute to delegate
306 * @param subject the subject of the delegation 306 * @param subject the subject of the delegation
307 * @param delegated_attribute the name of the attribute that is delegated to 307 * @param delegated_attribute the name of the attribute that is delegated to
308 * @param proc the result callback
309 * @param proc_cls the result closure context
308 * @return handle to the queued request 310 * @return handle to the queued request
309 */ 311 */
310struct GNUNET_CREDENTIAL_Request * 312struct GNUNET_CREDENTIAL_Request *
@@ -322,6 +324,8 @@ GNUNET_CREDENTIAL_add_delegation (struct GNUNET_CREDENTIAL_Handle *handle,
322 * @param handle handle to the Credential service 324 * @param handle handle to the Credential service
323 * @param issuer the ego that was used to delegate the attribute 325 * @param issuer the ego that was used to delegate the attribute
324 * @param attribute the name of the attribute that is delegated 326 * @param attribute the name of the attribute that is delegated
327 * @param proc the callback
328 * @param proc_cls callback closure
325 * @return handle to the queued request 329 * @return handle to the queued request
326 */ 330 */
327struct GNUNET_CREDENTIAL_Request * 331struct GNUNET_CREDENTIAL_Request *
@@ -336,7 +340,6 @@ GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle,
336/** 340/**
337 * Issue an attribute to a subject 341 * Issue an attribute to a subject
338 * 342 *
339 * @param handle handle to the Credential service
340 * @param issuer the ego that should be used to issue the attribute 343 * @param issuer the ego that should be used to issue the attribute
341 * @param subject the subject of the attribute 344 * @param subject the subject of the attribute
342 * @param attribute the name of the attribute 345 * @param attribute the name of the attribute
@@ -344,32 +347,12 @@ GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle,
344 * @return handle to the queued request 347 * @return handle to the queued request
345 */ 348 */
346struct GNUNET_CREDENTIAL_Credential* 349struct GNUNET_CREDENTIAL_Credential*
347GNUNET_CREDENTIAL_credential_issue ( 350GNUNET_CREDENTIAL_credential_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
348 const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
349 struct GNUNET_CRYPTO_EcdsaPublicKey *subject, 351 struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
350 const char *attribute, 352 const char *attribute,
351 struct GNUNET_TIME_Absolute *expiration); 353 struct GNUNET_TIME_Absolute *expiration);
352 354
353 355
354/**
355 * Remove a credential
356 *
357 * @param handle handle to the Credential service
358 * @param issuer the identity that issued the credential
359 * @param subject the subject of the credential
360 * @param credential the name of the credential
361 * @return handle to the queued request
362 */
363/**
364 struct GNUNET_CREDENTIAL_IssueRequest *
365 GNUNET_CREDENTIAL_remove (struct GNUNET_CREDENTIAL_Handle *handle,
366 struct GNUNET_IDENTITY_Ego *issuer,
367 struct GNUNET_IDENTITY_Ego *subject,
368 const char *credential,
369 GNUNET_CREDENTIAL_IssueResultProcessor proc,
370 void *proc_cls);
371 */
372
373 356
374/** 357/**
375 * Cancel pending lookup request 358 * Cancel pending lookup request
@@ -377,7 +360,7 @@ GNUNET_CREDENTIAL_credential_issue (
377 * @param lr the lookup request to cancel 360 * @param lr the lookup request to cancel
378 */ 361 */
379void 362void
380GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *vr); 363GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *lr);
381 364
382 365
383#if 0 /* keep Emacsens' auto-indent happy */ 366#if 0 /* keep Emacsens' auto-indent happy */
diff --git a/src/include/gnunet_identity_attribute_lib.h b/src/include/gnunet_identity_attribute_lib.h
index a6c9e1f1c..316b0bf95 100644
--- a/src/include/gnunet_identity_attribute_lib.h
+++ b/src/include/gnunet_identity_attribute_lib.h
@@ -122,7 +122,7 @@ struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry
122/** 122/**
123 * Create a new attribute claim. 123 * Create a new attribute claim.
124 * 124 *
125 * @param name the attribute name 125 * @param attr_name the attribute name
126 * @param type the attribute type 126 * @param type the attribute type
127 * @param data the attribute value 127 * @param data the attribute value
128 * @param data_size the attribute value size 128 * @param data_size the attribute value size
diff --git a/src/include/gnunet_identity_provider_service.h b/src/include/gnunet_identity_provider_service.h
index 6bc05d0f4..be935e898 100644
--- a/src/include/gnunet_identity_provider_service.h
+++ b/src/include/gnunet_identity_provider_service.h
@@ -131,6 +131,7 @@ GNUNET_IDENTITY_PROVIDER_attribute_store (struct GNUNET_IDENTITY_PROVIDER_Handle
131 * Process an attribute that was stored in the idp. 131 * Process an attribute that was stored in the idp.
132 * 132 *
133 * @param cls closure 133 * @param cls closure
134 * @param identity the identity
134 * @param attr the attribute 135 * @param attr the attribute
135 */ 136 */
136typedef void 137typedef void
@@ -211,19 +212,19 @@ typedef void
211 212
212/** 213/**
213 * Issues a ticket to another identity. The identity may use 214 * Issues a ticket to another identity. The identity may use
214 * @GNUNET_IDENTITY_PROVIDER_authorization_ticket_consume to consume the ticket 215 * GNUNET_IDENTITY_PROVIDER_ticket_consume to consume the ticket
215 * and retrieve the attributes specified in the AttributeList. 216 * and retrieve the attributes specified in the AttributeList.
216 * 217 *
217 * @param id the identity provider to use 218 * @param h the identity provider to use
218 * @param iss the issuing identity 219 * @param iss the issuing identity
219 * @param rp the subject of the ticket (the relying party) 220 * @param rp the subject of the ticket (the relying party)
220 * @param attr the attributes that the relying party is given access to 221 * @param attrs the attributes that the relying party is given access to
221 * @param cb the callback 222 * @param cb the callback
222 * @param cb_cls the callback closure 223 * @param cb_cls the callback closure
223 * @return handle to abort the operation 224 * @return handle to abort the operation
224 */ 225 */
225struct GNUNET_IDENTITY_PROVIDER_Operation * 226struct GNUNET_IDENTITY_PROVIDER_Operation *
226GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *id, 227GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *h,
227 const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss, 228 const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss,
228 const struct GNUNET_CRYPTO_EcdsaPublicKey *rp, 229 const struct GNUNET_CRYPTO_EcdsaPublicKey *rp,
229 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs, 230 const struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attrs,
@@ -234,7 +235,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *i
234 * Revoked an issued ticket. The relying party will be unable to retrieve 235 * Revoked an issued ticket. The relying party will be unable to retrieve
235 * updated attributes. 236 * updated attributes.
236 * 237 *
237 * @param id the identity provider to use 238 * @param h the identity provider to use
238 * @param identity the issuing identity 239 * @param identity the issuing identity
239 * @param ticket the ticket to revoke 240 * @param ticket the ticket to revoke
240 * @param cb the callback 241 * @param cb the callback
@@ -242,7 +243,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_issue (struct GNUNET_IDENTITY_PROVIDER_Handle *i
242 * @return handle to abort the operation 243 * @return handle to abort the operation
243 */ 244 */
244struct GNUNET_IDENTITY_PROVIDER_Operation * 245struct GNUNET_IDENTITY_PROVIDER_Operation *
245GNUNET_IDENTITY_PROVIDER_ticket_revoke (struct GNUNET_IDENTITY_PROVIDER_Handle *id, 246GNUNET_IDENTITY_PROVIDER_ticket_revoke (struct GNUNET_IDENTITY_PROVIDER_Handle *h,
246 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, 247 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
247 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 248 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
248 GNUNET_IDENTITY_PROVIDER_ContinuationWithStatus cb, 249 GNUNET_IDENTITY_PROVIDER_ContinuationWithStatus cb,
@@ -254,7 +255,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_revoke (struct GNUNET_IDENTITY_PROVIDER_Handle *
254 * Consumes an issued ticket. The ticket is persisted 255 * Consumes an issued ticket. The ticket is persisted
255 * and used to retrieve identity information from the issuer 256 * and used to retrieve identity information from the issuer
256 * 257 *
257 * @param id the identity provider to use 258 * @param h the identity provider to use
258 * @param identity the identity that is the subject of the issued ticket (the audience) 259 * @param identity the identity that is the subject of the issued ticket (the audience)
259 * @param ticket the issued ticket to consume 260 * @param ticket the issued ticket to consume
260 * @param cb the callback to call 261 * @param cb the callback to call
@@ -262,7 +263,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_revoke (struct GNUNET_IDENTITY_PROVIDER_Handle *
262 * @return handle to abort the operation 263 * @return handle to abort the operation
263 */ 264 */
264struct GNUNET_IDENTITY_PROVIDER_Operation * 265struct GNUNET_IDENTITY_PROVIDER_Operation *
265GNUNET_IDENTITY_PROVIDER_ticket_consume (struct GNUNET_IDENTITY_PROVIDER_Handle *id, 266GNUNET_IDENTITY_PROVIDER_ticket_consume (struct GNUNET_IDENTITY_PROVIDER_Handle *h,
266 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity, 267 const struct GNUNET_CRYPTO_EcdsaPrivateKey *identity,
267 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket, 268 const struct GNUNET_IDENTITY_PROVIDER_Ticket *ticket,
268 GNUNET_IDENTITY_PROVIDER_AttributeResult cb, 269 GNUNET_IDENTITY_PROVIDER_AttributeResult cb,
@@ -299,7 +300,7 @@ GNUNET_IDENTITY_PROVIDER_ticket_iteration_start (struct GNUNET_IDENTITY_PROVIDER
299 * Lists all tickets that have been issued to remote 300 * Lists all tickets that have been issued to remote
300 * identites (relying parties) 301 * identites (relying parties)
301 * 302 *
302 * @param id the identity provider to use 303 * @param h the identity provider to use
303 * @param identity the issuing identity 304 * @param identity the issuing identity
304 * @param error_cb function to call on error (i.e. disconnect), 305 * @param error_cb function to call on error (i.e. disconnect),
305 * the handle is afterwards invalid 306 * the handle is afterwards invalid
diff --git a/src/include/gnunet_rest_lib.h b/src/include/gnunet_rest_lib.h
index a4dbb0696..e571eead3 100644
--- a/src/include/gnunet_rest_lib.h
+++ b/src/include/gnunet_rest_lib.h
@@ -89,7 +89,7 @@ typedef void (*GNUNET_REST_ResultProcessor) (void *cls,
89 * 89 *
90 * @param url URL to check 90 * @param url URL to check
91 * @param namespace namespace to check against 91 * @param namespace namespace to check against
92 * @retun GNUNET_YES if namespace matches 92 * @return GNUNET_YES if namespace matches
93 */ 93 */
94int 94int
95GNUNET_REST_namespace_match (const char *url, const char *namespace); 95GNUNET_REST_namespace_match (const char *url, const char *namespace);
@@ -98,7 +98,7 @@ GNUNET_REST_namespace_match (const char *url, const char *namespace);
98 * Create REST MHD response 98 * Create REST MHD response
99 * 99 *
100 * @param data result 100 * @param data result
101 * @retun MHD response 101 * @return MHD response
102 */ 102 */
103 struct MHD_Response* 103 struct MHD_Response*
104GNUNET_REST_create_response (const char *data); 104GNUNET_REST_create_response (const char *data);
diff --git a/src/include/gnunet_rest_plugin.h b/src/include/gnunet_rest_plugin.h
index ecd5f66f1..424dbb1fc 100644
--- a/src/include/gnunet_rest_plugin.h
+++ b/src/include/gnunet_rest_plugin.h
@@ -57,7 +57,7 @@ struct GNUNET_REST_Plugin
57 57
58 /** 58 /**
59 * Plugin name. Used as the namespace for the API. 59 * Plugin name. Used as the namespace for the API.
60 * e.g. http://hostname:port/<name> 60 * e.g. http://hostname:port/name
61 */ 61 */
62 char *name; 62 char *name;
63 63