ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/s_bsd.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/s_bsd.c (file contents):
Revision 2632 by michael, Sun Dec 8 18:33:48 2013 UTC vs.
Revision 2733 by michael, Fri Jan 3 17:30:13 2014 UTC

# Line 239 | Line 239 | ssl_handshake(int fd, struct Client *cli
239  
240    if ((ret = SSL_accept(client_p->localClient->fd.ssl)) <= 0)
241    {
242 +    if ((CurrentTime - client_p->localClient->firsttime) > 30)
243 +    {
244 +      exit_client(client_p, client_p, "Timeout during SSL handshake");
245 +      return;
246 +    }
247 +
248      switch (SSL_get_error(client_p->localClient->fd.ssl, ret))
249      {
250        case SSL_ERROR_WANT_WRITE:
251          comm_setselect(&client_p->localClient->fd, COMM_SELECT_WRITE,
252 <                       (PF *) ssl_handshake, client_p, 0);
252 >                       (PF *) ssl_handshake, client_p, 30);
253          return;
254  
255        case SSL_ERROR_WANT_READ:
256          comm_setselect(&client_p->localClient->fd, COMM_SELECT_READ,
257 <                       (PF *) ssl_handshake, client_p, 0);
257 >                       (PF *) ssl_handshake, client_p, 30);
258          return;
259  
260        default:
# Line 257 | Line 263 | ssl_handshake(int fd, struct Client *cli
263      }
264    }
265  
266 +  comm_settimeout(&client_p->localClient->fd, 0, NULL, NULL);
267 +
268    if ((cert = SSL_get_peer_certificate(client_p->localClient->fd.ssl)))
269    {
270      int res = SSL_get_verify_result(client_p->localClient->fd.ssl);

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)