19DISABLE_GCC_WARNING(
"-Wredundant-decls")
20DISABLE_GCC_WARNING("-Wstrict-prototypes")
28ENABLE_GCC_WARNING(
"-Wstrict-prototypes")
29ENABLE_GCC_WARNING("-Wredundant-decls")
32crypto_nss_get_version_str(
void)
34 return NSS_GetVersion();
37crypto_nss_get_header_version_str(
void)
55crypto_nss_early_init(
int nss_only)
58 PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 0);
65 if (NSS_NoDB_Init(NULL) == SECFailure) {
66 log_err(
LD_CRYPTO,
"Unable to initialize NSS.");
67 crypto_nss_log_errors(
LOG_ERR,
"initializing NSS");
68 tor_assert_unreached();
71 if (NSS_SetDomesticPolicy() == SECFailure) {
72 log_err(
LD_CRYPTO,
"Unable to set NSS cipher policy.");
73 crypto_nss_log_errors(
LOG_ERR,
"setting cipher policy");
74 tor_assert_unreached();
79 SECStatus rv = NSS_OptionSet(NSS_RSA_MIN_KEY_SIZE, 1024);
80 if (rv != SECSuccess) {
81 log_err(
LD_CRYPTO,
"Unable to set NSS min RSA key size");
82 crypto_nss_log_errors(
LOG_ERR,
"setting cipher option.");
83 tor_assert_unreached();
88crypto_nss_log_errors(
int severity,
const char *doing)
90 PRErrorCode code = PR_GetError();
91 const char *
string = PORT_ErrorToString(code);
92 const char *
name = PORT_ErrorToName(code);
95 string =
"<unrecognized>";
102 name, doing,
string);
109crypto_nss_late_init(
void)
117crypto_nss_global_cleanup(
void)
125crypto_nss_prefork(
void)
131crypto_nss_postfork(
void)
133 crypto_nss_early_init(1);
static char * nss_password_func_always_fail(PK11SlotInfo *slot, PRBool retry, void *arg)
Headers for crypto_nss_mgt.c.
void tor_log(int severity, log_domain_mask_t domain, const char *format,...)
int tor_snprintf(char *str, size_t size, const char *format,...)
Macros to manage assertions, fatal and non-fatal.