summaryrefslogtreecommitdiff
path: root/lib/handshake-tls13.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2018-05-14 16:05:27 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2018-05-26 04:12:04 +0000
commit34620f5b9291f5afb56012e04302df6006b7faf5 (patch)
treec929880d8a6372758957a48157efc39f79d9375e /lib/handshake-tls13.c
parent87ce20ec7f43a1f90bea8d931f77422ddd94b951 (diff)
downloadgnutls-34620f5b9291f5afb56012e04302df6006b7faf5.tar.gz
handshake: TLS1.3 async messages trigger the handshake hook
That is, the callback set with gnutls_handshake_set_hook_function() is now called even on the async handshake messages received under TLS1.3, such as key update, etc. Resolves #441 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'lib/handshake-tls13.c')
-rw-r--r--lib/handshake-tls13.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/handshake-tls13.c b/lib/handshake-tls13.c
index 427392b6f3..ef7862f9e2 100644
--- a/lib/handshake-tls13.c
+++ b/lib/handshake-tls13.c
@@ -430,6 +430,10 @@ _gnutls13_recv_async_handshake(gnutls_session_t session, gnutls_buffer_st *buf)
if (ret < 0)
return gnutls_assert_val(ret);
+ ret = _gnutls_call_hook_func(session, type, GNUTLS_HOOK_PRE, 1, buf->data, buf->length);
+ if (ret < 0)
+ return gnutls_assert_val(ret);
+
switch(type) {
case GNUTLS_HANDSHAKE_CERTIFICATE_REQUEST:
if (!(session->security_parameters.entity == GNUTLS_CLIENT) ||
@@ -474,6 +478,10 @@ _gnutls13_recv_async_handshake(gnutls_session_t session, gnutls_buffer_st *buf)
return GNUTLS_E_UNEXPECTED_PACKET;
}
+ ret = _gnutls_call_hook_func(session, type, GNUTLS_HOOK_POST, 1, buf->data, buf->length);
+ if (ret < 0)
+ return gnutls_assert_val(ret);
+
return 0;
}