aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_abd_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-10-31 13:03:48 +0100
committerChristian Grothoff <christian@grothoff.org>2019-10-31 13:03:48 +0100
commit7e3cf5f461eb4fbb7581672bf0835da07c378136 (patch)
treebdc3874b7894242b095b892f1ed3e81a4d4f06c0 /src/include/gnunet_abd_service.h
parent01b480d6d026e0c537dc284a7e7df2c0320a3528 (diff)
downloadgnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.tar.gz
gnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.zip
tighten formatting rules
Diffstat (limited to 'src/include/gnunet_abd_service.h')
-rw-r--r--src/include/gnunet_abd_service.h125
1 files changed, 68 insertions, 57 deletions
diff --git a/src/include/gnunet_abd_service.h b/src/include/gnunet_abd_service.h
index b50ff8b86..afec880f1 100644
--- a/src/include/gnunet_abd_service.h
+++ b/src/include/gnunet_abd_service.h
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
@@ -58,15 +58,16 @@ struct GNUNET_ABD_Request;
58/* 58/*
59* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject 59* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject
60*/ 60*/
61enum GNUNET_ABD_CredentialFlags { 61enum GNUNET_ABD_CredentialFlags
62{
62 63
63 //Subject had credentials before, but have been revoked now 64 // Subject had credentials before, but have been revoked now
64 GNUNET_ABD_FLAG_REVOKED=0, 65 GNUNET_ABD_FLAG_REVOKED=0,
65 66
66 //Subject flag indicates that the subject is a holder of this credential and may present it as such 67 // Subject flag indicates that the subject is a holder of this credential and may present it as such
67 GNUNET_ABD_FLAG_SUBJECT=1, 68 GNUNET_ABD_FLAG_SUBJECT=1,
68 69
69 //Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance 70 // Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance
70 GNUNET_ABD_FLAG_ISSUER=2 71 GNUNET_ABD_FLAG_ISSUER=2
71 72
72}; 73};
@@ -75,7 +76,8 @@ GNUNET_NETWORK_STRUCT_BEGIN
75/** 76/**
76 * The attribute delegation record 77 * The attribute delegation record
77 */ 78 */
78struct GNUNET_ABD_DelegationRecord { 79struct GNUNET_ABD_DelegationRecord
80{
79 81
80 /** 82 /**
81 * Number of delegation sets in this record 83 * Number of delegation sets in this record
@@ -95,7 +97,8 @@ struct GNUNET_ABD_DelegationRecord {
95/** 97/**
96 * The attribute delegation record 98 * The attribute delegation record
97 */ 99 */
98struct GNUNET_ABD_DelegationRecordSet { 100struct GNUNET_ABD_DelegationRecordSet
101{
99 102
100 /** 103 /**
101 * Public key of the subject this attribute was delegated to 104 * Public key of the subject this attribute was delegated to
@@ -114,7 +117,8 @@ GNUNET_NETWORK_STRUCT_END
114/** 117/**
115 * The attribute delegation record 118 * The attribute delegation record
116 */ 119 */
117struct GNUNET_ABD_DelegationSet { 120struct GNUNET_ABD_DelegationSet
121{
118 122
119 /** 123 /**
120 * Public key of the subject this attribute was delegated to 124 * Public key of the subject this attribute was delegated to
@@ -133,7 +137,8 @@ struct GNUNET_ABD_DelegationSet {
133/** 137/**
134 * A delegation 138 * A delegation
135 */ 139 */
136struct GNUNET_ABD_Delegation { 140struct GNUNET_ABD_Delegation
141{
137 142
138 /** 143 /**
139 * The issuer of the delegation 144 * The issuer of the delegation
@@ -170,7 +175,8 @@ struct GNUNET_ABD_Delegation {
170/** 175/**
171 * A delegate 176 * A delegate
172 */ 177 */
173struct GNUNET_ABD_Delegate { 178struct GNUNET_ABD_Delegate
179{
174 180
175 /** 181 /**
176 * The issuer of the credential 182 * The issuer of the credential
@@ -217,12 +223,13 @@ struct GNUNET_ABD_Delegate {
217/* 223/*
218* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject 224* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject
219*/ 225*/
220enum GNUNET_ABD_AlgoDirectionFlags { 226enum GNUNET_ABD_AlgoDirectionFlags
227{
221 228
222 //Subject had credentials before, but have been revoked now 229 // Subject had credentials before, but have been revoked now
223 GNUNET_ABD_FLAG_FORWARD=1 << 0, 230 GNUNET_ABD_FLAG_FORWARD=1 << 0,
224 231
225 //Subject flag indicates that the subject is a holder of this credential and may present it as such 232 // Subject flag indicates that the subject is a holder of this credential and may present it as such
226 GNUNET_ABD_FLAG_BACKWARD=1 << 1 233 GNUNET_ABD_FLAG_BACKWARD=1 << 1
227 234
228}; 235};
@@ -256,14 +263,19 @@ GNUNET_ABD_disconnect (struct GNUNET_ABD_Handle *handle);
256 * @param delegate the delegates 263 * @param delegate the delegates
257 */ 264 */
258typedef void (*GNUNET_ABD_CredentialResultProcessor) (void *cls, 265typedef void (*GNUNET_ABD_CredentialResultProcessor) (void *cls,
259 unsigned int d_count, 266 unsigned int d_count,
260 struct GNUNET_ABD_Delegation *delegation_chain, 267 struct
261 unsigned int c_count, 268 GNUNET_ABD_Delegation *
262 struct GNUNET_ABD_Delegate *delegte); 269 delegation_chain,
263 270 unsigned int c_count,
271 struct GNUNET_ABD_Delegate
272 *delegte);
273
264typedef void (*GNUNET_ABD_IntermediateResultProcessor) (void *cls, 274typedef void (*GNUNET_ABD_IntermediateResultProcessor) (void *cls,
265 struct GNUNET_ABD_Delegation *delegation, 275 struct
266 bool is_bw); 276 GNUNET_ABD_Delegation *
277 delegation,
278 bool is_bw);
267 279
268/** 280/**
269 * Iterator called on obtained result for an attribute delegation. 281 * Iterator called on obtained result for an attribute delegation.
@@ -273,7 +285,7 @@ typedef void (*GNUNET_ABD_IntermediateResultProcessor) (void *cls,
273 * @param result the record data that can be handed to the subject 285 * @param result the record data that can be handed to the subject
274 */ 286 */
275typedef void (*GNUNET_ABD_DelegateResultProcessor) (void *cls, 287typedef void (*GNUNET_ABD_DelegateResultProcessor) (void *cls,
276 uint32_t success); 288 uint32_t success);
277 289
278/** 290/**
279 * Iterator called on obtained result for an attribute delegation removal. 291 * Iterator called on obtained result for an attribute delegation removal.
@@ -283,7 +295,7 @@ typedef void (*GNUNET_ABD_DelegateResultProcessor) (void *cls,
283 * @param result the record data that can be handed to the subject 295 * @param result the record data that can be handed to the subject
284 */ 296 */
285typedef void (*GNUNET_ABD_RemoveDelegateResultProcessor) (void *cls, 297typedef void (*GNUNET_ABD_RemoveDelegateResultProcessor) (void *cls,
286 uint32_t success); 298 uint32_t success);
287 299
288 300
289/** 301/**
@@ -305,28 +317,28 @@ typedef void (*GNUNET_ABD_RemoveDelegateResultProcessor) (void *cls,
305 * @return handle to the queued request 317 * @return handle to the queued request
306 */ 318 */
307struct GNUNET_ABD_Request* 319struct GNUNET_ABD_Request*
308GNUNET_ABD_verify (struct GNUNET_ABD_Handle *handle, 320 GNUNET_ABD_verify (struct GNUNET_ABD_Handle *handle,
309 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, 321 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
310 const char *issuer_attribute, 322 const char *issuer_attribute,
311 const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key, 323 const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key,
312 uint32_t delegate_count, 324 uint32_t delegate_count,
313 const struct GNUNET_ABD_Delegate *delegates, 325 const struct GNUNET_ABD_Delegate *delegates,
314 enum GNUNET_ABD_AlgoDirectionFlags direction, 326 enum GNUNET_ABD_AlgoDirectionFlags direction,
315 GNUNET_ABD_CredentialResultProcessor proc, 327 GNUNET_ABD_CredentialResultProcessor proc,
316 void *proc_cls, 328 void *proc_cls,
317 GNUNET_ABD_IntermediateResultProcessor, 329 GNUNET_ABD_IntermediateResultProcessor,
318 void *proc2_cls); 330 void *proc2_cls);
319 331
320struct GNUNET_ABD_Request* 332struct GNUNET_ABD_Request*
321GNUNET_ABD_collect (struct GNUNET_ABD_Handle *handle, 333 GNUNET_ABD_collect (struct GNUNET_ABD_Handle *handle,
322 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, 334 const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
323 const char *issuer_attribute, 335 const char *issuer_attribute,
324 const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key, 336 const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key,
325 enum GNUNET_ABD_AlgoDirectionFlags direction, 337 enum GNUNET_ABD_AlgoDirectionFlags direction,
326 GNUNET_ABD_CredentialResultProcessor proc, 338 GNUNET_ABD_CredentialResultProcessor proc,
327 void *proc_cls, 339 void *proc_cls,
328 GNUNET_ABD_IntermediateResultProcessor, 340 GNUNET_ABD_IntermediateResultProcessor,
329 void *proc2_cls); 341 void *proc2_cls);
330 342
331/** 343/**
332 * Delegate an attribute 344 * Delegate an attribute
@@ -342,12 +354,12 @@ GNUNET_ABD_collect (struct GNUNET_ABD_Handle *handle,
342 */ 354 */
343struct GNUNET_ABD_Request * 355struct GNUNET_ABD_Request *
344GNUNET_ABD_add_delegation (struct GNUNET_ABD_Handle *handle, 356GNUNET_ABD_add_delegation (struct GNUNET_ABD_Handle *handle,
345 struct GNUNET_IDENTITY_Ego *issuer, 357 struct GNUNET_IDENTITY_Ego *issuer,
346 const char *attribute, 358 const char *attribute,
347 struct GNUNET_CRYPTO_EcdsaPublicKey *subject, 359 struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
348 const char *delegated_attribute, 360 const char *delegated_attribute,
349 GNUNET_ABD_DelegateResultProcessor proc, 361 GNUNET_ABD_DelegateResultProcessor proc,
350 void *proc_cls); 362 void *proc_cls);
351 363
352/** 364/**
353 * Remove a delegation 365 * Remove a delegation
@@ -361,11 +373,10 @@ GNUNET_ABD_add_delegation (struct GNUNET_ABD_Handle *handle,
361 */ 373 */
362struct GNUNET_ABD_Request * 374struct GNUNET_ABD_Request *
363GNUNET_ABD_remove_delegation (struct GNUNET_ABD_Handle *handle, 375GNUNET_ABD_remove_delegation (struct GNUNET_ABD_Handle *handle,
364 struct GNUNET_IDENTITY_Ego *issuer, 376 struct GNUNET_IDENTITY_Ego *issuer,
365 const char *attribute, 377 const char *attribute,
366 GNUNET_ABD_RemoveDelegateResultProcessor proc, 378 GNUNET_ABD_RemoveDelegateResultProcessor proc,
367 void *proc_cls); 379 void *proc_cls);
368
369 380
370 381
371/** 382/**
@@ -379,10 +390,10 @@ GNUNET_ABD_remove_delegation (struct GNUNET_ABD_Handle *handle,
379 */ 390 */
380struct GNUNET_ABD_Delegate* 391struct GNUNET_ABD_Delegate*
381GNUNET_ABD_delegate_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer, 392GNUNET_ABD_delegate_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
382 struct GNUNET_CRYPTO_EcdsaPublicKey *subject, 393 struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
383 const char *iss_attr, 394 const char *iss_attr,
384 const char *sub_attr, 395 const char *sub_attr,
385 struct GNUNET_TIME_Absolute *expiration); 396 struct GNUNET_TIME_Absolute *expiration);
386 397
387 398
388/** 399/**