diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2016-11-20 17:49:04 +0100 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2016-11-20 17:49:04 +0100 |
commit | fad73f2435336733ae585c7a018df860bec3bdf1 (patch) | |
tree | 912becfd30ae7d6a4d1fcc53095eef5205daf5ec /src/credential/credential_api.c | |
parent | 18f106166cf64cc72206cd35301276aa21ca100a (diff) | |
download | gnunet-fad73f2435336733ae585c7a018df860bec3bdf1.tar.gz gnunet-fad73f2435336733ae585c7a018df860bec3bdf1.zip |
- add missing API; no impl
Diffstat (limited to 'src/credential/credential_api.c')
-rw-r--r-- | src/credential/credential_api.c | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/src/credential/credential_api.c b/src/credential/credential_api.c index 4864d54d0..8ff66c574 100644 --- a/src/credential/credential_api.c +++ b/src/credential/credential_api.c | |||
@@ -38,18 +38,18 @@ | |||
38 | /** | 38 | /** |
39 | * Handle to a verify request | 39 | * Handle to a verify request |
40 | */ | 40 | */ |
41 | struct GNUNET_CREDENTIAL_VerifyRequest | 41 | struct GNUNET_CREDENTIAL_Request |
42 | { | 42 | { |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * DLL | 45 | * DLL |
46 | */ | 46 | */ |
47 | struct GNUNET_CREDENTIAL_VerifyRequest *next; | 47 | struct GNUNET_CREDENTIAL_Request *next; |
48 | 48 | ||
49 | /** | 49 | /** |
50 | * DLL | 50 | * DLL |
51 | */ | 51 | */ |
52 | struct GNUNET_CREDENTIAL_VerifyRequest *prev; | 52 | struct GNUNET_CREDENTIAL_Request *prev; |
53 | 53 | ||
54 | /** | 54 | /** |
55 | * handle to credential service | 55 | * handle to credential service |
@@ -98,12 +98,12 @@ struct GNUNET_CREDENTIAL_Handle | |||
98 | /** | 98 | /** |
99 | * Head of linked list of active verify requests. | 99 | * Head of linked list of active verify requests. |
100 | */ | 100 | */ |
101 | struct GNUNET_CREDENTIAL_VerifyRequest *verify_head; | 101 | struct GNUNET_CREDENTIAL_Request *verify_head; |
102 | 102 | ||
103 | /** | 103 | /** |
104 | * Tail of linked list of active verify requests. | 104 | * Tail of linked list of active verify requests. |
105 | */ | 105 | */ |
106 | struct GNUNET_CREDENTIAL_VerifyRequest *verify_tail; | 106 | struct GNUNET_CREDENTIAL_Request *verify_tail; |
107 | 107 | ||
108 | /** | 108 | /** |
109 | * Reconnect task | 109 | * Reconnect task |
@@ -210,16 +210,13 @@ handle_result (void *cls, | |||
210 | const struct VerifyResultMessage *vr_msg) | 210 | const struct VerifyResultMessage *vr_msg) |
211 | { | 211 | { |
212 | struct GNUNET_CREDENTIAL_Handle *handle = cls; | 212 | struct GNUNET_CREDENTIAL_Handle *handle = cls; |
213 | uint32_t ad_count = ntohl (vr_msg->ad_count); | ||
214 | struct GNUNET_CREDENTIAL_RecordData ad[ad_count]; | ||
215 | uint32_t r_id = ntohl (vr_msg->id); | 213 | uint32_t r_id = ntohl (vr_msg->id); |
216 | struct GNUNET_CREDENTIAL_VerifyRequest *vr; | 214 | struct GNUNET_CREDENTIAL_Request *vr; |
217 | GNUNET_CREDENTIAL_VerifyResultProcessor proc; | 215 | GNUNET_CREDENTIAL_VerifyResultProcessor proc; |
218 | void *proc_cls; | 216 | void *proc_cls; |
219 | 217 | ||
220 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 218 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
221 | "Received verify reply from CREDENTIAL service (%u credentials)\n", | 219 | "Received verify reply from CREDENTIAL service\n"); |
222 | (unsigned int) ad_count); | ||
223 | for (vr = handle->verify_head; NULL != vr; vr = vr->next) | 220 | for (vr = handle->verify_head; NULL != vr; vr = vr->next) |
224 | if (vr->r_id == r_id) | 221 | if (vr->r_id == r_id) |
225 | break; | 222 | break; |
@@ -240,8 +237,7 @@ handle_result (void *cls, | |||
240 | */ | 237 | */ |
241 | proc (proc_cls, | 238 | proc (proc_cls, |
242 | NULL, | 239 | NULL, |
243 | ad_count, | 240 | GNUNET_NO); // TODO |
244 | ad); // TODO | ||
245 | } | 241 | } |
246 | 242 | ||
247 | 243 | ||
@@ -260,7 +256,7 @@ reconnect (struct GNUNET_CREDENTIAL_Handle *handle) | |||
260 | NULL), | 256 | NULL), |
261 | GNUNET_MQ_handler_end () | 257 | GNUNET_MQ_handler_end () |
262 | }; | 258 | }; |
263 | struct GNUNET_CREDENTIAL_VerifyRequest *vr; | 259 | struct GNUNET_CREDENTIAL_Request *vr; |
264 | 260 | ||
265 | GNUNET_assert (NULL == handle->mq); | 261 | GNUNET_assert (NULL == handle->mq); |
266 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 262 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -330,7 +326,7 @@ GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle) | |||
330 | * @param lr the verify request to cancel | 326 | * @param lr the verify request to cancel |
331 | */ | 327 | */ |
332 | void | 328 | void |
333 | GNUNET_CREDENTIAL_verify_cancel (struct GNUNET_CREDENTIAL_VerifyRequest *vr) | 329 | GNUNET_CREDENTIAL_verify_cancel (struct GNUNET_CREDENTIAL_Request *vr) |
334 | { | 330 | { |
335 | struct GNUNET_CREDENTIAL_Handle *handle = vr->credential_handle; | 331 | struct GNUNET_CREDENTIAL_Handle *handle = vr->credential_handle; |
336 | 332 | ||
@@ -341,30 +337,35 @@ GNUNET_CREDENTIAL_verify_cancel (struct GNUNET_CREDENTIAL_VerifyRequest *vr) | |||
341 | GNUNET_free (vr); | 337 | GNUNET_free (vr); |
342 | } | 338 | } |
343 | 339 | ||
344 | |||
345 | /** | 340 | /** |
346 | * Perform an asynchronous verify operation for a credential. | 341 | * Performs attribute verification. |
342 | * Checks if there is a delegation chain from | ||
343 | * attribute ``issuer_attribute'' issued by the issuer | ||
344 | * with public key ``issuer_key'' maps to the attribute | ||
345 | * ``subject_attribute'' claimed by the subject with key | ||
346 | * ``subject_key'' | ||
347 | * | 347 | * |
348 | * @param handle handle to the Credential service | 348 | * @param handle handle to the Credential service |
349 | * @param credential the credential to look up | 349 | * @param issuer_key the issuer public key |
350 | * @param subject Ego to check the credential for | 350 | * @param issuer_attribute the issuer attribute |
351 | * @param subject_key the subject public key | ||
352 | * @param subject_attribute the attribute claimed by the subject | ||
351 | * @param proc function to call on result | 353 | * @param proc function to call on result |
352 | * @param proc_cls closure for processor | 354 | * @param proc_cls closure for processor |
353 | * @return handle to the queued request | 355 | * @return handle to the queued request |
354 | */ | 356 | */ |
355 | struct GNUNET_CREDENTIAL_VerifyRequest* | 357 | struct GNUNET_CREDENTIAL_Request* |
356 | GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle, | 358 | GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle, |
359 | const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, | ||
357 | const char *issuer_attribute, | 360 | const char *issuer_attribute, |
358 | const char *subject_attribute, | ||
359 | const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key, | 361 | const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key, |
360 | const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, | 362 | const char *subject_attribute, |
361 | uint32_t credential_flags, | ||
362 | GNUNET_CREDENTIAL_VerifyResultProcessor proc, | 363 | GNUNET_CREDENTIAL_VerifyResultProcessor proc, |
363 | void *proc_cls) | 364 | void *proc_cls) |
364 | { | 365 | { |
365 | /* IPC to shorten credential names, return shorten_handle */ | 366 | /* IPC to shorten credential names, return shorten_handle */ |
366 | struct VerifyMessage *v_msg; | 367 | struct VerifyMessage *v_msg; |
367 | struct GNUNET_CREDENTIAL_VerifyRequest *vr; | 368 | struct GNUNET_CREDENTIAL_Request *vr; |
368 | size_t nlen; | 369 | size_t nlen; |
369 | 370 | ||
370 | if (NULL == issuer_attribute) | 371 | if (NULL == issuer_attribute) |
@@ -382,7 +383,7 @@ GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle, | |||
382 | GNUNET_break (0); | 383 | GNUNET_break (0); |
383 | return NULL; | 384 | return NULL; |
384 | } | 385 | } |
385 | vr = GNUNET_new (struct GNUNET_CREDENTIAL_VerifyRequest); | 386 | vr = GNUNET_new (struct GNUNET_CREDENTIAL_Request); |
386 | vr->credential_handle = handle; | 387 | vr->credential_handle = handle; |
387 | vr->verify_proc = proc; | 388 | vr->verify_proc = proc; |
388 | vr->proc_cls = proc_cls; | 389 | vr->proc_cls = proc_cls; |