diff options
author | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2017-04-21 13:51:04 +0200 |
---|---|---|
committer | Schanzenbach, Martin <mschanzenbach@posteo.de> | 2017-04-21 13:51:04 +0200 |
commit | 324650a2a05cd38c896162dd8dd7aebd3ddfd25f (patch) | |
tree | 379add7ad6e4ff4c5ceb92237cde211dbbaac126 | |
parent | de63d950345774c45b8d36969d6ecf9fee43dd9b (diff) | |
download | gnunet-324650a2a05cd38c896162dd8dd7aebd3ddfd25f.tar.gz gnunet-324650a2a05cd38c896162dd8dd7aebd3ddfd25f.zip |
-fix API changes
-rw-r--r-- | src/credential/credential_api.c | 4 | ||||
-rw-r--r-- | src/credential/gnunet-credential.c | 77 | ||||
-rw-r--r-- | src/credential/gnunet-service-credential.c | 2 | ||||
-rw-r--r-- | src/identity-provider/identity_provider_api.c | 2 |
4 files changed, 49 insertions, 36 deletions
diff --git a/src/credential/credential_api.c b/src/credential/credential_api.c index f90bf9630..fd0c9e3d5 100644 --- a/src/credential/credential_api.c +++ b/src/credential/credential_api.c | |||
@@ -399,7 +399,7 @@ GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle, | |||
399 | "Trying to collect `%s' in CREDENTIAL\n", | 399 | "Trying to collect `%s' in CREDENTIAL\n", |
400 | issuer_attribute); | 400 | issuer_attribute); |
401 | nlen = strlen (issuer_attribute) + 1; | 401 | nlen = strlen (issuer_attribute) + 1; |
402 | if (nlen >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (*vr)) | 402 | if (nlen >= GNUNET_MAX_MESSAGE_SIZE - sizeof (*vr)) |
403 | { | 403 | { |
404 | GNUNET_break (0); | 404 | GNUNET_break (0); |
405 | return NULL; | 405 | return NULL; |
@@ -475,7 +475,7 @@ GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle, | |||
475 | "Trying to verify `%s' in CREDENTIAL\n", | 475 | "Trying to verify `%s' in CREDENTIAL\n", |
476 | issuer_attribute); | 476 | issuer_attribute); |
477 | nlen = strlen (issuer_attribute) + 1 + clen; | 477 | nlen = strlen (issuer_attribute) + 1 + clen; |
478 | if (nlen >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (*vr)) | 478 | if (nlen >= GNUNET_MAX_MESSAGE_SIZE - sizeof (*vr)) |
479 | { | 479 | { |
480 | GNUNET_break (0); | 480 | GNUNET_break (0); |
481 | return NULL; | 481 | return NULL; |
diff --git a/src/credential/gnunet-credential.c b/src/credential/gnunet-credential.c index fb7bdb7f8..92804c97a 100644 --- a/src/credential/gnunet-credential.c +++ b/src/credential/gnunet-credential.c | |||
@@ -108,17 +108,17 @@ static char *issuer_attr; | |||
108 | /** | 108 | /** |
109 | * Verify mode | 109 | * Verify mode |
110 | */ | 110 | */ |
111 | static uint32_t verify; | 111 | static int verify; |
112 | 112 | ||
113 | /** | 113 | /** |
114 | * Issue mode | 114 | * Issue mode |
115 | */ | 115 | */ |
116 | static uint32_t create_cred; | 116 | static int create_cred; |
117 | 117 | ||
118 | /** | 118 | /** |
119 | * Collect mode | 119 | * Collect mode |
120 | */ | 120 | */ |
121 | static uint32_t collect; | 121 | static int collect; |
122 | 122 | ||
123 | /** | 123 | /** |
124 | * Task run on shutdown. Cleans up everything. | 124 | * Task run on shutdown. Cleans up everything. |
@@ -537,34 +537,49 @@ run (void *cls, | |||
537 | int | 537 | int |
538 | main (int argc, char *const *argv) | 538 | main (int argc, char *const *argv) |
539 | { | 539 | { |
540 | static const struct GNUNET_GETOPT_CommandLineOption options[] = { | 540 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
541 | {'I', "issue", NULL, | 541 | GNUNET_GETOPT_option_flag ('I', |
542 | gettext_noop ("create credential"), 0, | 542 | "issue", |
543 | &GNUNET_GETOPT_set_one, &create_cred}, | 543 | gettext_noop ("create credential"), |
544 | {'V', "verify", NULL, | 544 | &create_cred), |
545 | gettext_noop ("verify credential against attribute"), 0, | 545 | GNUNET_GETOPT_option_flag ('V', |
546 | &GNUNET_GETOPT_set_one, &verify}, | 546 | "verify", |
547 | {'s', "subject", "PKEY", | 547 | gettext_noop ("verify credential against attribute"), |
548 | gettext_noop ("The public key of the subject to lookup the credential for"), 1, | 548 | &verify), |
549 | &GNUNET_GETOPT_set_string, &subject_key}, | 549 | GNUNET_GETOPT_option_string ('s', |
550 | {'b', "credential", "CRED", | 550 | "subject", |
551 | gettext_noop ("The name of the credential presented by the subject"), 1, | 551 | "PKEY", |
552 | &GNUNET_GETOPT_set_string, &subject_credential}, | 552 | gettext_noop ("The public key of the subject to lookup the credential for"), |
553 | {'i', "issuer", "PKEY", | 553 | &subject_key), |
554 | gettext_noop ("The public key of the authority to verify the credential against"), 1, | 554 | GNUNET_GETOPT_option_string ('b', |
555 | &GNUNET_GETOPT_set_string, &issuer_key}, | 555 | "credential", |
556 | {'e', "ego", "EGO", | 556 | "CRED", |
557 | gettext_noop ("The ego to use"), 1, | 557 | gettext_noop ("The name of the credential presented by the subject"), |
558 | &GNUNET_GETOPT_set_string, &ego_name}, | 558 | &subject_credential), |
559 | {'a', "attribute", "ATTR", | 559 | GNUNET_GETOPT_option_string ('i', |
560 | gettext_noop ("The issuer attribute to verify against or to issue"), 1, | 560 | "issuer", |
561 | &GNUNET_GETOPT_set_string, &issuer_attr}, | 561 | "PKEY", |
562 | {'T', "ttl", "EXP", | 562 | gettext_noop ("The public key of the authority to verify the credential against"), |
563 | gettext_noop ("The time to live for the credential"), 1, | 563 | &issuer_key), |
564 | &GNUNET_GETOPT_set_string, &expiration}, | 564 | GNUNET_GETOPT_option_string ('e', |
565 | {'g', "collect", NULL, | 565 | "ego", |
566 | gettext_noop ("collect credentials"), 0, | 566 | "EGO", |
567 | &GNUNET_GETOPT_set_one, &collect}, | 567 | gettext_noop ("The ego to use"), |
568 | &ego_name), | ||
569 | GNUNET_GETOPT_option_string ('a', | ||
570 | "attribute", | ||
571 | "ATTR", | ||
572 | gettext_noop ("The issuer attribute to verify against or to issue"), | ||
573 | &issuer_attr), | ||
574 | GNUNET_GETOPT_option_string ('T', | ||
575 | "ttl", | ||
576 | "EXP", | ||
577 | gettext_noop ("The time to live for the credential"), | ||
578 | &expiration), | ||
579 | GNUNET_GETOPT_option_flag ('g', | ||
580 | "collect", | ||
581 | gettext_noop ("collect credentials"), | ||
582 | &collect), | ||
568 | GNUNET_GETOPT_OPTION_END | 583 | GNUNET_GETOPT_OPTION_END |
569 | }; | 584 | }; |
570 | int ret; | 585 | int ret; |
diff --git a/src/credential/gnunet-service-credential.c b/src/credential/gnunet-service-credential.c index 75ed6d5da..3178b133e 100644 --- a/src/credential/gnunet-service-credential.c +++ b/src/credential/gnunet-service-credential.c | |||
@@ -772,7 +772,6 @@ backward_resolution (void* cls, | |||
772 | ds_entry->issuer_key, //issuer_key, | 772 | ds_entry->issuer_key, //issuer_key, |
773 | GNUNET_GNSRECORD_TYPE_ATTRIBUTE, | 773 | GNUNET_GNSRECORD_TYPE_ATTRIBUTE, |
774 | GNUNET_GNS_LO_DEFAULT, | 774 | GNUNET_GNS_LO_DEFAULT, |
775 | NULL, //shorten_key, always NULL | ||
776 | &backward_resolution, | 775 | &backward_resolution, |
777 | ds_entry); | 776 | ds_entry); |
778 | GNUNET_free (lookup_attribute); | 777 | GNUNET_free (lookup_attribute); |
@@ -855,7 +854,6 @@ delegation_chain_resolution_start (void* cls) | |||
855 | &vrh->issuer_key, //issuer_key, | 854 | &vrh->issuer_key, //issuer_key, |
856 | GNUNET_GNSRECORD_TYPE_ATTRIBUTE, | 855 | GNUNET_GNSRECORD_TYPE_ATTRIBUTE, |
857 | GNUNET_GNS_LO_DEFAULT, | 856 | GNUNET_GNS_LO_DEFAULT, |
858 | NULL, //shorten_key, always NULL | ||
859 | &backward_resolution, | 857 | &backward_resolution, |
860 | ds_entry); | 858 | ds_entry); |
861 | } | 859 | } |
diff --git a/src/identity-provider/identity_provider_api.c b/src/identity-provider/identity_provider_api.c index 04e3a54f9..9a3304334 100644 --- a/src/identity-provider/identity_provider_api.c +++ b/src/identity-provider/identity_provider_api.c | |||
@@ -443,7 +443,7 @@ GNUNET_IDENTITY_PROVIDER_issue_token (struct GNUNET_IDENTITY_PROVIDER_Handle *id | |||
443 | slen = strlen (scopes) + 1; | 443 | slen = strlen (scopes) + 1; |
444 | if (NULL != vattr) | 444 | if (NULL != vattr) |
445 | slen += strlen (vattr) + 1; | 445 | slen += strlen (vattr) + 1; |
446 | if (slen >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (struct IssueMessage)) | 446 | if (slen >= GNUNET_MAX_MESSAGE_SIZE - sizeof (struct IssueMessage)) |
447 | { | 447 | { |
448 | GNUNET_break (0); | 448 | GNUNET_break (0); |
449 | return NULL; | 449 | return NULL; |