summaryrefslogtreecommitdiff
path: root/lib/libtls/tls_internal.h
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2015-09-14 12:29:17 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2015-09-14 12:29:17 +0000
commitfddb2664a7cfd52519d99e70d9ece29dbe30ecf5 (patch)
tree973a6633046210689bcb00754764a5c18a7c23d2 /lib/libtls/tls_internal.h
parente7064847bafe6bbfabcccc0cb5aef9170f6452eb (diff)
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 'lib/libtls/tls_internal.h')
-rw-r--r--lib/libtls/tls_internal.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libtls/tls_internal.h b/lib/libtls/tls_internal.h
index d7878a75e32..320f1fbfaa0 100644
--- a/lib/libtls/tls_internal.h
+++ b/lib/libtls/tls_internal.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls_internal.h,v 1.22 2015/09/13 10:32:46 beck Exp $ */
+/* $OpenBSD: tls_internal.h,v 1.23 2015/09/14 12:29:16 jsing Exp $ */
/*
* Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org>
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
@@ -62,7 +62,8 @@ struct tls_conninfo {
#define TLS_SERVER (1 << 1)
#define TLS_SERVER_CONN (1 << 2)
-#define TLS_HANDSHAKE_COMPLETE (1 << 0)
+#define TLS_EOF_NO_CLOSE_NOTIFY (1 << 0)
+#define TLS_HANDSHAKE_COMPLETE (1 << 1)
struct tls {
struct tls_config *config;