summaryrefslogtreecommitdiff
path: root/src/lib/libssl/doc/SSL_CTX_set_msg_callback.3
diff options
context:
space:
mode:
authorschwarze <>2016-11-05 15:32:20 +0000
committerschwarze <>2016-11-05 15:32:20 +0000
commit5af30545c000c195ca6e44f207da004e5780ddb5 (patch)
tree1672f1234352c29443fcacb44e22f1b20f174d99 /src/lib/libssl/doc/SSL_CTX_set_msg_callback.3
parentba7c6bac5d2c870a4d1c1ce9f08db5e57c660625 (diff)
downloadopenbsd-5af30545c000c195ca6e44f207da004e5780ddb5.tar.gz
openbsd-5af30545c000c195ca6e44f207da004e5780ddb5.tar.bz2
openbsd-5af30545c000c195ca6e44f207da004e5780ddb5.zip
move manual pages from doc/ to man/ for consistency with other
libraries, in particular considering that there are unrelated files in doc/; requested by jsing@ and beck@
Diffstat (limited to 'src/lib/libssl/doc/SSL_CTX_set_msg_callback.3')
-rw-r--r--src/lib/libssl/doc/SSL_CTX_set_msg_callback.3135
1 files changed, 0 insertions, 135 deletions
diff --git a/src/lib/libssl/doc/SSL_CTX_set_msg_callback.3 b/src/lib/libssl/doc/SSL_CTX_set_msg_callback.3
deleted file mode 100644
index c72f37ccd9..0000000000
--- a/src/lib/libssl/doc/SSL_CTX_set_msg_callback.3
+++ /dev/null
@@ -1,135 +0,0 @@
1.\"
2.\" $OpenBSD: SSL_CTX_set_msg_callback.3,v 1.3 2015/11/11 22:14:40 jmc Exp $
3.\"
4.Dd $Mdocdate: November 11 2015 $
5.Dt SSL_CTX_SET_MSG_CALLBACK 3
6.Os
7.Sh NAME
8.Nm SSL_CTX_set_msg_callback ,
9.Nm SSL_CTX_set_msg_callback_arg ,
10.Nm SSL_set_msg_callback ,
11.Nm SSL_set_msg_callback_arg
12.Nd install callback for observing protocol messages
13.Sh SYNOPSIS
14.In openssl/ssl.h
15.Ft void
16.Fo SSL_CTX_set_msg_callback
17.Fa "SSL_CTX *ctx"
18.Fa "void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)"
19.Fc
20.Ft void
21.Fn SSL_CTX_set_msg_callback_arg "SSL_CTX *ctx" "void *arg"
22.Ft void
23.Fo SSL_set_msg_callback
24.Fa "SSL *ssl"
25.Fa "void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)"
26.Fc
27.Ft void
28.Fn SSL_set_msg_callback_arg "SSL *ssl" "void *arg"
29.Sh DESCRIPTION
30.Fn SSL_CTX_set_msg_callback
31or
32.Fn SSL_set_msg_callback
33can be used to define a message callback function
34.Fa cb
35for observing all SSL/TLS protocol messages (such as handshake messages)
36that are received or sent.
37.Fn SSL_CTX_set_msg_callback_arg
38and
39.Fn SSL_set_msg_callback_arg
40can be used to set argument
41.Fa arg
42to the callback function, which is available for arbitrary application use.
43.Pp
44.Fn SSL_CTX_set_msg_callback
45and
46.Fn SSL_CTX_set_msg_callback_arg
47specify default settings that will be copied to new
48.Vt SSL
49objects by
50.Xr SSL_new 3 .
51.Fn SSL_set_msg_callback
52and
53.Fn SSL_set_msg_callback_arg
54modify the actual settings of an
55.Vt SSL
56object.
57Using a
58.Dv NULL
59pointer for
60.Fa cb
61disables the message callback.
62.Pp
63When
64.Fa cb
65is called by the SSL/TLS library for a protocol message,
66the function arguments have the following meaning:
67.Bl -tag -width Ds
68.It Fa write_p
69This flag is 0 when a protocol message has been received and 1 when a protocol
70message has been sent.
71.It Fa version
72The protocol version according to which the protocol message is
73interpreted by the library.
74Currently, this is one of
75.Dv SSL2_VERSION ,
76.Dv SSL3_VERSION
77and
78.Dv TLS1_VERSION
79(for SSL 2.0, SSL 3.0 and TLS 1.0, respectively).
80.It Fa content_type
81In the case of SSL 2.0, this is always 0.
82In the case of SSL 3.0 or TLS 1.0, this is one of the
83.Em ContentType
84values defined in the protocol specification
85.Po
86.Dq change_cipher_spec(20) ,
87.Dq alert(21) ,
88.Dq handshake(22) ;
89but never
90.Dq application_data(23)
91because the callback will only be called for protocol messages.
92.Pc
93.It Fa buf , Fa len
94.Fa buf
95points to a buffer containing the protocol message, which consists of
96.Fa len
97bytes.
98The buffer is no longer valid after the callback function has returned.
99.It Fa ssl
100The
101.Vt SSL
102object that received or sent the message.
103.It Fa arg
104The user-defined argument optionally defined by
105.Fn SSL_CTX_set_msg_callback_arg
106or
107.Fn SSL_set_msg_callback_arg .
108.El
109.Sh NOTES
110Protocol messages are passed to the callback function after decryption
111and fragment collection where applicable.
112(Thus record boundaries are not visible.)
113.Pp
114If processing a received protocol message results in an error,
115the callback function may not be called.
116For example, the callback function will never see messages that are considered
117too large to be processed.
118.Pp
119Due to automatic protocol version negotiation,
120.Fa version
121is not necessarily the protocol version used by the sender of the message:
122If a TLS 1.0 ClientHello message is received by an SSL 3.0-only server,
123.Fa version
124will be
125.Dv SSL3_VERSION .
126.Sh SEE ALSO
127.Xr ssl 3 ,
128.Xr SSL_new 3
129.Sh HISTORY
130.Fn SSL_CTX_set_msg_callback ,
131.Fn SSL_CTX_set_msg_callback_arg ,
132.Fn SSL_set_msg_callback
133and
134.Fn SSL_set_msg_callback_arg
135were added in OpenSSL 0.9.7.