| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
@deftypefun {int} {gnutls_prf_early} (gnutls_session_t @var{session}, size_t @var{label_size}, const char * @var{label}, size_t @var{context_size}, const char * @var{context}, size_t @var{outsize}, char * @var{out}) |
| 6 |
@var{session}: is a @code{gnutls_session_t} type. |
| 7 |
|
| 8 |
@var{label_size}: length of the @code{label} variable. |
| 9 |
|
| 10 |
@var{label}: label used in PRF computation, typically a short string. |
| 11 |
|
| 12 |
@var{context_size}: length of the @code{extra} variable. |
| 13 |
|
| 14 |
@var{context}: optional extra data to seed the PRF with. |
| 15 |
|
| 16 |
@var{outsize}: size of pre-allocated output buffer to hold the output. |
| 17 |
|
| 18 |
@var{out}: pre-allocated buffer to hold the generated data. |
| 19 |
|
| 20 |
This function is similar to @code{gnutls_prf_rfc5705()} , but only works in |
| 21 |
TLS 1.3 or later to export early keying material. |
| 22 |
|
| 23 |
Note that the keying material is only available after the |
| 24 |
ClientHello message is processed and before the application traffic |
| 25 |
keys are established. Therefore this function shall be called in a |
| 26 |
handshake hook function for @code{GNUTLS_HANDSHAKE_CLIENT_HELLO} . |
| 27 |
|
| 28 |
The @code{label} variable usually contains a string denoting the purpose |
| 29 |
for the generated data. |
| 30 |
|
| 31 |
The @code{context} variable can be used to add more data to the seed, after |
| 32 |
the random variables. It can be used to make sure the |
| 33 |
generated output is strongly connected to some additional data |
| 34 |
(e.g., a string used in user authentication). |
| 35 |
|
| 36 |
The output is placed in @code{out} , which must be pre-allocated. |
| 37 |
|
| 38 |
Note that, to provide the RFC5705 context, the @code{context} variable |
| 39 |
must be non-null. |
| 40 |
|
| 41 |
@strong{Returns:} @code{GNUTLS_E_SUCCESS} on success, or an error code. |
| 42 |
|
| 43 |
@strong{Since:} 3.6.8 |
| 44 |
@end deftypefun |