diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-04-16 12:08:11 +0000 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-04-16 12:08:11 +0000 |
commit | 24fc1b2028ed03ac7355c05ad2c93d81f0d5497a (patch) | |
tree | 7668ab141dc294d13d1ed43d300bbb3a219ab667 /libssh/client.c | |
parent | c608883205b986e8c5192919e7c1f44715b5bb31 (diff) | |
download | libssh-24fc1b2028ed03ac7355c05ad2c93d81f0d5497a.tar.gz libssh-24fc1b2028ed03ac7355c05ad2c93d81f0d5497a.tar.xz libssh-24fc1b2028ed03ac7355c05ad2c93d81f0d5497a.zip |
Make dh crypto functions thread safe.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@491 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/client.c')
-rw-r--r-- | libssh/client.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libssh/client.c b/libssh/client.c index 09f522ae..26277f03 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); } |