diff options
author | jsing <> | 2015-09-14 12:29:16 +0000 |
---|---|---|
committer | jsing <> | 2015-09-14 12:29:16 +0000 |
commit | f861bb3b4f20cad63c964522d211fc74d292c839 (patch) | |
tree | d9e7087f85cb2eecaf2b0f3bb3c3af52e7665111 /src/lib/libtls/tls_internal.h | |
parent | 810729815324406169b00f976dceaf34caefadc0 (diff) | |
download | openbsd-f861bb3b4f20cad63c964522d211fc74d292c839.tar.gz openbsd-f861bb3b4f20cad63c964522d211fc74d292c839.tar.bz2 openbsd-f861bb3b4f20cad63c964522d211fc74d292c839.zip |
Expose EOF without close-notify via tls_close().
Make tls_read(3)/tls_write(3) follow read(2)/write(2) like semantics and
return 0 on EOF with and without close-notify. However, if we saw an EOF
from the underlying file descriptors without getting a close-notify, save
this and make it visible when tls_close(3) is called. This keeps the
semantics we want, but makes it possible to detect truncation at higher
layers, if necessary.
ok beck@ guenther@
Diffstat (limited to 'src/lib/libtls/tls_internal.h')
-rw-r--r-- | src/lib/libtls/tls_internal.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/libtls/tls_internal.h b/src/lib/libtls/tls_internal.h index d7878a75e3..320f1fbfaa 100644 --- a/src/lib/libtls/tls_internal.h +++ b/src/lib/libtls/tls_internal.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls_internal.h,v 1.22 2015/09/13 10:32:46 beck Exp $ */ | 1 | /* $OpenBSD: tls_internal.h,v 1.23 2015/09/14 12:29:16 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org> | 3 | * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org> |
4 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 4 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
@@ -62,7 +62,8 @@ struct tls_conninfo { | |||
62 | #define TLS_SERVER (1 << 1) | 62 | #define TLS_SERVER (1 << 1) |
63 | #define TLS_SERVER_CONN (1 << 2) | 63 | #define TLS_SERVER_CONN (1 << 2) |
64 | 64 | ||
65 | #define TLS_HANDSHAKE_COMPLETE (1 << 0) | 65 | #define TLS_EOF_NO_CLOSE_NOTIFY (1 << 0) |
66 | #define TLS_HANDSHAKE_COMPLETE (1 << 1) | ||
66 | 67 | ||
67 | struct tls { | 68 | struct tls { |
68 | struct tls_config *config; | 69 | struct tls_config *config; |