summaryrefslogtreecommitdiff
path: root/lib/state.c
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2020-02-19 14:35:04 +0100
committerDaiki Ueno <dueno@redhat.com>2020-02-19 18:41:08 +0100
commitf48d5114d9a3d624ba82a8f38b654ea63dd34094 (patch)
treee5490233ed788b68348fd2b4a056bb76e865e724 /lib/state.c
parent8ab75b3cf7130ad7594b68c6ecba79b6e0c082d9 (diff)
downloadgnutls-tmp-record-write-callback.tar.gz
handshake: add functions to read/write handshake messages directlytmp-record-write-callback
This adds a couple of functions, gnutls_handshake_set_read_function() and gnutls_handshake_write(), to allow QUIC implementations to directly interact with the TLS state machine. Signed-off-by: Daiki Ueno <dueno@redhat.com>
Diffstat (limited to 'lib/state.c')
-rw-r--r--lib/state.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/state.c b/lib/state.c
index f33cd5a8bc..a26c1c7a2f 100644
--- a/lib/state.c
+++ b/lib/state.c
@@ -1419,6 +1419,23 @@ gnutls_handshake_set_hook_function(gnutls_session_t session,
}
/**
+ * gnutls_handshake_set_read_function:
+ * @session: is #gnutls_session_t type
+ * @func: is the function to be called
+ *
+ * This function will set a callback to be called when a handshake
+ * message is being sent.
+ *
+ * Since: 3.6.13
+ */
+void
+gnutls_handshake_set_read_function(gnutls_session_t session,
+ gnutls_handshake_read_func func)
+{
+ session->internals.read_func = func;
+}
+
+/**
* gnutls_record_get_state:
* @session: is a #gnutls_session_t type
* @read: if non-zero the read parameters are returned, otherwise the write