1gnutls_handshake_set_hook_function(3)gnutlsgnutls_handshake_set_hook_function(3)
2
3
4

NAME

6       gnutls_handshake_set_hook_function - API function
7

SYNOPSIS

9       #include <gnutls/gnutls.h>
10
11       void  gnutls_handshake_set_hook_function(gnutls_session_t  session, un‐
12       signed int htype, int when, gnutls_handshake_hook_func func);
13

ARGUMENTS

15       gnutls_session_t session
16                   is a gnutls_session_t type
17
18       unsigned int htype
19                   the gnutls_handshake_description_t of the message  to  hook
20                   at
21
22       int when    GNUTLS_HOOK_* depending on when the hook function should be
23                   called
24
25       gnutls_handshake_hook_func func
26                   is the function to be called
27

DESCRIPTION

29       This function will set a callback to be  called  after  or  before  the
30       specified  handshake  message has been received or generated. This is a
31       generalization of gnutls_handshake_set_post_client_hello_function().
32
33       To call the hook function prior to the message being generated or  pro‐
34       cessed use GNUTLS_HOOK_PRE as  when parameter, GNUTLS_HOOK_POST to call
35       after, and GNUTLS_HOOK_BOTH for both cases.
36
37       This callback must return 0 on success or a gnutls error code to termi‐
38       nate the handshake.
39
40       To  hook  at  all  handshake  messages  use  an   htype of GNUTLS_HAND‐
41       SHAKE_ANY.
42

WARNING

44       You should not use this function to terminate the  handshake  based  on
45       client  input  unless you know what you are doing. Before the handshake
46       is finished there is no way to know if there is a man-in-the-middle at‐
47       tack being performed.
48

REPORTING BUGS

50       Report bugs to <bugs@gnutls.org>.
51       Home page: https://www.gnutls.org
52
53
55       Copyright © 2001-2023 Free Software Foundation, Inc., and others.
56       Copying  and  distribution  of this file, with or without modification,
57       are permitted in any medium without royalty provided the copyright  no‐
58       tice and this notice are preserved.
59

SEE ALSO

61       The  full  documentation  for gnutls is maintained as a Texinfo manual.
62       If the /usr/share/doc/gnutls/ directory does not contain the HTML  form
63       visit
64
65       https://www.gnutls.org/manual/
66
67gnutls                               3.8.2gnutls_handshake_set_hook_function(3)
Impressum