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