From f48d5114d9a3d624ba82a8f38b654ea63dd34094 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Wed, 19 Feb 2020 14:35:04 +0100 Subject: handshake: add functions to read/write handshake messages directly 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 --- lib/state.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/state.c') diff --git a/lib/state.c b/lib/state.c index f33cd5a8bc..a26c1c7a2f 100644 --- a/lib/state.c +++ b/lib/state.c @@ -1418,6 +1418,23 @@ gnutls_handshake_set_hook_function(gnutls_session_t session, session->internals.h_post = when; } +/** + * 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 -- cgit v1.2.1