diff options
Diffstat (limited to 'src/lib/libssl/doc/SSL_CTX_set_psk_client_callback.3')
| -rw-r--r-- | src/lib/libssl/doc/SSL_CTX_set_psk_client_callback.3 | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/lib/libssl/doc/SSL_CTX_set_psk_client_callback.3 b/src/lib/libssl/doc/SSL_CTX_set_psk_client_callback.3 new file mode 100644 index 0000000000..9bd5c9c545 --- /dev/null +++ b/src/lib/libssl/doc/SSL_CTX_set_psk_client_callback.3 | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | .Dd $Mdocdate: October 12 2014 $ | ||
| 2 | .Dt SSL_CTX_SET_PSK_CLIENT_CALLBACK 3 | ||
| 3 | .Os | ||
| 4 | .Sh NAME | ||
| 5 | .Nm SSL_CTX_set_psk_client_callback , | ||
| 6 | .Nm SSL_set_psk_client_callback | ||
| 7 | .Nd set PSK client callback | ||
| 8 | .Sh SYNOPSIS | ||
| 9 | .In openssl/ssl.h | ||
| 10 | .Ft void | ||
| 11 | .Fo SSL_CTX_set_psk_client_callback | ||
| 12 | .Fa "SSL_CTX *ctx" | ||
| 13 | .Fa "unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, \ | ||
| 14 | unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len)" | ||
| 15 | .Fc | ||
| 16 | .Ft void | ||
| 17 | .Fo SSL_set_psk_client_callback | ||
| 18 | .Fa "SSL *ssl" | ||
| 19 | .Fa "unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, \ | ||
| 20 | unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len)" | ||
| 21 | .Fc | ||
| 22 | .Sh DESCRIPTION | ||
| 23 | A client application must provide a callback function which is called | ||
| 24 | when the client is sending the ClientKeyExchange message to the server. | ||
| 25 | .Pp | ||
| 26 | The purpose of the callback function is to select the PSK identity and | ||
| 27 | the pre-shared key to use during the connection setup phase. | ||
| 28 | .Pp | ||
| 29 | The callback is set using functions | ||
| 30 | .Fn SSL_CTX_set_psk_client_callback | ||
| 31 | or | ||
| 32 | .Fn SSL_set_psk_client_callback . | ||
| 33 | The callback function is given the connection in parameter | ||
| 34 | .Fa ssl , | ||
| 35 | a | ||
| 36 | .Dv NULL Ns | ||
| 37 | -terminated PSK identity hint sent by the server in parameter | ||
| 38 | .Fa hint , | ||
| 39 | a buffer | ||
| 40 | .Fa identity | ||
| 41 | of length | ||
| 42 | .Fa max_identity_len | ||
| 43 | bytes where the resulting | ||
| 44 | .Dv NULL Ns | ||
| 45 | -terminated identity is to be stored, and a buffer | ||
| 46 | .Fa psk | ||
| 47 | of | ||
| 48 | length | ||
| 49 | .Fa max_psk_len | ||
| 50 | bytes where the resulting pre-shared key is to be stored. | ||
| 51 | .Sh NOTES | ||
| 52 | Note that parameter | ||
| 53 | .Fa hint | ||
| 54 | given to the callback may be | ||
| 55 | .Dv NULL . | ||
| 56 | .Sh RETURN VALUES | ||
| 57 | Return values from the client callback are interpreted as follows: | ||
| 58 | .Pp | ||
| 59 | On success (callback found a PSK identity and a pre-shared key to use) | ||
| 60 | the length (> 0) of | ||
| 61 | .Fa psk | ||
| 62 | in bytes is returned. | ||
| 63 | .Pp | ||
| 64 | Otherwise or on errors callback should return 0. | ||
| 65 | In this case the connection setup fails. | ||
