]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/SSL_CTX_set_psk_client_callback.pod
Merge Nokia copyright notice into standard
[thirdparty/openssl.git] / doc / man3 / SSL_CTX_set_psk_client_callback.pod
CommitLineData
ddac1974
NL
1=pod
2
ddac1974
NL
3=head1 NAME
4
5SSL_CTX_set_psk_client_callback, SSL_set_psk_client_callback - set PSK client callback
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 void SSL_CTX_set_psk_client_callback(SSL_CTX *ctx,
e9b77246
BB
12 unsigned int (*callback)(SSL *ssl, const char *hint,
13 char *identity, unsigned int max_identity_len,
14 unsigned char *psk, unsigned int max_psk_len));
ddac1974 15 void SSL_set_psk_client_callback(SSL *ssl,
e9b77246
BB
16 unsigned int (*callback)(SSL *ssl, const char *hint,
17 char *identity, unsigned int max_identity_len,
18 unsigned char *psk, unsigned int max_psk_len));
ddac1974
NL
19
20
21=head1 DESCRIPTION
22
23A client application must provide a callback function which is called
24when the client is sending the ClientKeyExchange message to the server.
25
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
29The callback is set using functions SSL_CTX_set_psk_client_callback()
30or SSL_set_psk_client_callback(). The callback function is given the
31connection in parameter B<ssl>, a B<NULL>-terminated PSK identity hint
32sent by the server in parameter B<hint>, a buffer B<identity> of
b9b6a7e5 33length B<max_identity_len> bytes where the resulting
ddac1974
NL
34B<NULL>-terminated identity is to be stored, and a buffer B<psk> of
35length B<max_psk_len> bytes where the resulting pre-shared key is to
36be stored.
37
38=head1 NOTES
39
40Note that parameter B<hint> given to the callback may be B<NULL>.
41
42=head1 RETURN VALUES
43
44Return values from the client callback are interpreted as follows:
45
46On success (callback found a PSK identity and a pre-shared key to use)
47the length (> 0) of B<psk> in bytes is returned.
48
49Otherwise or on errors callback should return 0. In this case
50the connection setup fails.
51
e2f92610
RS
52=head1 COPYRIGHT
53
54Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
55
56Licensed under the OpenSSL license (the "License"). You may not use
57this file except in compliance with the License. You can obtain a copy
58in the file LICENSE in the source distribution or at
59L<https://www.openssl.org/source/license.html>.
60
e2f92610 61=cut