|
Tor 0.4.9.8
|
Initialize and shut down Tor's crypto library and subsystem. More...
#include "orconfig.h"#include "lib/crypt_ops/crypto_init.h"#include "lib/crypt_ops/crypto_curve25519.h"#include "lib/crypt_ops/crypto_dh.h"#include "lib/crypt_ops/crypto_ed25519.h"#include "lib/crypt_ops/crypto_openssl_mgt.h"#include "lib/crypt_ops/crypto_nss_mgt.h"#include "lib/crypt_ops/crypto_rand.h"#include "lib/crypt_ops/crypto_sys.h"#include "lib/crypt_ops/crypto_options_st.h"#include "lib/conf/conftypes.h"#include "lib/log/util_bug.h"#include "ext/polyval/polyval.h"#include "lib/subsys/subsys.h"#include "ext/siphash.h"#include "lib/crypt_ops/crypto_options.inc"Go to the source code of this file.
Macros | |
| #define | CRYPTO_PRIVATE |
| #define | CRYPTO_OPTIONS_MAGIC 0x68757368 |
| #define | CONF_CONTEXT LL_TABLE |
Functions | |
| int | crypto_init_siphash_key (void) |
| int | crypto_early_init (void) |
| int | crypto_global_init (int useAccel, const char *accelName, const char *accelDir) |
| void | crypto_thread_cleanup (void) |
| int | crypto_global_cleanup (void) |
| void | crypto_prefork (void) |
| void | crypto_postfork (void) |
| const char * | crypto_get_library_name (void) |
| const char * | crypto_get_library_version_string (void) |
| const char * | crypto_get_header_version_string (void) |
| int | tor_is_using_nss (void) |
| static int | subsys_crypto_initialize (void) |
| static void | subsys_crypto_shutdown (void) |
| static void | subsys_crypto_prefork (void) |
| static void | subsys_crypto_postfork (void) |
| static void | subsys_crypto_thread_cleanup (void) |
| static int | crypto_options_validate (const void *arg, char **msg_out) |
| static int | crypto_set_options (void *arg) |
Variables | |
| static int | crypto_early_initialized_ = 0 |
| static int | crypto_global_initialized_ = 0 |
| static int | have_seeded_siphash = 0 |
| static const config_format_t | crypto_options_fmt |
| const struct subsys_fns_t | sys_crypto |
Initialize and shut down Tor's crypto library and subsystem.
Definition in file crypto_init.c.
| #define CONF_CONTEXT LL_TABLE |
Definition at line 285 of file crypto_init.c.
| #define CRYPTO_OPTIONS_MAGIC 0x68757368 |
Magic number for crypto_options_t.
Definition at line 262 of file crypto_init.c.
Referenced by crypto_options_validate().
| #define CRYPTO_PRIVATE |
Definition at line 15 of file crypto_init.c.
| int crypto_early_init | ( | void | ) |
Initialize the crypto library. Return 0 on success, -1 on failure.
Definition at line 60 of file crypto_init.c.
Referenced by crypto_global_init().
| const char * crypto_get_header_version_string | ( | void | ) |
Return the version of the crypto library we're using, as given in the headers.
Definition at line 207 of file crypto_init.c.
| const char * crypto_get_library_name | ( | void | ) |
Return the name of the crypto library we're using.
Definition at line 181 of file crypto_init.c.
Referenced by options_init_from_torrc(), and tor_init().
| const char * crypto_get_library_version_string | ( | void | ) |
Return the version of the crypto library we are using, as given in the library.
Definition at line 194 of file crypto_init.c.
Referenced by options_init_from_torrc(), and tor_init().
| int crypto_global_cleanup | ( | void | ) |
Uninitialize the crypto library. Return 0 on success. Does not detect failure.
Definition at line 132 of file crypto_init.c.
| int crypto_global_init | ( | int | useAccel, |
| const char * | accelName, | ||
| const char * | accelDir ) |
Initialize the crypto library. Return 0 on success, -1 on failure.
Definition at line 91 of file crypto_init.c.
Referenced by crypto_set_options().
| int crypto_init_siphash_key | ( | void | ) |
Set up the siphash key if we haven't already done so.
Definition at line 45 of file crypto_init.c.
Referenced by crypto_early_init().
|
static |
Return 0 if arg is a valid crypto_options_t. Otherwise return -1 and set *msg_out to a freshly allocated error string.
Definition at line 269 of file crypto_init.c.
| void crypto_postfork | ( | void | ) |
Run operations that the crypto library requires to be happy again after forking.
Definition at line 172 of file crypto_init.c.
| void crypto_prefork | ( | void | ) |
Run operations that the crypto library requires to be happy again after forking.
Definition at line 156 of file crypto_init.c.
|
static |
Invoked from subsysmgr.c when a new set of options arrives.
Definition at line 305 of file crypto_init.c.
| void crypto_thread_cleanup | ( | void | ) |
Free crypto resources held by this thread.
Definition at line 119 of file crypto_init.c.
|
static |
Definition at line 229 of file crypto_init.c.
|
static |
Definition at line 250 of file crypto_init.c.
|
static |
Definition at line 244 of file crypto_init.c.
|
static |
Definition at line 238 of file crypto_init.c.
|
static |
Definition at line 256 of file crypto_init.c.
| int tor_is_using_nss | ( | void | ) |
Return true iff Tor is using the NSS library.
Definition at line 219 of file crypto_init.c.
|
static |
Boolean: has our crypto library been initialized? (early phase)
Definition at line 36 of file crypto_init.c.
Referenced by crypto_early_init(), and crypto_global_cleanup().
|
static |
Boolean: has our crypto library been initialized? (late phase)
Definition at line 39 of file crypto_init.c.
Referenced by crypto_global_cleanup(), and crypto_global_init().
|
static |
Declares the configuration options for this module.
Definition at line 292 of file crypto_init.c.
|
static |
Definition at line 41 of file crypto_init.c.
| const struct subsys_fns_t sys_crypto |
Definition at line 321 of file crypto_init.c.