diff options
author | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2018-04-10 11:26:46 +0200 |
---|---|---|
committer | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2018-04-10 11:26:46 +0200 |
commit | b1af3dcf2ad69264883a398ab431fa99c7135f79 (patch) | |
tree | aed788ced81305b7cc7ed361c33fa9bb386bd087 /src/identity-provider/gnunet-idp.c | |
parent | e331d5f6dfb406f9c56d4b3cb69b671b317d6992 (diff) | |
download | gnunet-b1af3dcf2ad69264883a398ab431fa99c7135f79.tar.gz gnunet-b1af3dcf2ad69264883a398ab431fa99c7135f79.zip |
add attribute expiration
Diffstat (limited to 'src/identity-provider/gnunet-idp.c')
-rw-r--r-- | src/identity-provider/gnunet-idp.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/identity-provider/gnunet-idp.c b/src/identity-provider/gnunet-idp.c index 995dd5775..95e9f398d 100644 --- a/src/identity-provider/gnunet-idp.c +++ b/src/identity-provider/gnunet-idp.c | |||
@@ -126,6 +126,11 @@ static struct GNUNET_IDENTITY_PROVIDER_Ticket ticket; | |||
126 | */ | 126 | */ |
127 | static struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attr_list; | 127 | static struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *attr_list; |
128 | 128 | ||
129 | /** | ||
130 | * Attribute expiration interval | ||
131 | */ | ||
132 | static struct GNUNET_TIME_Relative exp_interval; | ||
133 | |||
129 | static void | 134 | static void |
130 | do_cleanup(void *cls) | 135 | do_cleanup(void *cls) |
131 | { | 136 | { |
@@ -272,6 +277,7 @@ iter_finished (void *cls) | |||
272 | idp_op = GNUNET_IDENTITY_PROVIDER_attribute_store (idp_handle, | 277 | idp_op = GNUNET_IDENTITY_PROVIDER_attribute_store (idp_handle, |
273 | pkey, | 278 | pkey, |
274 | claim, | 279 | claim, |
280 | &exp_interval, | ||
275 | &store_attr_cont, | 281 | &store_attr_cont, |
276 | NULL); | 282 | NULL); |
277 | 283 | ||
@@ -383,6 +389,7 @@ run (void *cls, | |||
383 | int | 389 | int |
384 | main(int argc, char *const argv[]) | 390 | main(int argc, char *const argv[]) |
385 | { | 391 | { |
392 | exp_interval = GNUNET_TIME_UNIT_HOURS; | ||
386 | struct GNUNET_GETOPT_CommandLineOption options[] = { | 393 | struct GNUNET_GETOPT_CommandLineOption options[] = { |
387 | 394 | ||
388 | GNUNET_GETOPT_option_string ('a', | 395 | GNUNET_GETOPT_option_string ('a', |
@@ -430,6 +437,12 @@ main(int argc, char *const argv[]) | |||
430 | NULL, | 437 | NULL, |
431 | gettext_noop ("Type of attribute"), | 438 | gettext_noop ("Type of attribute"), |
432 | &type_str), | 439 | &type_str), |
440 | GNUNET_GETOPT_option_relative_time ('E', | ||
441 | "expiration", | ||
442 | NULL, | ||
443 | gettext_noop ("Expiration interval of the attribute"), | ||
444 | &exp_interval), | ||
445 | |||
433 | GNUNET_GETOPT_OPTION_END | 446 | GNUNET_GETOPT_OPTION_END |
434 | }; | 447 | }; |
435 | return (GNUNET_OK == GNUNET_PROGRAM_run (argc, argv, "ct", | 448 | return (GNUNET_OK == GNUNET_PROGRAM_run (argc, argv, "ct", |