| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
10.4 TLS Extension Handling
As with authentication methods, the TLS extensions handlers can be implemented using the interface shown below.
typedef int (*gnutls_ext_recv_func) (gnutls_session_t session,
const unsigned char *data, size_t len);
typedef int (*gnutls_ext_send_func) (gnutls_session_t session,
gnutls_buffer_st *extdata);
Here there are two functions, one for receiving the extension data and one for sending. These functions have to check internally whether they operate in client or server side.
A simple example of an extension handler can be seen in
ext/srp.c in GnuTLS’ source code. After implementing these functions,
together with the extension number they handle, they have to be registered
using _gnutls_ext_register in
gnutls_extensions.c typically within _gnutls_ext_init.
| 10.4.1 Adding a new TLS extension |
This document was generated on January 4, 2012 using texi2html 5.0.
