int calling_back)
{
ssh_state = SSH_STATE_CLOSED;
- sk_close(s);
- s = NULL;
+ if (s) {
+ sk_close(s);
+ s = NULL;
+ }
if (error_msg) {
/* A socket error has occurred. */
connection_fatal(error_msg);
#endif
hkey = hostkey->newkey(hostkeydata, hostkeylen);
- if (!hostkey->verifysig(hkey, sigdata, siglen, exchange_hash, 20)) {
- bombout(("Server failed host key check"));
+ if (!hkey ||
+ !hostkey->verifysig(hkey, sigdata, siglen, exchange_hash, 20)) {
+ bombout(("Server's host key did not match the signature supplied"));
crReturn(0);
}