summaryrefslogtreecommitdiff
path: root/src/lib/libssl/doc/SSL_CTX_use_psk_identity_hint.3
diff options
context:
space:
mode:
authorbentley <>2014-10-12 09:33:04 +0000
committerbentley <>2014-10-12 09:33:04 +0000
commit82b7f378b6907ab315a6e50322d2a0a8794a0aa9 (patch)
treea5087bf8d016a6041c2b6822fbecfd8f6c5e70b1 /src/lib/libssl/doc/SSL_CTX_use_psk_identity_hint.3
parent0a63f0cf49369e1926567ab62e04e3355cedf0cd (diff)
downloadopenbsd-82b7f378b6907ab315a6e50322d2a0a8794a0aa9.tar.gz
openbsd-82b7f378b6907ab315a6e50322d2a0a8794a0aa9.tar.bz2
openbsd-82b7f378b6907ab315a6e50322d2a0a8794a0aa9.zip
Convert libssl manpages from pod to mdoc(7).
libcrypto has not been started yet. ok schwarze@ miod@
Diffstat (limited to 'src/lib/libssl/doc/SSL_CTX_use_psk_identity_hint.3')
-rw-r--r--src/lib/libssl/doc/SSL_CTX_use_psk_identity_hint.3107
1 files changed, 107 insertions, 0 deletions
diff --git a/src/lib/libssl/doc/SSL_CTX_use_psk_identity_hint.3 b/src/lib/libssl/doc/SSL_CTX_use_psk_identity_hint.3
new file mode 100644
index 0000000000..4d4e8a6173
--- /dev/null
+++ b/src/lib/libssl/doc/SSL_CTX_use_psk_identity_hint.3
@@ -0,0 +1,107 @@
1.Dd $Mdocdate: October 12 2014 $
2.Dt SSL_CTX_USE_PSK_IDENTITY_HINT 3
3.Os
4.Sh NAME
5.Nm SSL_CTX_use_psk_identity_hint ,
6.Nm SSL_use_psk_identity_hint ,
7.Nm SSL_CTX_set_psk_server_callback ,
8.Nm SSL_set_psk_server_callback
9.Nd set PSK identity hint to use
10.Sh SYNOPSIS
11.In openssl/ssl.h
12.Ft int
13.Fn SSL_CTX_use_psk_identity_hint "SSL_CTX *ctx" "const char *hint"
14.Ft int
15.Fn SSL_use_psk_identity_hint "SSL *ssl" "const char *hint"
16.Ft void
17.Fo SSL_CTX_set_psk_server_callback
18.Fa "SSL_CTX *ctx"
19.Fa "unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len)"
20.Fc
21.Ft void
22.Fo SSL_set_psk_server_callback
23.Fa "SSL *ssl"
24.Fa "unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len)"
25.Fc
26.Sh DESCRIPTION
27.Fn SSL_CTX_use_psk_identity_hint
28sets the given
29.Dv NULL Ns
30-terminated PSK identity hint
31.Fa hint
32to SSL context object
33.Fa ctx .
34.Fn SSL_use_psk_identity_hint
35sets the given
36.Dv NULL Ns
37-terminated
38PSK identity hint
39.Fa hint
40to SSL connection object
41.Fa ssl .
42If
43.Fa hint
44is
45.Dv NULL
46the current hint from
47.Fa ctx
48or
49.Fa ssl
50is deleted.
51.Pp
52In the case where PSK identity hint is
53.Dv NULL ,
54the server does not send the
55.Em ServerKeyExchange
56message to the client.
57.Pp
58A server application must provide a callback function which is called when the
59server receives the
60.Em ClientKeyExchange
61message from the client.
62The purpose of the callback function is to validate the received PSK identity
63and to fetch the pre-shared key used during the connection setup phase.
64The callback is set using functions
65.Fn SSL_CTX_set_psk_server_callback
66or
67.Fn SSL_set_psk_server_callback .
68The callback function is given the connection in parameter
69.Fa ssl ,
70.Dv NULL Ns
71-terminated PSK identity sent by the client in parameter
72.Fa identity ,
73and a buffer
74.Fa psk
75of length
76.Fa max_psk_len
77bytes where the pre-shared key is to be stored.
78.Sh RETURN VALUES
79.Fn SSL_CTX_use_psk_identity_hint
80and
81.Fn SSL_use_psk_identity_hint
82return 1 on success, 0 otherwise.
83.Pp
84Return values from the server callback are interpreted as follows:
85.Bl -tag -width Ds
86.It >0
87PSK identity was found and the server callback has provided the PSK
88successfully in parameter
89.Fa psk .
90Return value is the length of
91.Fa psk
92in bytes.
93It is an error to return a value greater than
94.Fa max_psk_len .
95.Pp
96If the PSK identity was not found but the callback instructs the protocol to
97continue anyway, the callback must provide some random data to
98.Fa psk
99and return the length of the random data, so the connection will fail with
100.Dq decryption_error
101before it will be finished completely.
102.It 0
103PSK identity was not found.
104An
105.Dq unknown_psk_identity
106alert message will be sent and the connection setup fails.
107.El