summaryrefslogtreecommitdiff
path: root/src/lib/libssl/doc/SSL_CTX_set_psk_client_callback.3
diff options
context:
space:
mode:
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.365
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, \
14unsigned 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, \
20unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len)"
21.Fc
22.Sh DESCRIPTION
23A client application must provide a callback function which is called
24when the client is sending the ClientKeyExchange message to the server.
25.Pp
26The purpose of the callback function is to select the PSK identity and
27the pre-shared key to use during the connection setup phase.
28.Pp
29The callback is set using functions
30.Fn SSL_CTX_set_psk_client_callback
31or
32.Fn SSL_set_psk_client_callback .
33The callback function is given the connection in parameter
34.Fa ssl ,
35a
36.Dv NULL Ns
37-terminated PSK identity hint sent by the server in parameter
38.Fa hint ,
39a buffer
40.Fa identity
41of length
42.Fa max_identity_len
43bytes where the resulting
44.Dv NULL Ns
45-terminated identity is to be stored, and a buffer
46.Fa psk
47of
48length
49.Fa max_psk_len
50bytes where the resulting pre-shared key is to be stored.
51.Sh NOTES
52Note that parameter
53.Fa hint
54given to the callback may be
55.Dv NULL .
56.Sh RETURN VALUES
57Return values from the client callback are interpreted as follows:
58.Pp
59On success (callback found a PSK identity and a pre-shared key to use)
60the length (> 0) of
61.Fa psk
62in bytes is returned.
63.Pp
64Otherwise or on errors callback should return 0.
65In this case the connection setup fails.