tls-socket: Handle sending fatal errors better
In particular as server, the previous code might cause it to hang in
recv() if this case wasn't triggered by a close notify (followed by a
shutdown of the socket) but it e.g. failed processing a ServerHello and
responded with a fatal alert.
Fixes: 09fbaad6bd ("tls-socket: Don't fail reading if sending data failed")
This commit is contained in:
@@ -193,11 +193,13 @@ static bool exchange(private_tls_socket_t *this, bool wr, bool block)
|
|||||||
case SUCCESS:
|
case SUCCESS:
|
||||||
return TRUE;
|
return TRUE;
|
||||||
default:
|
default:
|
||||||
if (wr)
|
if (!wr && this->app.in_done > 0)
|
||||||
{
|
{ /* return data after proper termination via fatal close
|
||||||
return FALSE;
|
* notify to which we responded with one */
|
||||||
|
this->eof = TRUE;
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
break;
|
return FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user