From 3ae01ff9f5b3e1f2ebded97ff36a705ae3b17b30 Mon Sep 17 00:00:00 2001 From: Oliver Stöneberg Date: Tue, 26 Apr 2011 16:06:46 -0700 Subject: 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) --- src/keyfiles.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/keyfiles.c') diff --git a/src/keyfiles.c b/src/keyfiles.c index 923d6dbb..6ccc6a25 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", -- cgit