void CryptoDeInitialize() { if (crypto_initialized) { char randfile[CF_BUFSIZE]; snprintf(randfile, CF_BUFSIZE, "%s%crandseed", CFWORKDIR, FILE_SEPARATOR); /* Only write out a seed if the file doesn't exist * and we have enough entropy to do so. If RAND_write_File * returns a bad value, delete the poor seed. */ if (access(randfile, R_OK) && errno == ENOENT && RAND_write_file(randfile) != 1024) { //Log(LOG_LEVEL_VERBOSE, "Could not write randomness to '%s'", randfile); unlink(randfile); /* do not reuse entropy */ } chmod(randfile, 0600); EVP_cleanup(); CleanupOpenSSLThreadLocks(); ERR_free_strings(); crypto_initialized = false; } }
void CryptoDeInitialize() { if (crypto_initialized) { EVP_cleanup(); CleanupOpenSSLThreadLocks(); crypto_initialized = false; } }
void CryptoDeInitialize() { if (crypto_initialized) { EVP_cleanup(); CleanupOpenSSLThreadLocks(); // TODO: Is there an ERR_unload_crypto_strings() ? // TODO: Are there OpenSSL_clear_all_{digests,algorithms} ? crypto_initialized = false; } }