[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 30/31: add epochs CLI parameter
From: |
gnunet |
Subject: |
[gnunet] 30/31: add epochs CLI parameter |
Date: |
Wed, 22 Apr 2020 21:53:21 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
commit c4fa48421916ff0777e9cf1bbb3b83634392a494
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Wed Apr 22 17:10:22 2020 +0200
add epochs CLI parameter
---
doc/man/gnunet-revocation.1 | 3 +++
src/revocation/gnunet-revocation.c | 21 ++++++++++++++++-----
2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/doc/man/gnunet-revocation.1 b/doc/man/gnunet-revocation.1
index 0c447a94f..05d80178a 100644
--- a/doc/man/gnunet-revocation.1
+++ b/doc/man/gnunet-revocation.1
@@ -30,6 +30,7 @@
.Sh SYNOPSIS
.Nm
.Op Fl t Ar KEY | Fl -test= Ns Ar KEY
+.Op Fl e Ar EPOCHS | Fl -epochs= Ns Ar EPOCHS
.Op Fl R Ar NAME | Fl -revoke= Ns Ar NAME
.Op Fl p | -perform
.Op Fl f Ar NAME | Fl -filename= Ns Ar NAME
@@ -50,6 +51,8 @@ Depending on your CPU, the calculation can take days or weeks.
.Bl -tag -width indent
.It Fl t Ar KEY | Fl -test= Ns Ar KEY
Check if the given KEY (ASCII-encoded public key required) has been revoked.
+.It Fl e Ar EPOCHS | Fl -epochs= Ns Ar EPOCHS
+Number of epochs for which the revocation should be valid (default: 1)
.It Fl R Ar NAME | Fl -revoke= Ns Ar NAME
Calculate or perform revocation for the ego with the given NAME.
.It Fl p | -perform
diff --git a/src/revocation/gnunet-revocation.c
b/src/revocation/gnunet-revocation.c
index de9560172..19fd5ab2c 100644
--- a/src/revocation/gnunet-revocation.c
+++ b/src/revocation/gnunet-revocation.c
@@ -58,6 +58,11 @@ static char *revoke_ego;
*/
static char *test_ego;
+/**
+ * -e option.
+ */
+static unsigned int epochs = 1;
+
/**
* Handle for revocation query.
*/
@@ -333,7 +338,7 @@ ego_callback (void *cls, const struct GNUNET_IDENTITY_Ego
*ego)
}
GNUNET_IDENTITY_ego_get_public_key (ego, &key);
privkey = GNUNET_IDENTITY_ego_get_private_key (ego);
- memset(&proof_of_work, 0, sizeof (proof_of_work));
+ memset (&proof_of_work, 0, sizeof (proof_of_work));
if ((NULL != filename) && (GNUNET_YES == GNUNET_DISK_file_test (filename)) &&
(sizeof(proof_of_work) ==
GNUNET_DISK_fn_read (filename, &proof_of_work, sizeof(proof_of_work))))
@@ -363,9 +368,9 @@ ego_callback (void *cls, const struct GNUNET_IDENTITY_Ego
*ego)
*/
fprintf (stderr,
"%s",
- _("Continuing calculation where left off...\n"));
+ _ ("Continuing calculation where left off...\n"));
ph = GNUNET_REVOCATION_pow_start (&proof_of_work,
- 1, /* Epochs */
+ epochs,
matching_bits);
}
fprintf (stderr,
@@ -376,7 +381,7 @@ ego_callback (void *cls, const struct GNUNET_IDENTITY_Ego
*ego)
GNUNET_REVOCATION_pow_init (privkey,
&proof_of_work);
ph = GNUNET_REVOCATION_pow_start (&proof_of_work,
- 1, /* Epochs */
+ epochs, /* Epochs */
matching_bits);
}
pow_task = GNUNET_SCHEDULER_add_now (&calculate_pow, ph);
@@ -475,7 +480,7 @@ run (void *cls,
{
struct GNUNET_REVOCATION_PowCalculationHandle *ph;
ph = GNUNET_REVOCATION_pow_start (&proof_of_work,
- 1, /* Epochs */
+ epochs, /* Epochs */
matching_bits);
pow_task = GNUNET_SCHEDULER_add_now (&calculate_pow, ph);
@@ -528,6 +533,12 @@ main (int argc, char *const *argv)
gettext_noop (
"test if the public key KEY has been
revoked"),
&test_ego),
+ GNUNET_GETOPT_option_uint ('e',
+ "epochs",
+ "EPOCHS",
+ gettext_noop (
+ "number of epochs to calculate for"),
+ &epochs),
GNUNET_GETOPT_OPTION_END
};
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnunet] 18/31: fix, (continued)
- [gnunet] 18/31: fix, gnunet, 2020/04/22
- [gnunet] 10/31: some comments, gnunet, 2020/04/22
- [gnunet] 25/31: packed makes no sense there, gnunet, 2020/04/22
- [gnunet] 19/31: check signature in check_pow, gnunet, 2020/04/22
- [gnunet] 14/31: evaluate epochs, gnunet, 2020/04/22
- [gnunet] 24/31: remove pow_get, gnunet, 2020/04/22
- [gnunet] 21/31: predate validity time on creation; extent ttl on validation, gnunet, 2020/04/22
- [gnunet] 28/31: purge scrypt; add argon2, gnunet, 2020/04/22
- [gnunet] 16/31: remove sign API call, gnunet, 2020/04/22
- [gnunet] 17/31: update API comments, gnunet, 2020/04/22
- [gnunet] 30/31: add epochs CLI parameter,
gnunet <=
- [gnunet] 29/31: remova binary file commited by accident, gnunet, 2020/04/22
- [gnunet] 08/31: towards less variance, gnunet, 2020/04/22
- [gnunet] 22/31: new pass API, gnunet, 2020/04/22
- [gnunet] 27/31: update API for cleanup of handle, gnunet, 2020/04/22
- [gnunet] 26/31: update revocation config, gnunet, 2020/04/22
- [gnunet] 23/31: rename, fix, gnunet, 2020/04/22
- [gnunet] 20/31: include buffer of 10& of epoch, gnunet, 2020/04/22
- [gnunet] 31/31: Merge branch 'schanzen/argon_pow', gnunet, 2020/04/22
- [gnunet] 15/31: fix tests, gnunet, 2020/04/22