mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
Add crypto-initializer functions to those whose return values must be checked
This commit is contained in:
parent
dedea28c2e
commit
10fdee6285
@ -322,7 +322,8 @@ int
|
||||
crypto_global_init(int useAccel, const char *accelName, const char *accelDir)
|
||||
{
|
||||
if (!crypto_global_initialized_) {
|
||||
crypto_early_init();
|
||||
if (crypto_early_init() < 0)
|
||||
return -1;
|
||||
|
||||
crypto_global_initialized_ = 1;
|
||||
|
||||
|
@ -112,10 +112,10 @@ typedef struct crypto_dh_t crypto_dh_t;
|
||||
/* global state */
|
||||
const char * crypto_openssl_get_version_str(void);
|
||||
const char * crypto_openssl_get_header_version_str(void);
|
||||
int crypto_early_init(void);
|
||||
int crypto_early_init(void) ATTR_WUR;
|
||||
int crypto_global_init(int hardwareAccel,
|
||||
const char *accelName,
|
||||
const char *accelPath);
|
||||
const char *accelPath) ATTR_WUR;
|
||||
void crypto_thread_cleanup(void);
|
||||
int crypto_global_cleanup(void);
|
||||
|
||||
|
@ -390,7 +390,10 @@ main(int argc, char **argv)
|
||||
|
||||
init_logging(1);
|
||||
network_init();
|
||||
crypto_global_init(1, NULL, NULL);
|
||||
if (crypto_global_init(1, NULL, NULL) < 0) {
|
||||
printf("Couldn't initialize crypto subsystem; exiting.\n");
|
||||
return 1;
|
||||
}
|
||||
if (crypto_seed_rng() < 0) {
|
||||
printf("Couldn't seed RNG; exiting.\n");
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user