summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/man/Makefile3
-rw-r--r--src/lib/libssl/man/SSL_CTX_add1_chain_cert.3222
-rw-r--r--src/lib/libssl/man/SSL_CTX_add_extra_chain_cert.345
-rw-r--r--src/lib/libssl/man/SSL_CTX_use_certificate.35
-rw-r--r--src/lib/libssl/man/ssl.36
5 files changed, 264 insertions, 17 deletions
diff --git a/src/lib/libssl/man/Makefile b/src/lib/libssl/man/Makefile
index 375e5fba2b..4c3157bd95 100644
--- a/src/lib/libssl/man/Makefile
+++ b/src/lib/libssl/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.65 2018/03/17 18:52:42 schwarze Exp $ 1# $OpenBSD: Makefile,v 1.66 2019/04/05 18:29:43 schwarze Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
@@ -8,6 +8,7 @@ MAN = BIO_f_ssl.3 \
8 PEM_read_SSL_SESSION.3 \ 8 PEM_read_SSL_SESSION.3 \
9 SSL_CIPHER_get_name.3 \ 9 SSL_CIPHER_get_name.3 \
10 SSL_COMP_add_compression_method.3 \ 10 SSL_COMP_add_compression_method.3 \
11 SSL_CTX_add1_chain_cert.3 \
11 SSL_CTX_add_extra_chain_cert.3 \ 12 SSL_CTX_add_extra_chain_cert.3 \
12 SSL_CTX_add_session.3 \ 13 SSL_CTX_add_session.3 \
13 SSL_CTX_ctrl.3 \ 14 SSL_CTX_ctrl.3 \
diff --git a/src/lib/libssl/man/SSL_CTX_add1_chain_cert.3 b/src/lib/libssl/man/SSL_CTX_add1_chain_cert.3
new file mode 100644
index 0000000000..1f60bad142
--- /dev/null
+++ b/src/lib/libssl/man/SSL_CTX_add1_chain_cert.3
@@ -0,0 +1,222 @@
1.\" $OpenBSD: SSL_CTX_add1_chain_cert.3,v 1.1 2019/04/05 18:29:43 schwarze Exp $
2.\" selective merge up to: OpenSSL df75c2bf Dec 9 01:02:36 2018 +0100
3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>
5.\" and Rob Stradling <rob.stradling@comodo.com>.
6.\" Copyright (c) 2013 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: April 5 2019 $
53.Dt SSL_CTX_ADD1_CHAIN_CERT 3
54.Os
55.Sh NAME
56.Nm SSL_CTX_set0_chain ,
57.Nm SSL_CTX_set1_chain ,
58.Nm SSL_CTX_add0_chain_cert ,
59.Nm SSL_CTX_add1_chain_cert ,
60.Nm SSL_CTX_get0_chain_certs ,
61.Nm SSL_CTX_clear_chain_certs ,
62.Nm SSL_set0_chain ,
63.Nm SSL_set1_chain ,
64.Nm SSL_add0_chain_cert ,
65.Nm SSL_add1_chain_cert ,
66.Nm SSL_get0_chain_certs ,
67.Nm SSL_clear_chain_certs
68.Nd extra chain certificate processing
69.Sh SYNOPSIS
70.In openssl/ssl.h
71.Ft int
72.Fo SSL_CTX_set0_chain
73.Fa "SSL_CTX *ctx"
74.Fa "STACK_OF(X509) *chain"
75.Fc
76.Ft int
77.Fo SSL_CTX_set1_chain
78.Fa "SSL_CTX *ctx"
79.Fa "STACK_OF(X509) *chain"
80.Fc
81.Ft int
82.Fo SSL_CTX_add0_chain_cert
83.Fa "SSL_CTX *ctx"
84.Fa "X509 *cert"
85.Fc
86.Ft int
87.Fo SSL_CTX_add1_chain_cert
88.Fa "SSL_CTX *ctx"
89.Fa "X509 *cert"
90.Fc
91.Ft int
92.Fo SSL_CTX_get0_chain_certs
93.Fa "SSL_CTX *ctx"
94.Fa "STACK_OF(X509) **chain"
95.Fc
96.Ft int
97.Fo SSL_CTX_clear_chain_certs
98.Fa "SSL_CTX *ctx"
99.Fc
100.Ft int
101.Fo SSL_set0_chain
102.Fa "SSL *ssl"
103.Fa "STACK_OF(X509) *chain"
104.Fc
105.Ft int
106.Fo SSL_set1_chain
107.Fa "SSL *ssl"
108.Fa "STACK_OF(X509) *chain"
109.Fc
110.Ft int
111.Fo SSL_add0_chain_cert
112.Fa "SSL *ssl"
113.Fa "X509 *cert"
114.Fc
115.Ft int
116.Fo SSL_add1_chain_cert
117.Fa "SSL *ssl"
118.Fa "X509 *cert"
119.Fc
120.Ft int
121.Fo SSL_get0_chain_certs
122.Fa "SSL *ssl"
123.Fa "STACK_OF(X509) **chain"
124.Fc
125.Ft int
126.Fo SSL_clear_chain_certs
127.Fa "SSL *ssl"
128.Fc
129.Sh DESCRIPTION
130.Fn SSL_CTX_set0_chain
131and
132.Fn SSL_CTX_set1_chain
133set the certificate chain associated with the current certificate of
134.Fa ctx
135to
136.Fa chain .
137The
138.Fa chain
139is not supposed to include the current certificate itself.
140.Pp
141.Fn SSL_CTX_add0_chain_cert
142and
143.Fn SSL_CTX_add1_chain_cert
144append the single certificate
145.Fa cert
146to the chain associated with the current certificate of
147.Fa ctx .
148.Pp
149.Fn SSL_CTX_get0_chain_certs
150retrieves the chain associated with the current certificate of
151.Fa ctx .
152.Pp
153.Fn SSL_CTX_clear_chain_certs
154clears the existing chain associated with the current certificate of
155.Fa ctx ,
156if any.
157This is equivalent to calling
158.Fn SSL_CTX_set0_chain
159with
160.Fa chain
161set to
162.Dv NULL .
163.Pp
164Each of these functions operates on the
165.Em current
166end entity (i.e. server or client) certificate.
167This is the last certificate loaded or selected on the corresponding
168.Fa ctx
169structure, for example using
170.Xr SSL_CTX_use_certificate 3 .
171.Pp
172.Fn SSL_set0_chain ,
173.Fn SSL_set1_chain ,
174.Fn SSL_add0_chain_cert ,
175.Fn SSL_add1_chain_cert ,
176.Fn SSL_get0_chain_certs ,
177and
178.Fn SSL_clear_chain_certs
179are similar except that they operate on the
180.Fa ssl
181connection.
182.Pp
183The functions containing a
184.Sy 1
185in their name increment the reference count of the supplied certificate
186or chain, so it must be freed at some point after the operation.
187Those containing a
188.Sy 0
189do not increment reference counts and the supplied certificate or chain
190must not be freed after the operation.
191.Pp
192The chains associated with an
193.Vt SSL_CTX
194structure are copied to the new
195.Vt SSL
196structure when
197.Xr SSL_new 3
198is called.
199Existing
200.Vt SSL
201structures are not affected by any chains subsequently changed
202in the parent
203.Vt SSL_CTX .
204.Pp
205One chain can be set for each key type supported by a server.
206So, for example, an RSA and a DSA certificate can (and often will) have
207different chains.
208.Pp
209If any certificates are added using these functions, no certificates
210added using
211.Xr SSL_CTX_add_extra_chain_cert 3
212will be used.
213.Sh RETURN VALUES
214These functions return 1 for success or 0 for failure.
215.Sh SEE ALSO
216.Xr ssl 3 ,
217.Xr SSL_CTX_add_extra_chain_cert 3 ,
218.Xr SSL_CTX_use_certificate 3
219.Sh HISTORY
220These functions first appeared in OpenSSL 1.0.2
221and have been available since
222.Ox 6.5 .
diff --git a/src/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3 b/src/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3
index 1feee4265c..a6d869b335 100644
--- a/src/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3
+++ b/src/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3
@@ -1,5 +1,5 @@
1.\" $OpenBSD: SSL_CTX_add_extra_chain_cert.3,v 1.5 2018/03/23 05:50:30 schwarze Exp $ 1.\" $OpenBSD: SSL_CTX_add_extra_chain_cert.3,v 1.6 2019/04/05 18:29:43 schwarze Exp $
2.\" OpenSSL f0d6ee6be Feb 15 07:41:42 2002 +0000 2.\" full merge up to: OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3.\" 3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org> and 4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org> and
5.\" Dr. Stephen Henson <steve@openssl.org>. 5.\" Dr. Stephen Henson <steve@openssl.org>.
@@ -50,18 +50,21 @@
50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 50.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
51.\" OF THE POSSIBILITY OF SUCH DAMAGE. 51.\" OF THE POSSIBILITY OF SUCH DAMAGE.
52.\" 52.\"
53.Dd $Mdocdate: March 23 2018 $ 53.Dd $Mdocdate: April 5 2019 $
54.Dt SSL_CTX_ADD_EXTRA_CHAIN_CERT 3 54.Dt SSL_CTX_ADD_EXTRA_CHAIN_CERT 3
55.Os 55.Os
56.Sh NAME 56.Sh NAME
57.Nm SSL_CTX_add_extra_chain_cert , 57.Nm SSL_CTX_add_extra_chain_cert ,
58.Nm SSL_CTX_get_extra_chain_certs ,
58.Nm SSL_CTX_clear_extra_chain_certs 59.Nm SSL_CTX_clear_extra_chain_certs
59.Nd add or clear extra chain certificates 60.Nd add, retrieve, and clear extra chain certificates
60.Sh SYNOPSIS 61.Sh SYNOPSIS
61.In openssl/ssl.h 62.In openssl/ssl.h
62.Ft long 63.Ft long
63.Fn SSL_CTX_add_extra_chain_cert "SSL_CTX *ctx" "X509 *x509" 64.Fn SSL_CTX_add_extra_chain_cert "SSL_CTX *ctx" "X509 *x509"
64.Ft long 65.Ft long
66.Fn SSL_CTX_get_extra_chain_certs "SSL_CTX *ctx" "STACK_OF(X509) **certs"
67.Ft long
65.Fn SSL_CTX_clear_extra_chain_certs "SSL_CTX *ctx" 68.Fn SSL_CTX_clear_extra_chain_certs "SSL_CTX *ctx"
66.Sh DESCRIPTION 69.Sh DESCRIPTION
67.Fn SSL_CTX_add_extra_chain_cert 70.Fn SSL_CTX_add_extra_chain_cert
@@ -71,6 +74,11 @@ to the extra chain certificates associated with
71.Fa ctx . 74.Fa ctx .
72Several certificates can be added one after another. 75Several certificates can be added one after another.
73.Pp 76.Pp
77.Fn SSL_CTX_get_extra_chain_certs
78retrieves an internal pointer to the stack of extra chain certificates
79associated with
80.Fa ctx .
81.Pp
74.Fn SSL_CTX_clear_extra_chain_certs 82.Fn SSL_CTX_clear_extra_chain_certs
75clears all extra chain certificates associated with 83clears all extra chain certificates associated with
76.Fa ctx . 84.Fa ctx .
@@ -91,14 +99,16 @@ will be freed by the library when the
91is destroyed. 99is destroyed.
92An application should not free the 100An application should not free the
93.Fa x509 101.Fa x509
94object. 102object, nor the
103.Pf * Fa certs
104object retrieved by
105.Fn SSL_CTX_get_extra_chain_certs .
95.Sh RETURN VALUES 106.Sh RETURN VALUES
96.Fn SSL_CTX_add_extra_chain_cert 107These functions return 1 on success or 0 for failure.
97and
98.Fn SSL_CTX_clear_extra_chain_certs
99return 1 on success or 0 for failure.
100Check out the error stack to find out the reason for failure. 108Check out the error stack to find out the reason for failure.
101.Sh SEE ALSO 109.Sh SEE ALSO
110.Xr ssl 3 ,
111.Xr SSL_CTX_add1_chain_cert 3 ,
102.Xr SSL_CTX_ctrl 3 , 112.Xr SSL_CTX_ctrl 3 ,
103.Xr SSL_CTX_load_verify_locations 3 , 113.Xr SSL_CTX_load_verify_locations 3 ,
104.Xr SSL_CTX_set_client_cert_cb 3 , 114.Xr SSL_CTX_set_client_cert_cb 3 ,
@@ -108,15 +118,26 @@ Check out the error stack to find out the reason for failure.
108first appeared in SSLeay 0.9.1 and has been available since 118first appeared in SSLeay 0.9.1 and has been available since
109.Ox 2.6 . 119.Ox 2.6 .
110.Pp 120.Pp
121.Fn SSL_CTX_get_extra_chain_certs
122and
111.Fn SSL_CTX_clear_extra_chain_certs 123.Fn SSL_CTX_clear_extra_chain_certs
112first appeared in OpenSSL 1.0.1 and has been available since 124first appeared in OpenSSL 1.0.1 and have been available since
113.Ox 5.3 . 125.Ox 5.3 .
114.Sh CAVEATS 126.Sh CAVEATS
127Certificates added with
128.Fn SSL_CTX_add_extra_chain_cert
129are ignored when certificates are also available that have been
130added using the functions documented in
131.Xr SSL_CTX_set1_chain 3 .
132.Pp
115Only one set of extra chain certificates can be specified per 133Only one set of extra chain certificates can be specified per
116.Vt SSL_CTX 134.Vt SSL_CTX
117structure. 135structure using
136.Fn SSL_CTX_add_extra_chain_cert .
118Different chains for different certificates (for example if both 137Different chains for different certificates (for example if both
119RSA and DSA certificates are specified by the same server) or 138RSA and DSA certificates are specified by the same server) or
120different SSL structures with the same parent 139different SSL structures with the same parent
121.Vt SSL_CTX 140.Vt SSL_CTX
122cannot be specified using this function. 141require using the functions documented in
142.Xr SSL_CTX_set1_chain 3
143instead.
diff --git a/src/lib/libssl/man/SSL_CTX_use_certificate.3 b/src/lib/libssl/man/SSL_CTX_use_certificate.3
index b1b7df5a9a..900a42da7d 100644
--- a/src/lib/libssl/man/SSL_CTX_use_certificate.3
+++ b/src/lib/libssl/man/SSL_CTX_use_certificate.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: SSL_CTX_use_certificate.3,v 1.9 2018/04/25 13:51:34 schwarze Exp $ 1.\" $OpenBSD: SSL_CTX_use_certificate.3,v 1.10 2019/04/05 18:29:43 schwarze Exp $
2.\" OpenSSL e248596b Apr 8 22:49:57 2005 +0000 2.\" OpenSSL e248596b Apr 8 22:49:57 2005 +0000
3.\" 3.\"
4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>. 4.\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
@@ -49,7 +49,7 @@
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE. 50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\" 51.\"
52.Dd $Mdocdate: April 25 2018 $ 52.Dd $Mdocdate: April 5 2019 $
53.Dt SSL_CTX_USE_CERTIFICATE 3 53.Dt SSL_CTX_USE_CERTIFICATE 3
54.Os 54.Os
55.Sh NAME 55.Sh NAME
@@ -384,6 +384,7 @@ Otherwise check out the error stack to find out the reason.
384.Sh SEE ALSO 384.Sh SEE ALSO
385.Xr ssl 3 , 385.Xr ssl 3 ,
386.Xr SSL_clear 3 , 386.Xr SSL_clear 3 ,
387.Xr SSL_CTX_add1_chain_cert 3 ,
387.Xr SSL_CTX_add_extra_chain_cert 3 , 388.Xr SSL_CTX_add_extra_chain_cert 3 ,
388.Xr SSL_CTX_load_verify_locations 3 , 389.Xr SSL_CTX_load_verify_locations 3 ,
389.Xr SSL_CTX_set_cipher_list 3 , 390.Xr SSL_CTX_set_cipher_list 3 ,
diff --git a/src/lib/libssl/man/ssl.3 b/src/lib/libssl/man/ssl.3
index 23f2f21b54..4877342ba1 100644
--- a/src/lib/libssl/man/ssl.3
+++ b/src/lib/libssl/man/ssl.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ssl.3,v 1.14 2018/03/17 18:19:49 schwarze Exp $ 1.\" $OpenBSD: ssl.3,v 1.15 2019/04/05 18:29:43 schwarze Exp $
2.\" full merge up to: OpenSSL e330f55d Nov 11 00:51:04 2016 +0100 2.\" full merge up to: OpenSSL e330f55d Nov 11 00:51:04 2016 +0100
3.\" selective merge up to: OpenSSL cbade361 Dec 12 13:14:45 2017 +0100 3.\" selective merge up to: OpenSSL cbade361 Dec 12 13:14:45 2017 +0100
4.\" 4.\"
@@ -51,7 +51,7 @@
51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
52.\" OF THE POSSIBILITY OF SUCH DAMAGE. 52.\" OF THE POSSIBILITY OF SUCH DAMAGE.
53.\" 53.\"
54.Dd $Mdocdate: March 17 2018 $ 54.Dd $Mdocdate: April 5 2019 $
55.Dt SSL 3 55.Dt SSL 3
56.Os 56.Os
57.Sh NAME 57.Sh NAME
@@ -200,6 +200,8 @@ Constructors and destructors:
200.Xr SSL_CTX_free 3 200.Xr SSL_CTX_free 3
201.Pp 201.Pp
202Configuration functions: 202Configuration functions:
203.Xr SSL_CTX_add1_chain_cert 3 ,
204.Xr SSL_CTX_add_extra_chain_cert 3 ,
203.Xr SSL_CTX_ctrl 3 , 205.Xr SSL_CTX_ctrl 3 ,
204.Xr SSL_CTX_flush_sessions 3 , 206.Xr SSL_CTX_flush_sessions 3 ,
205.Xr SSL_CTX_get_verify_mode 3 , 207.Xr SSL_CTX_get_verify_mode 3 ,