43
37
</tr></table></div>
44
38
<div class="refsynopsisdiv" title="Synopsis">
45
39
<a name="gnutls-extra.synopsis"></a><h2>Synopsis</h2>
46
<pre class="synopsis">
47
#define <a class="link" href="gnutls-extra.html#GNUTLS-EXTRA-VERSION--CAPS" title="GNUTLS_EXTRA_VERSION">GNUTLS_EXTRA_VERSION</a>
40
<pre class="synopsis">#define <a class="link" href="gnutls-extra.html#GNUTLS-EXTRA-VERSION:CAPS" title="GNUTLS_EXTRA_VERSION">GNUTLS_EXTRA_VERSION</a>
48
41
enum <a class="link" href="gnutls-extra.html#gnutls-ia-apptype-t" title="enum gnutls_ia_apptype_t">gnutls_ia_apptype_t</a>;
49
int (<a class="link" href="gnutls-extra.html#gnutls-ia-avp-func" title="gnutls_ia_avp_func ()">*gnutls_ia_avp_func</a>) (<a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t">gnutls_session_t</a> session,
55
void <a class="link" href="gnutls-extra.html#gnutls-ia-free-client-credentials" title="gnutls_ia_free_client_credentials ()">gnutls_ia_free_client_credentials</a> (gnutls_ia_client_credentials_t sc);
56
int <a class="link" href="gnutls-extra.html#gnutls-ia-allocate-client-credentials" title="gnutls_ia_allocate_client_credentials ()">gnutls_ia_allocate_client_credentials</a>
57
(gnutls_ia_client_credentials_t *sc);
58
void <a class="link" href="gnutls-extra.html#gnutls-ia-free-server-credentials" title="gnutls_ia_free_server_credentials ()">gnutls_ia_free_server_credentials</a> (gnutls_ia_server_credentials_t sc);
59
int <a class="link" href="gnutls-extra.html#gnutls-ia-allocate-server-credentials" title="gnutls_ia_allocate_server_credentials ()">gnutls_ia_allocate_server_credentials</a>
60
(gnutls_ia_server_credentials_t *sc);
61
void <a class="link" href="gnutls-extra.html#gnutls-ia-set-client-avp-function" title="gnutls_ia_set_client_avp_function ()">gnutls_ia_set_client_avp_function</a> (gnutls_ia_client_credentials_t cred,
62
<a class="link" href="gnutls-extra.html#gnutls-ia-avp-func" title="gnutls_ia_avp_func ()">gnutls_ia_avp_func</a> avp_func);
63
void <a class="link" href="gnutls-extra.html#gnutls-ia-set-client-avp-ptr" title="gnutls_ia_set_client_avp_ptr ()">gnutls_ia_set_client_avp_ptr</a> (gnutls_ia_client_credentials_t cred,
65
void * <a class="link" href="gnutls-extra.html#gnutls-ia-get-client-avp-ptr" title="gnutls_ia_get_client_avp_ptr ()">gnutls_ia_get_client_avp_ptr</a> (gnutls_ia_client_credentials_t cred);
66
void <a class="link" href="gnutls-extra.html#gnutls-ia-set-server-avp-function" title="gnutls_ia_set_server_avp_function ()">gnutls_ia_set_server_avp_function</a> (gnutls_ia_server_credentials_t cred,
67
<a class="link" href="gnutls-extra.html#gnutls-ia-avp-func" title="gnutls_ia_avp_func ()">gnutls_ia_avp_func</a> avp_func);
68
void <a class="link" href="gnutls-extra.html#gnutls-ia-set-server-avp-ptr" title="gnutls_ia_set_server_avp_ptr ()">gnutls_ia_set_server_avp_ptr</a> (gnutls_ia_server_credentials_t cred,
70
void * <a class="link" href="gnutls-extra.html#gnutls-ia-get-server-avp-ptr" title="gnutls_ia_get_server_avp_ptr ()">gnutls_ia_get_server_avp_ptr</a> (gnutls_ia_server_credentials_t cred);
71
int <a class="link" href="gnutls-extra.html#gnutls-ia-handshake-p" title="gnutls_ia_handshake_p ()">gnutls_ia_handshake_p</a> (<a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t">gnutls_session_t</a> session);
72
int <a class="link" href="gnutls-extra.html#gnutls-ia-handshake" title="gnutls_ia_handshake ()">gnutls_ia_handshake</a> (<a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t">gnutls_session_t</a> session);
73
int <a class="link" href="gnutls-extra.html#gnutls-ia-permute-inner-secret" title="gnutls_ia_permute_inner_secret ()">gnutls_ia_permute_inner_secret</a> (<a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t">gnutls_session_t</a> session,
74
size_t session_keys_size,
75
const char *session_keys);
76
int <a class="link" href="gnutls-extra.html#gnutls-ia-endphase-send" title="gnutls_ia_endphase_send ()">gnutls_ia_endphase_send</a> (<a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t">gnutls_session_t</a> session,
78
int <a class="link" href="gnutls-extra.html#gnutls-ia-verify-endphase" title="gnutls_ia_verify_endphase ()">gnutls_ia_verify_endphase</a> (<a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t">gnutls_session_t</a> session,
79
const char *checksum);
80
ssize_t <a class="link" href="gnutls-extra.html#gnutls-ia-send" title="gnutls_ia_send ()">gnutls_ia_send</a> (<a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t">gnutls_session_t</a> session,
83
ssize_t <a class="link" href="gnutls-extra.html#gnutls-ia-recv" title="gnutls_ia_recv ()">gnutls_ia_recv</a> (<a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t">gnutls_session_t</a> session,
86
int <a class="link" href="gnutls-extra.html#gnutls-ia-generate-challenge" title="gnutls_ia_generate_challenge ()">gnutls_ia_generate_challenge</a> (<a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t">gnutls_session_t</a> session,
89
void <a class="link" href="gnutls-extra.html#gnutls-ia-extract-inner-secret" title="gnutls_ia_extract_inner_secret ()">gnutls_ia_extract_inner_secret</a> (<a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t">gnutls_session_t</a> session,
91
void <a class="link" href="gnutls-extra.html#gnutls-ia-enable" title="gnutls_ia_enable ()">gnutls_ia_enable</a> (<a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t">gnutls_session_t</a> session,
92
int allow_skip_on_resume);
93
int <a class="link" href="gnutls-extra.html#gnutls-global-init-extra" title="gnutls_global_init_extra ()">gnutls_global_init_extra</a> (void);
94
int <a class="link" href="gnutls-extra.html#gnutls-register-md5-handler" title="gnutls_register_md5_handler ()">gnutls_register_md5_handler</a> (void);
95
const char * <a class="link" href="gnutls-extra.html#gnutls-extra-check-version" title="gnutls_extra_check_version ()">gnutls_extra_check_version</a> (const char *req_version);
42
<a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a> (<a class="link" href="gnutls-extra.html#gnutls-ia-avp-func" title="gnutls_ia_avp_func ()">*gnutls_ia_avp_func</a>) (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> session</code></em>,
43
<em class="parameter"><code><span class="type">void</span> *ptr</code></em>,
44
<em class="parameter"><code>const <span class="type">char</span> *last</code></em>,
45
<em class="parameter"><code><span class="type">size_t</span> lastlen</code></em>,
46
<em class="parameter"><code><span class="type">char</span> **next</code></em>,
47
<em class="parameter"><code><span class="type">size_t</span> *nextlen</code></em>);
48
<span class="returnvalue">void</span> <a class="link" href="gnutls-extra.html#gnutls-ia-free-client-credentials" title="gnutls_ia_free_client_credentials ()">gnutls_ia_free_client_credentials</a> (<em class="parameter"><code><span class="type">gnutls_ia_client_credentials_t</span> sc</code></em>);
49
<a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a> <a class="link" href="gnutls-extra.html#gnutls-ia-allocate-client-credentials" title="gnutls_ia_allocate_client_credentials ()">gnutls_ia_allocate_client_credentials</a>
50
(<em class="parameter"><code><span class="type">gnutls_ia_client_credentials_t</span> *sc</code></em>);
51
<span class="returnvalue">void</span> <a class="link" href="gnutls-extra.html#gnutls-ia-free-server-credentials" title="gnutls_ia_free_server_credentials ()">gnutls_ia_free_server_credentials</a> (<em class="parameter"><code><span class="type">gnutls_ia_server_credentials_t</span> sc</code></em>);
52
<a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a> <a class="link" href="gnutls-extra.html#gnutls-ia-allocate-server-credentials" title="gnutls_ia_allocate_server_credentials ()">gnutls_ia_allocate_server_credentials</a>
53
(<em class="parameter"><code><span class="type">gnutls_ia_server_credentials_t</span> *sc</code></em>);
54
<span class="returnvalue">void</span> <a class="link" href="gnutls-extra.html#gnutls-ia-set-client-avp-function" title="gnutls_ia_set_client_avp_function ()">gnutls_ia_set_client_avp_function</a> (<em class="parameter"><code><span class="type">gnutls_ia_client_credentials_t</span> cred</code></em>,
55
<em class="parameter"><code><a class="link" href="gnutls-extra.html#gnutls-ia-avp-func" title="gnutls_ia_avp_func ()"><span class="type">gnutls_ia_avp_func</span></a> avp_func</code></em>);
56
<span class="returnvalue">void</span> <a class="link" href="gnutls-extra.html#gnutls-ia-set-client-avp-ptr" title="gnutls_ia_set_client_avp_ptr ()">gnutls_ia_set_client_avp_ptr</a> (<em class="parameter"><code><span class="type">gnutls_ia_client_credentials_t</span> cred</code></em>,
57
<em class="parameter"><code><span class="type">void</span> *ptr</code></em>);
58
<span class="returnvalue">void</span> * <a class="link" href="gnutls-extra.html#gnutls-ia-get-client-avp-ptr" title="gnutls_ia_get_client_avp_ptr ()">gnutls_ia_get_client_avp_ptr</a> (<em class="parameter"><code><span class="type">gnutls_ia_client_credentials_t</span> cred</code></em>);
59
<span class="returnvalue">void</span> <a class="link" href="gnutls-extra.html#gnutls-ia-set-server-avp-function" title="gnutls_ia_set_server_avp_function ()">gnutls_ia_set_server_avp_function</a> (<em class="parameter"><code><span class="type">gnutls_ia_server_credentials_t</span> cred</code></em>,
60
<em class="parameter"><code><a class="link" href="gnutls-extra.html#gnutls-ia-avp-func" title="gnutls_ia_avp_func ()"><span class="type">gnutls_ia_avp_func</span></a> avp_func</code></em>);
61
<span class="returnvalue">void</span> <a class="link" href="gnutls-extra.html#gnutls-ia-set-server-avp-ptr" title="gnutls_ia_set_server_avp_ptr ()">gnutls_ia_set_server_avp_ptr</a> (<em class="parameter"><code><span class="type">gnutls_ia_server_credentials_t</span> cred</code></em>,
62
<em class="parameter"><code><span class="type">void</span> *ptr</code></em>);
63
<span class="returnvalue">void</span> * <a class="link" href="gnutls-extra.html#gnutls-ia-get-server-avp-ptr" title="gnutls_ia_get_server_avp_ptr ()">gnutls_ia_get_server_avp_ptr</a> (<em class="parameter"><code><span class="type">gnutls_ia_server_credentials_t</span> cred</code></em>);
64
<a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a> <a class="link" href="gnutls-extra.html#gnutls-ia-handshake-p" title="gnutls_ia_handshake_p ()">gnutls_ia_handshake_p</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> session</code></em>);
65
<a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a> <a class="link" href="gnutls-extra.html#gnutls-ia-handshake" title="gnutls_ia_handshake ()">gnutls_ia_handshake</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> session</code></em>);
66
<a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a> <a class="link" href="gnutls-extra.html#gnutls-ia-permute-inner-secret" title="gnutls_ia_permute_inner_secret ()">gnutls_ia_permute_inner_secret</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> session</code></em>,
67
<em class="parameter"><code><span class="type">size_t</span> session_keys_size</code></em>,
68
<em class="parameter"><code>const <span class="type">char</span> *session_keys</code></em>);
69
<a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a> <a class="link" href="gnutls-extra.html#gnutls-ia-endphase-send" title="gnutls_ia_endphase_send ()">gnutls_ia_endphase_send</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> session</code></em>,
70
<em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> final_p</code></em>);
71
<a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a> <a class="link" href="gnutls-extra.html#gnutls-ia-verify-endphase" title="gnutls_ia_verify_endphase ()">gnutls_ia_verify_endphase</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> session</code></em>,
72
<em class="parameter"><code>const <span class="type">char</span> *checksum</code></em>);
73
<span class="returnvalue">ssize_t</span> <a class="link" href="gnutls-extra.html#gnutls-ia-send" title="gnutls_ia_send ()">gnutls_ia_send</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> session</code></em>,
74
<em class="parameter"><code>const <span class="type">char</span> *data</code></em>,
75
<em class="parameter"><code><span class="type">size_t</span> sizeofdata</code></em>);
76
<span class="returnvalue">ssize_t</span> <a class="link" href="gnutls-extra.html#gnutls-ia-recv" title="gnutls_ia_recv ()">gnutls_ia_recv</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> session</code></em>,
77
<em class="parameter"><code><span class="type">char</span> *data</code></em>,
78
<em class="parameter"><code><span class="type">size_t</span> sizeofdata</code></em>);
79
<a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a> <a class="link" href="gnutls-extra.html#gnutls-ia-generate-challenge" title="gnutls_ia_generate_challenge ()">gnutls_ia_generate_challenge</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> session</code></em>,
80
<em class="parameter"><code><span class="type">size_t</span> buffer_size</code></em>,
81
<em class="parameter"><code><span class="type">char</span> *buffer</code></em>);
82
<span class="returnvalue">void</span> <a class="link" href="gnutls-extra.html#gnutls-ia-extract-inner-secret" title="gnutls_ia_extract_inner_secret ()">gnutls_ia_extract_inner_secret</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> session</code></em>,
83
<em class="parameter"><code><span class="type">char</span> *buffer</code></em>);
84
<span class="returnvalue">void</span> <a class="link" href="gnutls-extra.html#gnutls-ia-enable" title="gnutls_ia_enable ()">gnutls_ia_enable</a> (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> session</code></em>,
85
<em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> allow_skip_on_resume</code></em>);
86
<a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a> <a class="link" href="gnutls-extra.html#gnutls-global-init-extra" title="gnutls_global_init_extra ()">gnutls_global_init_extra</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
87
<a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a> <a class="link" href="gnutls-extra.html#gnutls-register-md5-handler" title="gnutls_register_md5_handler ()">gnutls_register_md5_handler</a> (<em class="parameter"><code><span class="type">void</span></code></em>);
88
const <span class="returnvalue">char</span> * <a class="link" href="gnutls-extra.html#gnutls-extra-check-version" title="gnutls_extra_check_version ()">gnutls_extra_check_version</a> (<em class="parameter"><code>const <span class="type">char</span> *req_version</code></em>);
98
91
<div class="refsect1" title="Description">
280
247
<div class="refsect2" title="gnutls_ia_set_client_avp_function ()">
281
248
<a name="gnutls-ia-set-client-avp-function"></a><h3>gnutls_ia_set_client_avp_function ()</h3>
282
<pre class="programlisting">void gnutls_ia_set_client_avp_function (gnutls_ia_client_credentials_t cred,
283
<a class="link" href="gnutls-extra.html#gnutls-ia-avp-func" title="gnutls_ia_avp_func ()">gnutls_ia_avp_func</a> avp_func);</pre>
285
Set the TLS/IA AVP callback handler used for the session.
288
The AVP callback is called to process AVPs received from the
289
server, and to get a new AVP to send to the server.
292
The callback's function form is:
293
int (*avp_func) (gnutls_session_t session, void *ptr,
294
const char *last, size_t lastlen,
295
char **next, size_t *nextlen);
298
The <em class="parameter"><code>session</code></em> parameter is the <a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> structure
299
corresponding to the current session. The <em class="parameter"><code>ptr</code></em> parameter is the
300
application hook pointer, set through
301
<a class="link" href="gnutls-extra.html#gnutls-ia-set-client-avp-ptr" title="gnutls_ia_set_client_avp_ptr ()"><code class="function">gnutls_ia_set_client_avp_ptr()</code></a>. The AVP received from the server
302
is present in <em class="parameter"><code>last</code></em> of <em class="parameter"><code>lastlen</code></em> size, which will be <code class="literal">NULL</code> on the
303
first invocation. The newly allocated output AVP to send to the
304
server should be placed in *<em class="parameter"><code>next</code></em> of *<em class="parameter"><code>nextlen</code></em> size.
307
The callback may invoke <a class="link" href="gnutls-extra.html#gnutls-ia-permute-inner-secret" title="gnutls_ia_permute_inner_secret ()"><code class="function">gnutls_ia_permute_inner_secret()</code></a> to mix any
308
generated session keys with the TLS/IA inner secret.
311
Return 0 (<code class="literal">GNUTLS_IA_APPLICATION_PAYLOAD</code>) on success, or a negative
312
error code to abort the TLS/IA handshake.
315
Note that the callback must use allocate the <em class="parameter"><code>next</code></em> parameter using
316
<a class="link" href="gnutls-gnutls.html#gnutls-malloc" title="gnutls_malloc"><code class="function">gnutls_malloc()</code></a>, because it is released via <a class="link" href="gnutls-gnutls.html#gnutls-free" title="gnutls_free"><code class="function">gnutls_free()</code></a> by the
317
TLS/IA handshake function.</p>
249
<pre class="programlisting"><span class="returnvalue">void</span> gnutls_ia_set_client_avp_function (<em class="parameter"><code><span class="type">gnutls_ia_client_credentials_t</span> cred</code></em>,
250
<em class="parameter"><code><a class="link" href="gnutls-extra.html#gnutls-ia-avp-func" title="gnutls_ia_avp_func ()"><span class="type">gnutls_ia_avp_func</span></a> avp_func</code></em>);</pre>
320
253
<div class="variablelist"><table border="0">
514
431
<div class="refsect2" title="gnutls_ia_permute_inner_secret ()">
515
432
<a name="gnutls-ia-permute-inner-secret"></a><h3>gnutls_ia_permute_inner_secret ()</h3>
516
<pre class="programlisting">int gnutls_ia_permute_inner_secret (<a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t">gnutls_session_t</a> session,
517
size_t session_keys_size,
518
const char *session_keys);</pre>
433
<pre class="programlisting"><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="returnvalue">int</span></a> gnutls_ia_permute_inner_secret (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> session</code></em>,
434
<em class="parameter"><code><span class="type">size_t</span> session_keys_size</code></em>,
435
<em class="parameter"><code>const <span class="type">char</span> *session_keys</code></em>);</pre>
520
437
Permute the inner secret using the generated session keys.
523
440
This can be called in the TLS/IA AVP callback to mix any generated
524
441
session keys with the TLS/IA inner secret.</p>
527
442
<div class="variablelist"><table border="0">
528
443
<col align="left" valign="top">
531
446
<td><p><span class="term"><em class="parameter"><code>session</code></em> :</span></p></td>
532
<td> is a <a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> structure.
447
<td>is a <a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> structure.
536
451
<td><p><span class="term"><em class="parameter"><code>session_keys_size</code></em> :</span></p></td>
537
<td> Size of generated session keys (0 if none).
452
<td>Size of generated session keys (0 if none).
541
456
<td><p><span class="term"><em class="parameter"><code>session_keys</code></em> :</span></p></td>
542
<td> Generated session keys, used to permute inner secret
457
<td>Generated session keys, used to permute inner secret
603
516
This function is called when <a class="link" href="gnutls-extra.html#gnutls-ia-recv" title="gnutls_ia_recv ()"><code class="function">gnutls_ia_recv()</code></a> return
604
<a class="link" href="gnutls-gnutls.html#GNUTLS-E-WARNING-IA-IPHF-RECEIVED--CAPS" title="GNUTLS_E_WARNING_IA_IPHF_RECEIVED"><code class="literal">GNUTLS_E_WARNING_IA_IPHF_RECEIVED</code></a> or
605
<a class="link" href="gnutls-gnutls.html#GNUTLS-E-WARNING-IA-FPHF-RECEIVED--CAPS" title="GNUTLS_E_WARNING_IA_FPHF_RECEIVED"><code class="literal">GNUTLS_E_WARNING_IA_FPHF_RECEIVED</code></a>.</p>
517
<a class="link" href="gnutls-gnutls.html#GNUTLS-E-WARNING-IA-IPHF-RECEIVED:CAPS" title="GNUTLS_E_WARNING_IA_IPHF_RECEIVED"><code class="literal">GNUTLS_E_WARNING_IA_IPHF_RECEIVED</code></a> or
518
<a class="link" href="gnutls-gnutls.html#GNUTLS-E-WARNING-IA-FPHF-RECEIVED:CAPS" title="GNUTLS_E_WARNING_IA_FPHF_RECEIVED"><code class="literal">GNUTLS_E_WARNING_IA_FPHF_RECEIVED</code></a>.</p>
608
519
<div class="variablelist"><table border="0">
609
520
<col align="left" valign="top">
612
523
<td><p><span class="term"><em class="parameter"><code>session</code></em> :</span></p></td>
613
<td> is a <a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> structure.
524
<td>is a <a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> structure.
617
528
<td><p><span class="term"><em class="parameter"><code>checksum</code></em> :</span></p></td>
618
<td> 12-byte checksum data, received from <a class="link" href="gnutls-extra.html#gnutls-ia-recv" title="gnutls_ia_recv ()"><code class="function">gnutls_ia_recv()</code></a>.
529
<td>12-byte checksum data, received from <a class="link" href="gnutls-extra.html#gnutls-ia-recv" title="gnutls_ia_recv ()"><code class="function">gnutls_ia_recv()</code></a>.
622
533
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
623
534
<td> Return 0 on successful verification, or an error
624
535
code. If the checksum verification of the end phase message fails,
625
<a class="link" href="gnutls-gnutls.html#GNUTLS-E-IA-VERIFY-FAILED--CAPS" title="GNUTLS_E_IA_VERIFY_FAILED"><code class="literal">GNUTLS_E_IA_VERIFY_FAILED</code></a> is returned.
536
<a class="link" href="gnutls-gnutls.html#GNUTLS-E-IA-VERIFY-FAILED:CAPS" title="GNUTLS_E_IA_VERIFY_FAILED"><code class="literal">GNUTLS_E_IA_VERIFY_FAILED</code></a> is returned.
632
543
<div class="refsect2" title="gnutls_ia_send ()">
633
544
<a name="gnutls-ia-send"></a><h3>gnutls_ia_send ()</h3>
634
<pre class="programlisting">ssize_t gnutls_ia_send (<a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t">gnutls_session_t</a> session,
636
size_t sizeofdata);</pre>
638
Send TLS/IA application payload data. This function has the
639
similar semantics with <code class="function">send()</code>. The only difference is that it
640
accepts a GnuTLS session, and uses different error codes.
643
The TLS/IA protocol is synchronous, so you cannot send more than
644
one packet at a time. The client always send the first packet.
647
To finish an application phase in the server, use
648
<a class="link" href="gnutls-extra.html#gnutls-ia-endphase-send" title="gnutls_ia_endphase_send ()"><code class="function">gnutls_ia_endphase_send()</code></a>. The client cannot end an application
649
phase unilaterally; rather, a client is required to respond with an
650
endphase of its own if gnutls_ia_recv indicates that the server has
654
If the EINTR is returned by the internal push function (the default
655
is <code class="function">send()</code>} then <a class="link" href="gnutls-gnutls.html#GNUTLS-E-INTERRUPTED--CAPS" title="GNUTLS_E_INTERRUPTED"><code class="literal">GNUTLS_E_INTERRUPTED</code></a> will be returned. If
656
<a class="link" href="gnutls-gnutls.html#GNUTLS-E-INTERRUPTED--CAPS" title="GNUTLS_E_INTERRUPTED"><code class="literal">GNUTLS_E_INTERRUPTED</code></a> or <a class="link" href="gnutls-gnutls.html#GNUTLS-E-AGAIN--CAPS" title="GNUTLS_E_AGAIN"><code class="literal">GNUTLS_E_AGAIN</code></a> is returned, you must call
657
this function again, with the same parameters; alternatively you
658
could provide a <code class="literal">NULL</code> pointer for data, and 0 for size.</p>
545
<pre class="programlisting"><span class="returnvalue">ssize_t</span> gnutls_ia_send (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> session</code></em>,
546
<em class="parameter"><code>const <span class="type">char</span> *data</code></em>,
547
<em class="parameter"><code><span class="type">size_t</span> sizeofdata</code></em>);</pre>
661
550
<div class="variablelist"><table border="0">
688
577
<div class="refsect2" title="gnutls_ia_recv ()">
689
578
<a name="gnutls-ia-recv"></a><h3>gnutls_ia_recv ()</h3>
690
<pre class="programlisting">ssize_t gnutls_ia_recv (<a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t">gnutls_session_t</a> session,
692
size_t sizeofdata);</pre>
694
Receive TLS/IA data. This function has the similar semantics with
695
<code class="function">recv()</code>. The only difference is that it accepts a GnuTLS session,
696
and uses different error codes.
699
If the server attempt to finish an application phase, this function
700
will return <a class="link" href="gnutls-gnutls.html#GNUTLS-E-WARNING-IA-IPHF-RECEIVED--CAPS" title="GNUTLS_E_WARNING_IA_IPHF_RECEIVED"><code class="literal">GNUTLS_E_WARNING_IA_IPHF_RECEIVED</code></a> or
701
<a class="link" href="gnutls-gnutls.html#GNUTLS-E-WARNING-IA-FPHF-RECEIVED--CAPS" title="GNUTLS_E_WARNING_IA_FPHF_RECEIVED"><code class="literal">GNUTLS_E_WARNING_IA_FPHF_RECEIVED</code></a>. The caller should then invoke
702
<a class="link" href="gnutls-extra.html#gnutls-ia-verify-endphase" title="gnutls_ia_verify_endphase ()"><code class="function">gnutls_ia_verify_endphase()</code></a>, and if it runs the client side, also
703
send an endphase message of its own using gnutls_ia_endphase_send.
706
If EINTR is returned by the internal push function (the default is
707
<em class="parameter"><code>code</code></em>{<code class="function">recv()</code>}) then GNUTLS_E_INTERRUPTED will be returned. If
708
GNUTLS_E_INTERRUPTED or GNUTLS_E_AGAIN is returned, you must call
709
this function again, with the same parameters; alternatively you
710
could provide a NULL pointer for data, and 0 for size.</p>
579
<pre class="programlisting"><span class="returnvalue">ssize_t</span> gnutls_ia_recv (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> session</code></em>,
580
<em class="parameter"><code><span class="type">char</span> *data</code></em>,
581
<em class="parameter"><code><span class="type">size_t</span> sizeofdata</code></em>);</pre>
713
584
<div class="variablelist"><table border="0">
816
679
<div class="refsect2" title="gnutls_ia_enable ()">
817
680
<a name="gnutls-ia-enable"></a><h3>gnutls_ia_enable ()</h3>
818
<pre class="programlisting">void gnutls_ia_enable (<a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t">gnutls_session_t</a> session,
819
int allow_skip_on_resume);</pre>
821
Specify whether we must advertise support for the TLS/IA extension
822
during the handshake.
825
At the client side, we always advertise TLS/IA if gnutls_ia_enable
826
was called before the handshake; at the server side, we also
827
require that the client has advertised that it wants to run TLS/IA
828
before including the advertisement, as required by the protocol.
831
Similarly, at the client side we always advertise that we allow
832
TLS/IA to be skipped for resumed sessions if <em class="parameter"><code>allow_skip_on_resume</code></em>
833
is non-zero; at the server side, we also require that the session
834
is indeed resumable and that the client has also advertised that it
835
allows TLS/IA to be skipped for resumed sessions.
838
After the TLS handshake, call <a class="link" href="gnutls-extra.html#gnutls-ia-handshake-p" title="gnutls_ia_handshake_p ()"><code class="function">gnutls_ia_handshake_p()</code></a> to find out
839
whether both parties agreed to do a TLS/IA handshake, before
840
calling <a class="link" href="gnutls-extra.html#gnutls-ia-handshake" title="gnutls_ia_handshake ()"><code class="function">gnutls_ia_handshake()</code></a> or one of the lower level gnutls_ia_*
681
<pre class="programlisting"><span class="returnvalue">void</span> gnutls_ia_enable (<em class="parameter"><code><a class="link" href="gnutls-gnutls.html#gnutls-session-t" title="gnutls_session_t"><span class="type">gnutls_session_t</span></a> session</code></em>,
682
<em class="parameter"><code><a class="link" href="gnutls-crypto.html#int" title="int ()"><span class="type">int</span></a> allow_skip_on_resume</code></em>);</pre>
844
685
<div class="variablelist"><table border="0">