1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-27 13:21:11 +03:00

init: Some initialization fixes.

- Check result of ssh_init() in privatekey_from_base64()
- Moved code from ssh_finalize() to appropriate subroutines
- Only initialize sockets once (caused mismatch of WSAStartup() and
  WSACleanup() calls and potential usage of bsd_poll when win_poll
  should be used)
This commit is contained in:
Oliver Stöneberg
2011-04-26 16:06:46 -07:00
committed by Andreas Schneider
parent 040a543f57
commit 3ae01ff9f5
4 changed files with 28 additions and 17 deletions

View File

@@ -73,15 +73,6 @@ int ssh_init(void) {
int ssh_finalize(void) {
ssh_crypto_finalize();
ssh_socket_cleanup();
#ifdef HAVE_LIBGCRYPT
gcry_control(GCRYCTL_TERM_SECMEM);
#elif defined HAVE_LIBCRYPTO
EVP_cleanup();
CRYPTO_cleanup_all_ex_data();
#endif
#ifdef _WIN32
WSACleanup();
#endif
/* It is important to finalize threading after CRYPTO because
* it still depends on it */
ssh_threads_finalize();