summaryrefslogtreecommitdiffstats
path: root/libssh/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'libssh/client.c')
-rw-r--r--libssh/client.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libssh/client.c b/libssh/client.c
index 09f522a..26277f0 100644
--- a/libssh/client.c
+++ b/libssh/client.c
@@ -449,7 +449,11 @@ int ssh_connect(SSH_SESSION *session) {
session->alive = 0;
session->client = 1;
- ssh_crypto_init();
+ if (ssh_crypto_init(session) < 0) {
+ ssh_set_error(session, SSH_FATAL, "Initializing crypto functions failed");
+ leave_function();
+ return SSH_ERROR;
+ }
ssh_socket_init();
if (options->fd == -1 && options->host == NULL) {
@@ -628,6 +632,7 @@ void ssh_disconnect(SSH_SESSION *session) {
error:
leave_function();
+ ssh_crypto_finalize(session);
ssh_cleanup(session);
}