diff options
author | Oliver Stöneberg <oliverst@online.de> | 2011-04-26 16:06:46 -0700 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2011-05-01 19:42:50 +0200 |
commit | 3ae01ff9f5b3e1f2ebded97ff36a705ae3b17b30 (patch) | |
tree | 823ecc62dcc3a7e01af2c85a852e5ba882393b94 /src/keyfiles.c | |
parent | 040a543f57107efc267b7b5b7352293dcb7d87d5 (diff) | |
download | libssh-3ae01ff9f5b3e1f2ebded97ff36a705ae3b17b30.tar.gz libssh-3ae01ff9f5b3e1f2ebded97ff36a705ae3b17b30.tar.xz libssh-3ae01ff9f5b3e1f2ebded97ff36a705ae3b17b30.zip |
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)
Diffstat (limited to 'src/keyfiles.c')
-rw-r--r-- | src/keyfiles.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/keyfiles.c b/src/keyfiles.c index 923d6db..6ccc6a2 100644 --- a/src/keyfiles.c +++ b/src/keyfiles.c @@ -988,7 +988,9 @@ ssh_private_key privatekey_from_base64(ssh_session session, const char *b64_pkey } /* needed for openssl initialization */ - ssh_init(); + if (ssh_init() < 0) { + return NULL; + } ssh_log(session, SSH_LOG_RARE, "Trying to read privkey type=%s, passphase=%s, authcb=%s", type ? type == SSH_KEYTYPE_DSS ? "ssh-dss" : "ssh-rsa": "unknown", |