Debian Codegraph @

upstream/debian-unstable/man3/SSL_CTX_set_ct_validation_callback.3ssl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "SSL_CTX_SET_CT_VALIDATION_CALLBACK 3SSL"
58 .TH SSL_CTX_SET_CT_VALIDATION_CALLBACK 3SSL 2026-04-07 3.6.2 OpenSSL
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 ssl_ct_validation_cb,
65 SSL_enable_ct, SSL_CTX_enable_ct, SSL_disable_ct, SSL_CTX_disable_ct,
66 SSL_set_ct_validation_callback, SSL_CTX_set_ct_validation_callback,
67 SSL_ct_is_enabled, SSL_CTX_ct_is_enabled \-
68 control Certificate Transparency policy
69 .SH SYNOPSIS
70 .IX Header "SYNOPSIS"
71 .Vb 1
72 \& #include <openssl/ssl.h>
73 \&
74 \& typedef int (*ssl_ct_validation_cb)(const CT_POLICY_EVAL_CTX *ctx,
75 \& const STACK_OF(SCT) *scts, void *arg);
76 \&
77 \& int SSL_enable_ct(SSL *s, int validation_mode);
78 \& int SSL_CTX_enable_ct(SSL_CTX *ctx, int validation_mode);
79 \& int SSL_set_ct_validation_callback(SSL *s, ssl_ct_validation_cb callback,
80 \& void *arg);
81 \& int SSL_CTX_set_ct_validation_callback(SSL_CTX *ctx,
82 \& ssl_ct_validation_cb callback,
83 \& void *arg);
84 \& void SSL_disable_ct(SSL *s);
85 \& void SSL_CTX_disable_ct(SSL_CTX *ctx);
86 \& int SSL_ct_is_enabled(const SSL *s);
87 \& int SSL_CTX_ct_is_enabled(const SSL_CTX *ctx);
88 .Ve
89 .SH DESCRIPTION
90 .IX Header "DESCRIPTION"
91 \&\fBSSL_enable_ct()\fR and \fBSSL_CTX_enable_ct()\fR enable the processing of signed
92 certificate timestamps (SCTs) either for a given SSL connection or for all
93 connections that share the given SSL context, respectively.
94 This is accomplished by setting a built-in CT validation callback.
95 The behaviour of the callback is determined by the \fBvalidation_mode\fR argument,
96 which can be either of \fBSSL_CT_VALIDATION_PERMISSIVE\fR or
97 \&\fBSSL_CT_VALIDATION_STRICT\fR as described below.
98 .PP
99 If \fBvalidation_mode\fR is equal to \fBSSL_CT_VALIDATION_STRICT\fR, then in a full
100 TLS handshake with the verification mode set to \fBSSL_VERIFY_PEER\fR, if the peer
101 presents no valid SCTs the handshake will be aborted.
102 If the verification mode is \fBSSL_VERIFY_NONE\fR, the handshake will continue
103 despite lack of valid SCTs.
104 However, in that case if the verification status before the built-in callback
105 was \fBX509_V_OK\fR it will be set to \fBX509_V_ERR_NO_VALID_SCTS\fR after the
106 callback.
107 Applications can call \fBSSL_get_verify_result\fR\|(3) to check the status at
108 handshake completion, even after session resumption since the verification
109 status is part of the saved session state.
110 See \fBSSL_set_verify\fR\|(3), <\fBSSL_get_verify_result\fR\|(3)>, \fBSSL_session_reused\fR\|(3).
111 .PP
112 If \fBvalidation_mode\fR is equal to \fBSSL_CT_VALIDATION_PERMISSIVE\fR, then the
113 handshake continues, and the verification status is not modified, regardless of
114 the validation status of any SCTs.
115 The application can still inspect the validation status of the SCTs at
116 handshake completion.
117 Note that with session resumption there will not be any SCTs presented during
118 the handshake.
119 Therefore, in applications that delay SCT policy enforcement until after
120 handshake completion, such delayed SCT checks should only be performed when the
121 session is not resumed.
122 .PP
123 \&\fBSSL_set_ct_validation_callback()\fR and \fBSSL_CTX_set_ct_validation_callback()\fR
124 register a custom callback that may implement a different policy than either of
125 the above.
126 This callback can examine the peer's SCTs and determine whether they are
127 sufficient to allow the connection to continue.
128 The TLS handshake is aborted if the verification mode is not \fBSSL_VERIFY_NONE\fR
129 and the callback returns a non-positive result.
130 .PP
131 An arbitrary callback data argument, \fBarg\fR, can be passed in when setting
132 the callback.
133 This will be passed to the callback whenever it is invoked.
134 Ownership of this context remains with the caller.
135 .PP
136 If no callback is set, SCTs will not be requested and Certificate Transparency
137 validation will not occur.
138 .PP
139 No callback will be invoked when the peer presents no certificate, e.g. by
140 employing an anonymous (aNULL) cipher suite.
141 In that case the handshake continues as it would had no callback been
142 requested.
143 Callbacks are also not invoked when the peer certificate chain is invalid or
144 validated via \fBDANE\-TA\fR\|(2) or \fBDANE\-EE\fR\|(3) TLSA records which use a private X.509
145 PKI, or no X.509 PKI at all, respectively.
146 Clients that require SCTs are expected to not have enabled any aNULL ciphers
147 nor to have specified server verification via \fBDANE\-TA\fR\|(2) or \fBDANE\-EE\fR\|(3) TLSA
148 records.
149 .PP
150 \&\fBSSL_disable_ct()\fR and \fBSSL_CTX_disable_ct()\fR turn off CT processing, whether
151 enabled via the built-in or the custom callbacks, by setting a NULL callback.
152 These may be implemented as macros.
153 .PP
154 \&\fBSSL_ct_is_enabled()\fR and \fBSSL_CTX_ct_is_enabled()\fR return 1 if CT processing is
155 enabled via either \fBSSL_enable_ct()\fR or a non-null custom callback, and 0
156 otherwise.
157 .SH NOTES
158 .IX Header "NOTES"
159 When SCT processing is enabled, OCSP stapling will be enabled. This is because
160 one possible source of SCTs is the OCSP response from a server.
161 .PP
162 The time returned by \fBSSL_SESSION_get_time_ex()\fR will be used to evaluate whether any
163 presented SCTs have timestamps that are in the future (and therefore invalid).
164 .SH RESTRICTIONS
165 .IX Header "RESTRICTIONS"
166 Certificate Transparency validation cannot be enabled and so a callback cannot
167 be set if a custom client extension handler has been registered to handle SCT
168 extensions (\fBTLSEXT_TYPE_signed_certificate_timestamp\fR).
169 .SH "RETURN VALUES"
170 .IX Header "RETURN VALUES"
171 \&\fBSSL_enable_ct()\fR, \fBSSL_CTX_enable_ct()\fR, \fBSSL_CTX_set_ct_validation_callback()\fR and
172 \&\fBSSL_set_ct_validation_callback()\fR return 1 if the \fBcallback\fR is successfully
173 set.
174 They return 0 if an error occurs, e.g. a custom client extension handler has
175 been setup to handle SCTs.
176 .PP
177 \&\fBSSL_disable_ct()\fR and \fBSSL_CTX_disable_ct()\fR do not return a result.
178 .PP
179 \&\fBSSL_CTX_ct_is_enabled()\fR and \fBSSL_ct_is_enabled()\fR return a 1 if a non-null CT
180 validation callback is set, or 0 if no callback (or equivalently a NULL
181 callback) is set.
182 .SH "SEE ALSO"
183 .IX Header "SEE ALSO"
184 \&\fBssl\fR\|(7),
185 <\fBSSL_get_verify_result\fR\|(3)>,
186 \&\fBSSL_session_reused\fR\|(3),
187 \&\fBSSL_set_verify\fR\|(3),
188 \&\fBSSL_CTX_set_verify\fR\|(3),
189 \&\fBSSL_SESSION_get_time\fR\|(3)
190 .SH COPYRIGHT
191 .IX Header "COPYRIGHT"
192 Copyright 2016\-2024 The OpenSSL Project Authors. All Rights Reserved.
193 .PP
194 Licensed under the Apache License 2.0 (the "License"). You may not use
195 this file except in compliance with the License. You can obtain a copy
196 in the file LICENSE in the source distribution or at
197 <https://www.openssl.org/source/license.html>.