diff options
author | Andreas Ebner <pansy007@googlemail.com> | 2019-08-04 13:52:03 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2019-10-07 12:16:50 +0200 |
commit | 15b0d71a635f02f5e0291a695d35a65698fdea05 (patch) | |
tree | 5afc234a0ce848019d1098f3852fde06f14dcd98 /src/credential/credential_api.c | |
parent | 93cd93a1330fb38add615f797ac9a87fc252ff98 (diff) | |
download | gnunet-15b0d71a635f02f5e0291a695d35a65698fdea05.tar.gz gnunet-15b0d71a635f02f5e0291a695d35a65698fdea05.zip |
Clean up and renaming
- renamed a lot of variables/functions that no longer serve credential but delegate
- correct printouts likewise
- cleaned up test_credential_own.sh to use credential service issuer side storage
- removed credential related parameters from VerifyRequestHandle struct
Diffstat (limited to 'src/credential/credential_api.c')
-rw-r--r-- | src/credential/credential_api.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/src/credential/credential_api.c b/src/credential/credential_api.c index 7323d3b1c..4fe32465a 100644 --- a/src/credential/credential_api.c +++ b/src/credential/credential_api.c | |||
@@ -217,8 +217,7 @@ handle_result (void *cls, | |||
217 | uint32_t d_count = ntohl (vr_msg->d_count); | 217 | uint32_t d_count = ntohl (vr_msg->d_count); |
218 | uint32_t c_count = ntohl (vr_msg->c_count); | 218 | uint32_t c_count = ntohl (vr_msg->c_count); |
219 | struct GNUNET_CREDENTIAL_Delegation d_chain[d_count]; | 219 | struct GNUNET_CREDENTIAL_Delegation d_chain[d_count]; |
220 | //TODO rename creds | 220 | struct GNUNET_CREDENTIAL_Delegate dels[c_count]; |
221 | struct GNUNET_CREDENTIAL_Delegate creds[c_count]; | ||
222 | GNUNET_CREDENTIAL_CredentialResultProcessor proc; | 221 | GNUNET_CREDENTIAL_CredentialResultProcessor proc; |
223 | void *proc_cls; | 222 | void *proc_cls; |
224 | 223 | ||
@@ -242,8 +241,8 @@ handle_result (void *cls, | |||
242 | d_count, | 241 | d_count, |
243 | d_chain, | 242 | d_chain, |
244 | c_count, | 243 | c_count, |
245 | creds)); | 244 | dels)); |
246 | if (GNUNET_NO == ntohl (vr_msg->cred_found)) | 245 | if (GNUNET_NO == ntohl (vr_msg->del_found)) |
247 | { | 246 | { |
248 | proc (proc_cls, | 247 | proc (proc_cls, |
249 | 0, | 248 | 0, |
@@ -255,7 +254,7 @@ handle_result (void *cls, | |||
255 | d_count, | 254 | d_count, |
256 | d_chain, | 255 | d_chain, |
257 | c_count, | 256 | c_count, |
258 | creds); | 257 | dels); |
259 | } | 258 | } |
260 | } | 259 | } |
261 | 260 | ||
@@ -415,8 +414,8 @@ GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle, | |||
415 | c_msg->subject_key = *subject_key; | 414 | c_msg->subject_key = *subject_key; |
416 | c_msg->issuer_key = *issuer_key; | 415 | c_msg->issuer_key = *issuer_key; |
417 | c_msg->issuer_attribute_len = htons(strlen(issuer_attribute)); | 416 | c_msg->issuer_attribute_len = htons(strlen(issuer_attribute)); |
418 | //c_msg->resolution_algo = htons(Backward); | 417 | c_msg->resolution_algo = htons(Backward); |
419 | c_msg->resolution_algo = htons(Forward); | 418 | //c_msg->resolution_algo = htons(Forward); |
420 | 419 | ||
421 | GNUNET_memcpy (&c_msg[1], | 420 | GNUNET_memcpy (&c_msg[1], |
422 | issuer_attribute, | 421 | issuer_attribute, |
@@ -441,8 +440,8 @@ GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle, | |||
441 | * @param issuer_key the issuer public key | 440 | * @param issuer_key the issuer public key |
442 | * @param issuer_attribute the issuer attribute | 441 | * @param issuer_attribute the issuer attribute |
443 | * @param subject_key the subject public key | 442 | * @param subject_key the subject public key |
444 | * @param credential_count number of credentials provided | 443 | * @param delegate_count number of delegates provided |
445 | * @param credentials subject credentials | 444 | * @param delegates subject delegates |
446 | * @param proc function to call on result | 445 | * @param proc function to call on result |
447 | * @param proc_cls closure for processor | 446 | * @param proc_cls closure for processor |
448 | * @return handle to the queued request | 447 | * @return handle to the queued request |
@@ -452,8 +451,8 @@ GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle, | |||
452 | const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, | 451 | const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key, |
453 | const char *issuer_attribute, | 452 | const char *issuer_attribute, |
454 | const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key, | 453 | const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key, |
455 | uint32_t credential_count, | 454 | uint32_t delegate_count, |
456 | const struct GNUNET_CREDENTIAL_Delegate *credentials, | 455 | const struct GNUNET_CREDENTIAL_Delegate *delegates, |
457 | GNUNET_CREDENTIAL_CredentialResultProcessor proc, | 456 | GNUNET_CREDENTIAL_CredentialResultProcessor proc, |
458 | void *proc_cls) | 457 | void *proc_cls) |
459 | { | 458 | { |
@@ -463,14 +462,14 @@ GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle, | |||
463 | size_t nlen; | 462 | size_t nlen; |
464 | size_t clen; | 463 | size_t clen; |
465 | 464 | ||
466 | if (NULL == issuer_attribute || NULL == credentials) | 465 | if (NULL == issuer_attribute || NULL == delegates) |
467 | { | 466 | { |
468 | GNUNET_break (0); | 467 | GNUNET_break (0); |
469 | return NULL; | 468 | return NULL; |
470 | } | 469 | } |
471 | 470 | ||
472 | clen = GNUNET_CREDENTIAL_credentials_get_size (credential_count, | 471 | clen = GNUNET_CREDENTIAL_delegates_get_size (delegate_count, |
473 | credentials); | 472 | delegates); |
474 | 473 | ||
475 | //DEBUG LOG | 474 | //DEBUG LOG |
476 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 475 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -492,17 +491,17 @@ GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle, | |||
492 | GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY); | 491 | GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY); |
493 | v_msg->id = htonl (vr->r_id); | 492 | v_msg->id = htonl (vr->r_id); |
494 | v_msg->subject_key = *subject_key; | 493 | v_msg->subject_key = *subject_key; |
495 | v_msg->c_count = htonl(credential_count); | 494 | v_msg->d_count = htonl(delegate_count); |
496 | v_msg->issuer_key = *issuer_key; | 495 | v_msg->issuer_key = *issuer_key; |
497 | v_msg->issuer_attribute_len = htons(strlen(issuer_attribute)); | 496 | v_msg->issuer_attribute_len = htons(strlen(issuer_attribute)); |
498 | //v_msg->resolution_algo = htons(Backward); | 497 | v_msg->resolution_algo = htons(Backward); |
499 | v_msg->resolution_algo = htons(Forward); | 498 | //v_msg->resolution_algo = htons(Forward); |
500 | 499 | ||
501 | GNUNET_memcpy (&v_msg[1], | 500 | GNUNET_memcpy (&v_msg[1], |
502 | issuer_attribute, | 501 | issuer_attribute, |
503 | strlen (issuer_attribute)); | 502 | strlen (issuer_attribute)); |
504 | GNUNET_CREDENTIAL_credentials_serialize (credential_count, | 503 | GNUNET_CREDENTIAL_delegates_serialize (delegate_count, |
505 | credentials, | 504 | delegates, |
506 | clen, | 505 | clen, |
507 | ((char*)&v_msg[1]) | 506 | ((char*)&v_msg[1]) |
508 | + strlen (issuer_attribute) + 1); | 507 | + strlen (issuer_attribute) + 1); |