mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-02 01:17:52 +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:
committed by
Andreas Schneider
parent
040a543f57
commit
3ae01ff9f5
8
src/dh.c
8
src/dh.c
@@ -140,6 +140,7 @@ int ssh_crypto_init(void) {
|
||||
}
|
||||
bignum_bin2bn(p_value, P_LEN, p);
|
||||
OpenSSL_add_all_algorithms();
|
||||
|
||||
#endif
|
||||
|
||||
ssh_crypto_initialized = 1;
|
||||
@@ -154,8 +155,13 @@ void ssh_crypto_finalize(void) {
|
||||
g = NULL;
|
||||
bignum_free(p);
|
||||
p = NULL;
|
||||
#ifdef HAVE_LIBGCRYPT
|
||||
gcry_control(GCRYCTL_TERM_SECMEM);
|
||||
#elif defined HAVE_LIBCRYPTO
|
||||
EVP_cleanup();
|
||||
CRYPTO_cleanup_all_ex_data();
|
||||
#endif
|
||||
ssh_crypto_initialized=0;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user