Make tls_close() more robust - do not rely on a close notify being received
authorjsing <jsing@openbsd.org>
Wed, 15 Apr 2015 16:05:23 +0000 (16:05 +0000)
committerjsing <jsing@openbsd.org>
Wed, 15 Apr 2015 16:05:23 +0000 (16:05 +0000)
commit6dce3cf345a9e84cda4253ff92667f2db1a35406
treee3915c4a4a03782ac5e5e5703c26631ef7539c8b
parent07ef56404148964208dd7718c5968975f88aa397
Make tls_close() more robust - do not rely on a close notify being received
from the other side and only return TLS_READ_AGAIN/TLS_WRITE_AGAIN if we
failed to send a close notify on a non-blocking socket.

Otherwise be more forceful and always shutdown/close the socket regardless
of other failures. Also do not consider ENOTCONN or ECONNRESET to be a
shutdown failure, since there are various situations where this can occur.

ok doug@ guenther@
lib/libtls/tls.c