tool for revoking public keys More...
#include "platform.h"
#include "gnunet_gnsrecord_lib.h"
#include "gnunet_util_lib.h"
#include "gnunet_revocation_service.h"
Go to the source code of this file.
Functions | |
static void | do_shutdown (void *cls) |
Function run if the user aborts with CTRL-C. More... | |
static void | print_query_result (void *cls, int is_valid) |
Print the result from a revocation query. More... | |
static void | print_revocation_result (void *cls, int is_valid) |
Print the result from a revocation request. More... | |
static void | perform_revocation () |
Perform the revocation. More... | |
static void | sync_pow () |
Write the current state of the revocation data to disk. More... | |
static void | calculate_pow_shutdown (void *cls) |
Perform the proof-of-work calculation. More... | |
static void | calculate_pow (void *cls) |
Perform the proof-of-work calculation. More... | |
static void | ego_callback (void *cls, struct GNUNET_IDENTITY_Ego *ego) |
Function called with the result from the ego lookup. More... | |
static void | run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) |
Main function that will be run by the scheduler. More... | |
int | main (int argc, char *const *argv) |
The main function of gnunet-revocation. More... | |
Variables | |
static unsigned int | pow_passes = 1 |
Pow passes. More... | |
static int | ret |
Final status code. More... | |
static int | perform |
Was "-p" specified? More... | |
static char * | filename |
-f option. More... | |
static char * | revoke_ego |
-R option More... | |
static char * | test_ego |
-t option. More... | |
static unsigned int | epochs = 1 |
-e option. More... | |
static struct GNUNET_REVOCATION_Query * | q |
Handle for revocation query. More... | |
static struct GNUNET_REVOCATION_Handle * | h |
Handle for revocation. More... | |
static struct GNUNET_IDENTITY_EgoLookup * | el |
Handle for our ego lookup. More... | |
static const struct GNUNET_CONFIGURATION_Handle * | cfg |
Our configuration. More... | |
static unsigned long long | matching_bits |
Number of matching bits required for revocation. More... | |
static struct GNUNET_TIME_Relative | epoch_duration |
Epoch length. More... | |
static struct GNUNET_SCHEDULER_Task * | pow_task |
Task used for proof-of-work calculation. More... | |
static struct GNUNET_GNSRECORD_PowP * | proof_of_work |
Proof-of-work object. More... | |
tool for revoking public keys
Definition in file gnunet-revocation.c.
|
static |
Function run if the user aborts with CTRL-C.
cls | closure |
Definition at line 112 of file gnunet-revocation.c.
References _, el, GNUNET_IDENTITY_ego_lookup_cancel(), GNUNET_REVOCATION_query_cancel(), GNUNET_REVOCATION_revoke_cancel(), h, and q.
Referenced by run().
|
static |
Print the result from a revocation query.
cls | NULL |
is_valid | GNUNET_YES if the key is still valid, GNUNET_NO if not, GNUNET_SYSERR on error |
Definition at line 140 of file gnunet-revocation.c.
References _, GNUNET_break, GNUNET_NO, GNUNET_SCHEDULER_shutdown(), GNUNET_SYSERR, GNUNET_YES, q, and test_ego.
Referenced by run().
|
static |
Print the result from a revocation request.
cls | NULL |
is_valid | GNUNET_YES if the key is still valid, GNUNET_NO if not, GNUNET_SYSERR on error |
Definition at line 172 of file gnunet-revocation.c.
References _, GNUNET_break, GNUNET_NO, GNUNET_SCHEDULER_shutdown(), GNUNET_SYSERR, GNUNET_YES, h, and revoke_ego.
Referenced by perform_revocation().
|
static |
Perform the revocation.
Definition at line 213 of file gnunet-revocation.c.
References cfg, GNUNET_REVOCATION_revoke(), h, print_revocation_result(), and proof_of_work.
Referenced by calculate_pow(), ego_callback(), and run().
|
static |
Write the current state of the revocation data to disk.
rd | data to sync |
Definition at line 229 of file gnunet-revocation.c.
References filename, GNUNET_DISK_fn_write(), GNUNET_DISK_PERM_USER_READ, GNUNET_DISK_PERM_USER_WRITE, GNUNET_ERROR_TYPE_ERROR, GNUNET_GNSRECORD_proof_get_size(), GNUNET_log_strerror_file, GNUNET_OK, and proof_of_work.
Referenced by calculate_pow(), and calculate_pow_shutdown().
|
static |
Perform the proof-of-work calculation.
cls | the struct RevocationData |
Definition at line 249 of file gnunet-revocation.c.
References _, GNUNET_GNSRECORD_pow_stop(), GNUNET_SCHEDULER_cancel(), pow_task, and sync_pow().
Referenced by ego_callback(), and run().
|
static |
Perform the proof-of-work calculation.
cls | the struct RevocationData |
Definition at line 270 of file gnunet-revocation.c.
References _, calculate_pow(), filename, GNUNET_DISK_directory_remove(), GNUNET_DISK_fn_write(), GNUNET_DISK_PERM_USER_READ, GNUNET_DISK_PERM_USER_WRITE, GNUNET_ERROR_TYPE_ERROR, GNUNET_GNSRECORD_pow_round(), GNUNET_GNSRECORD_proof_get_size(), GNUNET_log_strerror_file, GNUNET_OK, GNUNET_SCHEDULER_add_delayed(), GNUNET_SCHEDULER_shutdown(), GNUNET_TIME_UNIT_MILLISECONDS, perform, perform_revocation(), pow_passes, pow_task, proof_of_work, revoke_ego, and sync_pow().
Referenced by calculate_pow(), ego_callback(), and run().
|
static |
Function called with the result from the ego lookup.
cls | closure |
ego | the ego, NULL if not found |
Certificate not yet ready
Definition at line 324 of file gnunet-revocation.c.
References _, calculate_pow(), calculate_pow_shutdown(), el, epoch_duration, epochs, filename, GNUNET_CRYPTO_public_key_get_length(), GNUNET_DISK_file_test(), GNUNET_DISK_fn_read(), GNUNET_GNSRECORD_check_pow(), GNUNET_GNSRECORD_pow_init(), GNUNET_GNSRECORD_pow_start(), GNUNET_IDENTITY_ego_get_private_key(), GNUNET_IDENTITY_ego_get_public_key(), GNUNET_malloc, GNUNET_MAX_POW_SIZE, GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_SCHEDULER_shutdown(), GNUNET_YES, key, matching_bits, perform, perform_revocation(), pow_task, proof_of_work, and revoke_ego.
Referenced by run().
|
static |
Main function that will be run by the scheduler.
cls | closure |
args | remaining command-line arguments |
cfgfile | name of the configuration file used (for saving, can be NULL!) |
c | configuration |
Definition at line 409 of file gnunet-revocation.c.
References _, calculate_pow(), calculate_pow_shutdown(), cfg, do_shutdown(), ego_callback(), el, epoch_duration, epochs, filename, GNUNET_CONFIGURATION_get_value_number(), GNUNET_CONFIGURATION_get_value_time(), GNUNET_CRYPTO_public_key_from_string(), GNUNET_DISK_fn_read(), GNUNET_ERROR_TYPE_ERROR, GNUNET_GNSRECORD_check_pow(), GNUNET_GNSRECORD_pow_start(), GNUNET_GNSRECORD_proof_get_size(), GNUNET_IDENTITY_ego_lookup(), GNUNET_log_config_missing(), GNUNET_malloc, GNUNET_MAX_POW_SIZE, GNUNET_OK, GNUNET_REVOCATION_query(), GNUNET_SCHEDULER_add_now(), GNUNET_SCHEDULER_add_shutdown(), GNUNET_YES, matching_bits, perform, perform_revocation(), pk, pow_task, print_query_result(), proof_of_work, q, revoke_ego, and test_ego.
Referenced by main().
int main | ( | int | argc, |
char *const * | argv | ||
) |
The main function of gnunet-revocation.
argc | number of arguments from the command line |
argv | command line arguments |
Definition at line 523 of file gnunet-revocation.c.
References epochs, filename, gettext_noop, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_string(), GNUNET_GETOPT_option_uint(), GNUNET_OK, GNUNET_OS_project_data_gnunet(), GNUNET_PROGRAM_run(), options, perform, ret, revoke_ego, run(), and test_ego.
|
static |
Pow passes.
Definition at line 34 of file gnunet-revocation.c.
Referenced by calculate_pow(), and run_with_key().
|
static |
|
static |
Was "-p" specified?
Definition at line 44 of file gnunet-revocation.c.
Referenced by calculate_pow(), ego_callback(), main(), and run().
|
static |
-f option.
Definition at line 49 of file gnunet-revocation.c.
Referenced by calculate_pow(), ego_callback(), main(), run(), and sync_pow().
|
static |
-R option
Definition at line 54 of file gnunet-revocation.c.
Referenced by calculate_pow(), ego_callback(), main(), print_revocation_result(), and run().
|
static |
-t option.
Definition at line 59 of file gnunet-revocation.c.
Referenced by main(), print_query_result(), and run().
|
static |
-e option.
Definition at line 64 of file gnunet-revocation.c.
Referenced by ego_callback(), GNUNET_GNSRECORD_check_pow(), GNUNET_GNSRECORD_pow_start(), main(), and run().
|
static |
Handle for revocation query.
Definition at line 69 of file gnunet-revocation.c.
Referenced by build_dns_query(), check_connection_quality(), check_link_down(), check_validation_request_pending(), client_disconnect_cb(), compute_service_response(), do_shutdown(), free_pending_acknowledgement(), GNUNET_CRYPTO_ecc_dlog(), GNUNET_CRYPTO_ecdsa_public_key_derive(), GNUNET_CRYPTO_eddsa_public_key_derive(), GNUNET_CRYPTO_paillier_create(), GNUNET_DNSPARSER_parse_query(), GNUNET_HELLO_parser_from_url(), GNUNET_NAMECACHE_disconnect(), GNUNET_NAMESTORE_disconnect(), GNUNET_REVOCATION_query(), GNUNET_REVOCATION_query_cancel(), handle_add_queue_message(), handle_flow_control(), handle_request_hello_validation(), handle_revocation_query_response(), handle_validation_challenge(), handle_validation_response(), hello_for_client_cb(), hello_for_incoming_cb(), learn_dv_path(), notify_client_queues(), print_query_result(), query_mq_error_handler(), queue(), revalidation_start_cb(), run(), setup_estimate_message(), update_queue_performance(), validation_start_cb(), and validation_transmit_on_queue().
|
static |
Handle for revocation.
Definition at line 74 of file gnunet-revocation.c.
Referenced by do_shutdown(), perform_revocation(), and print_revocation_result().
|
static |
Handle for our ego lookup.
Definition at line 79 of file gnunet-revocation.c.
Referenced by do_shutdown(), ego_callback(), and run().
|
static |
Our configuration.
Definition at line 84 of file gnunet-revocation.c.
Referenced by perform_revocation(), and run().
|
static |
Number of matching bits required for revocation.
Definition at line 89 of file gnunet-revocation.c.
Referenced by ego_callback(), get_delay_randomization(), get_matching_bits_delay(), get_transmit_delay(), GNUNET_REVOCATION_revoke(), handle_p2p_estimate(), libgnunet_plugin_block_revocation_init(), run(), setup_estimate_message(), setup_flood_message(), and transmit_task_cb().
|
static |
Epoch length.
Definition at line 94 of file gnunet-revocation.c.
Referenced by ego_callback(), GNUNET_GNSRECORD_check_pow(), GNUNET_REVOCATION_revoke(), libgnunet_plugin_block_revocation_init(), and run().
|
static |
Task used for proof-of-work calculation.
Definition at line 99 of file gnunet-revocation.c.
Referenced by calculate_pow(), calculate_pow_shutdown(), ego_callback(), and run().
|
static |
Proof-of-work object.
Definition at line 104 of file gnunet-revocation.c.
Referenced by calculate_pow(), ego_callback(), perform_revocation(), run(), and sync_pow().