diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2016-12-29 15:48:43 +0100 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2016-12-29 15:48:43 +0100 |
commit | baf9b5d76c4b40d6bd2869525656ad298ead7726 (patch) | |
tree | 257015b1c0463399fd70fb689666a00a6fb90341 /src/identity-provider/identity_provider_api.c | |
parent | 897dd85d9feb5cd962db3bf2156a2a2b4d2841d4 (diff) | |
download | gnunet-baf9b5d76c4b40d6bd2869525656ad298ead7726.tar.gz gnunet-baf9b5d76c4b40d6bd2869525656ad298ead7726.zip |
-add tokens for credentials
Diffstat (limited to 'src/identity-provider/identity_provider_api.c')
-rw-r--r-- | src/identity-provider/identity_provider_api.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/identity-provider/identity_provider_api.c b/src/identity-provider/identity_provider_api.c index 1d242f66a..abee41d17 100644 --- a/src/identity-provider/identity_provider_api.c +++ b/src/identity-provider/identity_provider_api.c | |||
@@ -430,6 +430,7 @@ GNUNET_IDENTITY_PROVIDER_issue_token (struct GNUNET_IDENTITY_PROVIDER_Handle *id | |||
430 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss_key, | 430 | const struct GNUNET_CRYPTO_EcdsaPrivateKey *iss_key, |
431 | const struct GNUNET_CRYPTO_EcdsaPublicKey *aud_key, | 431 | const struct GNUNET_CRYPTO_EcdsaPublicKey *aud_key, |
432 | const char* scopes, | 432 | const char* scopes, |
433 | const char* vattr, | ||
433 | struct GNUNET_TIME_Absolute expiration, | 434 | struct GNUNET_TIME_Absolute expiration, |
434 | uint64_t nonce, | 435 | uint64_t nonce, |
435 | GNUNET_IDENTITY_PROVIDER_IssueCallback cb, | 436 | GNUNET_IDENTITY_PROVIDER_IssueCallback cb, |
@@ -440,6 +441,8 @@ GNUNET_IDENTITY_PROVIDER_issue_token (struct GNUNET_IDENTITY_PROVIDER_Handle *id | |||
440 | size_t slen; | 441 | size_t slen; |
441 | 442 | ||
442 | slen = strlen (scopes) + 1; | 443 | slen = strlen (scopes) + 1; |
444 | if (NULL != vattr) | ||
445 | slen += strlen (vattr) + 1; | ||
443 | if (slen >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (struct IssueMessage)) | 446 | if (slen >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (struct IssueMessage)) |
444 | { | 447 | { |
445 | GNUNET_break (0); | 448 | GNUNET_break (0); |
@@ -456,9 +459,14 @@ GNUNET_IDENTITY_PROVIDER_issue_token (struct GNUNET_IDENTITY_PROVIDER_Handle *id | |||
456 | im->id = op->r_id; | 459 | im->id = op->r_id; |
457 | im->iss_key = *iss_key; | 460 | im->iss_key = *iss_key; |
458 | im->aud_key = *aud_key; | 461 | im->aud_key = *aud_key; |
462 | im->scope_len = htonl (strlen(scopes)+1); | ||
459 | im->nonce = htonl (nonce); | 463 | im->nonce = htonl (nonce); |
460 | im->expiration = GNUNET_TIME_absolute_hton (expiration); | 464 | im->expiration = GNUNET_TIME_absolute_hton (expiration); |
461 | GNUNET_memcpy (&im[1], scopes, slen); | 465 | GNUNET_memcpy (&im[1], scopes, strlen(scopes)); |
466 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | ||
467 | "VATTRAPI: %s\n", vattr); | ||
468 | if (NULL != vattr) | ||
469 | GNUNET_memcpy ((char*)&im[1]+strlen(scopes)+1, vattr, strlen(vattr)); | ||
462 | GNUNET_CONTAINER_DLL_insert_tail (id->op_head, | 470 | GNUNET_CONTAINER_DLL_insert_tail (id->op_head, |
463 | id->op_tail, | 471 | id->op_tail, |
464 | op); | 472 | op); |