On Mon, Jan 26, 2015 at 03:01:11AM +0100, Alexander Bluhm wrote:
> When I tested it with bad cipers it crashed because the tls connect
> callback was not set when the error occured. So I fixed that in
> buffertls_connect().
Although I cannot reproduce the crash anymore, we should start TLS
after the connect has finished. Call the TLS connect callback when
the connected socket is writable.
ok?
bluhm
Index: usr.sbin/syslogd/evbuffer_tls.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/syslogd/evbuffer_tls.c,v
retrieving revision 1.1
diff -u -p -r1.1 evbuffer_tls.c
--- usr.sbin/syslogd/evbuffer_tls.c 18 Jan 2015 19:37:59 -0000 1.1
+++ usr.sbin/syslogd/evbuffer_tls.c 28 Jan 2015 21:05:20 -0000
@@ -287,7 +287,8 @@ buffertls_connect(struct buffertls *buft
event_del(&bufev->ev_write);
buftls->bt_hostname = hostname;
- buffertls_connectcb(fd, 0, buftls);
+ event_set(&bufev->ev_write, fd, EV_WRITE, buffertls_connectcb, buftls);
+ bufferevent_add(&bufev->ev_write, bufev->timeout_write);
}
/*