IDENTITY management command line tool. More...
Go to the source code of this file.
Macros | |
#define | TIMEOUT_STATUS_CODE 40 |
Return value from main on timeout. More... | |
Functions | |
static void | shutdown_task (void *cls) |
Task run on shutdown. More... | |
static void | test_finished (void) |
Test if we are finished yet. More... | |
static void | delete_finished (void *cls, enum GNUNET_ErrorCode ec) |
Deletion operation finished. More... | |
static void | create_finished (void *cls, const struct GNUNET_CRYPTO_PrivateKey *pk_created, enum GNUNET_ErrorCode ec) |
Creation operation finished. More... | |
static void | write_encrypted_message (void) |
Encrypt a message given with -W, encrypted using public key of an identity given with -k. More... | |
static void | read_encrypted_message (struct GNUNET_IDENTITY_Ego *ego) |
Decrypt a message given with -R, encrypted using public key of ego and ephemeral key given with -k. More... | |
static void | print_ego (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *identifier) |
If listing is enabled, prints information about the egos. More... | |
static void | run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Main function that will be run by the scheduler. More... | |
int | main (int argc, char *const *argv) |
The main function. More... | |
Variables | |
static struct GNUNET_IDENTITY_Handle * | sh |
Handle to IDENTITY service. More... | |
static int | list |
Was "list" specified? More... | |
static int | monitor |
Was "monitor" specified? More... | |
static int | private_keys |
Was "private" specified? More... | |
static unsigned int | verbose |
Was "verbose" specified? More... | |
static int | quiet |
Was "quiet" specified? More... | |
static int | type_eddsa |
Was "eddsa" specified? More... | |
static char * | write_msg |
-W option More... | |
static char * | read_msg |
-R option More... | |
static char * | create_ego |
-C option More... | |
static char * | delete_ego |
-D option More... | |
static char * | privkey_ego |
-P option More... | |
static char * | pubkey_msg |
-k option More... | |
static char * | set_ego |
-s option. More... | |
static struct GNUNET_IDENTITY_Operation * | set_op |
Operation handle for set operation. More... | |
static struct GNUNET_IDENTITY_Operation * | create_op |
Handle for create operation. More... | |
static struct GNUNET_IDENTITY_Operation * | delete_op |
Handle for delete operation. More... | |
struct GNUNET_CRYPTO_PrivateKey | pk |
Private key from command line option, or NULL. More... | |
static int | global_ret |
Value to return from main(). More... | |
IDENTITY management command line tool.
Todo:
Definition in file gnunet-identity.c.
#define TIMEOUT_STATUS_CODE 40 |
Return value from main on timeout.
Definition at line 36 of file gnunet-identity.c.
|
static |
Task run on shutdown.
cls | NULL |
Definition at line 140 of file gnunet-identity.c.
References create_op, delete_op, GNUNET_free, GNUNET_IDENTITY_cancel(), GNUNET_IDENTITY_disconnect(), set_ego, set_op, and sh.
Referenced by run().
|
static |
Test if we are finished yet.
Definition at line 171 of file gnunet-identity.c.
References create_op, delete_op, global_ret, GNUNET_SCHEDULER_shutdown(), list, monitor, read_msg, set_op, TIMEOUT_STATUS_CODE, and write_msg.
Referenced by create_finished(), delete_finished(), print_ego(), and run().
|
static |
Deletion operation finished.
cls | pointer to operation handle |
ec | the error code |
Definition at line 195 of file gnunet-identity.c.
References GNUNET_IDENTITY_Operation::cls, GNUNET_EC_NONE, GNUNET_ErrorCode_get_hint(), op, and test_finished().
Referenced by run().
|
static |
Creation operation finished.
cls | pointer to operation handle |
pk | private key of the ego, or NULL on error |
ec | the error code |
Definition at line 215 of file gnunet-identity.c.
References _, GNUNET_IDENTITY_Operation::cls, global_ret, GNUNET_CRYPTO_key_get_public(), GNUNET_CRYPTO_private_key_to_string(), GNUNET_CRYPTO_public_key_to_string(), GNUNET_ErrorCode_get_hint(), GNUNET_free, op, private_keys, pub, test_finished(), and verbose.
Referenced by run().
|
static |
Encrypt a message given with -W, encrypted using public key of an identity given with -k.
Definition at line 259 of file gnunet-identity.c.
References global_ret, GNUNET_assert, GNUNET_CRYPTO_hpke_pk_to_x25519(), GNUNET_CRYPTO_hpke_seal_oneshot(), GNUNET_CRYPTO_HPKE_SEAL_ONESHOT_OVERHEAD_BYTES, GNUNET_CRYPTO_public_key_from_string(), GNUNET_free, GNUNET_OK, GNUNET_STRINGS_data_to_string_alloc(), GNUNET_SYSERR, pubkey_msg, and write_msg.
Referenced by run().
|
static |
Decrypt a message given with -R, encrypted using public key of ego
and ephemeral key given with -k.
ego | ego whose private key is used for decryption |
Definition at line 307 of file gnunet-identity.c.
References global_ret, GNUNET_assert, GNUNET_CRYPTO_hpke_open_oneshot(), GNUNET_CRYPTO_hpke_sk_to_x25519(), GNUNET_free, GNUNET_IDENTITY_ego_get_private_key(), GNUNET_OK, GNUNET_STRINGS_string_to_data_alloc(), and read_msg.
Referenced by print_ego().
|
static |
If listing is enabled, prints information about the egos.
This function is initially called for all egos and then again whenever a ego's identifier changes or if it is deleted. At the end of the initial pass over all egos, the function is once called with 'NULL' for 'ego'. That does NOT mean that the callback won't be invoked in the future or that there was an error.
When used with 'GNUNET_IDENTITY_create' or 'GNUNET_IDENTITY_get', this function is only called ONCE, and 'NULL' being passed in 'ego' does indicate an error (for example because name is taken or no default value is known). If 'ego' is non-NULL and if '*ctx' is set in those callbacks, the value WILL be passed to a subsequent call to the identity callback of 'GNUNET_IDENTITY_connect' (if that one was not NULL).
When an identity is renamed, this function is called with the (known) ego but the NEW identifier.
When an identity is deleted, this function is called with the (known) ego and "NULL" for the 'identifier'. In this case, the 'ego' is henceforth invalid (and the 'ctx' should also be cleaned up).
cls | closure |
ego | ego handle |
ctx | context for application to store data for this ego (during the lifetime of this process, initially NULL) |
identifier | identifier assigned by the user for this ego, NULL if the user just deleted the ego and it must thus no longer be used |
Definition at line 385 of file gnunet-identity.c.
References GNUNET_CRYPTO_private_key_to_string(), GNUNET_CRYPTO_public_key_to_string(), GNUNET_free, GNUNET_IDENTITY_ego_get_private_key(), GNUNET_IDENTITY_ego_get_public_key(), GNUNET_PUBLIC_KEY_TYPE_ECDSA, list, monitor, private_keys, quiet, read_encrypted_message(), read_msg, set_ego, test_finished(), and GNUNET_CRYPTO_PublicKey::type.
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!) |
cfg | configuration |
Definition at line 470 of file gnunet-identity.c.
References cfg, create_ego, create_finished(), create_op, delete_ego, delete_finished(), delete_op, GNUNET_free, GNUNET_IDENTITY_connect(), GNUNET_IDENTITY_create(), GNUNET_IDENTITY_delete(), GNUNET_PUBLIC_KEY_TYPE_ECDSA, GNUNET_PUBLIC_KEY_TYPE_EDDSA, GNUNET_SCHEDULER_add_shutdown(), GNUNET_STRINGS_string_to_data(), list, monitor, pk, print_ego(), privkey_ego, pubkey_msg, read_msg, set_ego, sh, shutdown_task(), test_finished(), type_eddsa, write_encrypted_message(), and write_msg.
Referenced by main().
int main | ( | int | argc, |
char *const * | argv | ||
) |
The main function.
argc | number of arguments from the command line |
argv | command line arguments |
Definition at line 548 of file gnunet-identity.c.
References create_ego, delete_ego, gettext_noop, global_ret, GNUNET_GETOPT_OPTION_END, GNUNET_GETOPT_option_flag(), GNUNET_GETOPT_option_string(), GNUNET_GETOPT_option_verbose(), GNUNET_OK, GNUNET_OS_project_data_gnunet(), GNUNET_PROGRAM_run(), list, monitor, options, private_keys, privkey_ego, pubkey_msg, quiet, read_msg, res, run(), set_ego, TIMEOUT_STATUS_CODE, type_eddsa, verbose, and write_msg.
|
static |
Handle to IDENTITY service.
Definition at line 41 of file gnunet-identity.c.
Referenced by accept_client(), channel_to_sh(), client_disconnect_cb(), derive_aes_key(), derive_auth_key(), derive_iv(), derive_pong_iv(), detach_terminal(), do_registered_services_shutdown(), do_resume(), do_suspend(), es_to_channel(), es_to_sh(), finish_client_drop(), get_pid_file_name(), get_user_name(), GNUNET_HELPER_destroy(), GNUNET_HELPER_kill(), GNUNET_HELPER_send(), GNUNET_HELPER_send_cancel(), GNUNET_HELPER_wait(), GNUNET_NETWORK_shorten_unixpath(), GNUNET_PQ_event_do_poll(), GNUNET_SCHEDULER_do_work(), GNUNET_SCHEDULER_driver_done(), GNUNET_SCHEDULER_driver_init(), GNUNET_SCHEDULER_run(), GNUNET_SECRETSHARING_share_read(), GNUNET_SECRETSHARING_share_write(), GNUNET_SERVICE_client_drop(), GNUNET_SERVICE_register_(), GNUNET_SERVICE_resume(), GNUNET_SERVICE_run_(), GNUNET_SERVICE_shutdown(), GNUNET_SERVICE_start(), GNUNET_SERVICE_suspend(), GNUNET_TRANSPORT_application_suggest_cancel(), handle_client_join(), have_non_monitor_clients(), helper_write(), init_cb(), pid_file_delete(), process_acl4(), process_acl6(), run(), run_with_zone_pkey(), select_loop(), service_main(), service_mq_error_handler(), service_shutdown(), set_copy_cb(), set_user_id(), setup_service(), sh_to_channel(), shutdown_task(), start_client(), teardown_service(), and transmit_suggestion().
|
static |
Was "list" specified?
Definition at line 46 of file gnunet-identity.c.
Referenced by main(), print_ego(), run(), and test_finished().
|
static |
Was "monitor" specified?
Definition at line 51 of file gnunet-identity.c.
Referenced by main(), print_ego(), run(), and test_finished().
|
static |
Was "private" specified?
Definition at line 56 of file gnunet-identity.c.
Referenced by create_finished(), main(), and print_ego().
|
static |
Was "verbose" specified?
Definition at line 61 of file gnunet-identity.c.
Referenced by create_finished(), and main().
|
static |
Was "quiet" specified?
Definition at line 66 of file gnunet-identity.c.
Referenced by main(), and print_ego().
|
static |
Was "eddsa" specified?
Definition at line 71 of file gnunet-identity.c.
|
static |
-W option
Definition at line 76 of file gnunet-identity.c.
Referenced by main(), run(), test_finished(), and write_encrypted_message().
|
static |
-R option
Definition at line 81 of file gnunet-identity.c.
Referenced by main(), print_ego(), read_encrypted_message(), run(), and test_finished().
|
static |
|
static |
|
static |
|
static |
-k option
Definition at line 101 of file gnunet-identity.c.
Referenced by main(), run(), and write_encrypted_message().
|
static |
-s option.
Definition at line 106 of file gnunet-identity.c.
Referenced by main(), print_ego(), run(), and shutdown_task().
|
static |
Operation handle for set operation.
Definition at line 111 of file gnunet-identity.c.
Referenced by shutdown_task(), and test_finished().
|
static |
Handle for create operation.
Definition at line 116 of file gnunet-identity.c.
Referenced by run(), shutdown_task(), and test_finished().
|
static |
Handle for delete operation.
Definition at line 121 of file gnunet-identity.c.
Referenced by run(), shutdown_task(), and test_finished().
struct GNUNET_CRYPTO_PrivateKey pk |
Private key from command line option, or NULL.
Definition at line 126 of file gnunet-identity.c.
Referenced by block_plugin_revocation_check_block(), block_plugin_revocation_get_key(), check_pkey(), check_signature(), clean_rsa_pub(), clean_rsa_public_key(), create_keys(), create_response(), DID_public_key_from_did(), directory_trim_complete(), do_finished_create(), eddsa_priv_to_hpke_key(), eddsa_pub_to_hpke_key(), ego_create(), elligator_generate_public_key(), extract_rsa_pub(), extract_rsa_public_key(), get_ego(), GNR_create_signature_message(), gns_string_to_value(), gns_value_to_string(), GNUNET_CRYPTO_ecdh_x25519(), GNUNET_CRYPTO_ecdhe_elligator_key_create(), GNUNET_CRYPTO_ecdhe_elligator_key_get_public(), GNUNET_CRYPTO_ecdhe_elligator_key_get_public_norand(), GNUNET_CRYPTO_ecdhe_key_clear(), GNUNET_CRYPTO_ecdhe_key_create(), GNUNET_CRYPTO_ecdsa_key_clear(), GNUNET_CRYPTO_ecdsa_key_create(), GNUNET_CRYPTO_eddsa_key_clear(), GNUNET_CRYPTO_eddsa_key_create(), GNUNET_CRYPTO_eddsa_key_get_public(), GNUNET_CRYPTO_eddsa_sign_(), GNUNET_CRYPTO_eddsa_sign_raw(), GNUNET_CRYPTO_edx25519_key_clear(), GNUNET_CRYPTO_edx25519_key_create(), GNUNET_CRYPTO_edx25519_key_create_from_seed(), GNUNET_CRYPTO_hpke_pk_to_x25519(), GNUNET_GNSRECORD_check_pow(), GNUNET_GNSRECORD_pow_round(), GNUNET_GNSRECORD_proof_get_size(), GNUNET_IDENTITY_ego_get_public_key(), GNUNET_JSON_from_rsa_public_key(), GNUNET_JSON_pack_rsa_public_key(), GNUNET_JSON_spec_rsa_public_key(), GNUNET_TRANSPORT_application_suggest(), GSC_KX_init(), id_connect_cb(), list_ego(), origin_create_cb(), parse_rsa_public_key(), publicize_rm(), read_service_conf(), run(), sign_pow(), sign_pow_identity(), and uri_ksk_continuation().
|
static |
Definition at line 131 of file gnunet-identity.c.
Referenced by create_finished(), main(), read_encrypted_message(), test_finished(), and write_encrypted_message().