Blame doc/functions/gnutls_handshake_set_hook_function

Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
Packit Service 4684c1
@deftypefun {void} {gnutls_handshake_set_hook_function} (gnutls_session_t @var{session}, unsigned int @var{htype}, int @var{when}, gnutls_handshake_hook_func @var{func})
Packit Service 4684c1
@var{session}: is a @code{gnutls_session_t}  type
Packit Service 4684c1
Packit Service 4684c1
@var{htype}: the @code{gnutls_handshake_description_t}  of the message to hook at
Packit Service 4684c1
Packit Service 4684c1
@var{when}: @code{GNUTLS_HOOK_} * depending on when the hook function should be called
Packit Service 4684c1
Packit Service 4684c1
@var{func}: is the function to be called
Packit Service 4684c1
Packit Service 4684c1
This function will set a callback to be called after or before the specified
Packit Service 4684c1
handshake message has been received or generated. This is a
Packit Service 4684c1
generalization of @code{gnutls_handshake_set_post_client_hello_function()} .
Packit Service 4684c1
Packit Service 4684c1
To call the hook function prior to the message being generated or processed
Packit Service 4684c1
use @code{GNUTLS_HOOK_PRE}  as  @code{when} parameter, @code{GNUTLS_HOOK_POST}  to call
Packit Service 4684c1
after, and @code{GNUTLS_HOOK_BOTH}  for both cases.
Packit Service 4684c1
Packit Service 4684c1
This callback must return 0 on success or a gnutls error code to
Packit Service 4684c1
terminate the handshake.
Packit Service 4684c1
Packit Service 4684c1
To hook at all handshake messages use an  @code{htype} of @code{GNUTLS_HANDSHAKE_ANY} .
Packit Service 4684c1
Packit Service 4684c1
@strong{Warning:} You should not use this function to terminate the
Packit Service 4684c1
handshake based on client input unless you know what you are
Packit Service 4684c1
doing. Before the handshake is finished there is no way to know if
Packit Service 4684c1
there is a man-in-the-middle attack being performed.
Packit Service 4684c1
@end deftypefun