summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2019-08-20 13:27:19 +0000
committerschwarze <>2019-08-20 13:27:19 +0000
commitef9999173c00f7173583e8e79100096f558c6972 (patch)
treea4043c89cea448a9e0f07d5f56d227be135ffc8b
parentafb72c7fb8953ade3f713148efaea4b25375c765 (diff)
downloadopenbsd-ef9999173c00f7173583e8e79100096f558c6972.tar.gz
openbsd-ef9999173c00f7173583e8e79100096f558c6972.tar.bz2
openbsd-ef9999173c00f7173583e8e79100096f558c6972.zip
New manual page X509_cmp(3) documenting the same public functions
as in OpenSSL 1.1.1. I rewrote most of the text for clarity, precision, and conciseness and added some additional information. A few sentences from Paul Yang remain.
-rw-r--r--src/lib/libcrypto/man/Makefile3
-rw-r--r--src/lib/libcrypto/man/X509_CRL_new.35
-rw-r--r--src/lib/libcrypto/man/X509_NAME_new.35
-rw-r--r--src/lib/libcrypto/man/X509_cmp.3226
-rw-r--r--src/lib/libcrypto/man/X509_digest.37
-rw-r--r--src/lib/libcrypto/man/X509_new.35
6 files changed, 241 insertions, 10 deletions
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile
index b14e5d015f..99536f65aa 100644
--- a/src/lib/libcrypto/man/Makefile
+++ b/src/lib/libcrypto/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.151 2019/08/19 13:52:53 schwarze Exp $ 1# $OpenBSD: Makefile,v 1.152 2019/08/20 13:27:19 schwarze Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
@@ -265,6 +265,7 @@ MAN= \
265 X509_check_host.3 \ 265 X509_check_host.3 \
266 X509_check_issued.3 \ 266 X509_check_issued.3 \
267 X509_check_private_key.3 \ 267 X509_check_private_key.3 \
268 X509_cmp.3 \
268 X509_cmp_time.3 \ 269 X509_cmp_time.3 \
269 X509_digest.3 \ 270 X509_digest.3 \
270 X509_get_pubkey.3 \ 271 X509_get_pubkey.3 \
diff --git a/src/lib/libcrypto/man/X509_CRL_new.3 b/src/lib/libcrypto/man/X509_CRL_new.3
index 183de5305c..1312469743 100644
--- a/src/lib/libcrypto/man/X509_CRL_new.3
+++ b/src/lib/libcrypto/man/X509_CRL_new.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: X509_CRL_new.3,v 1.9 2019/08/19 13:52:53 schwarze Exp $ 1.\" $OpenBSD: X509_CRL_new.3,v 1.10 2019/08/20 13:27:19 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 2016, 2018 Ingo Schwarze <schwarze@openbsd.org> 3.\" Copyright (c) 2016, 2018 Ingo Schwarze <schwarze@openbsd.org>
4.\" 4.\"
@@ -14,7 +14,7 @@
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\" 16.\"
17.Dd $Mdocdate: August 19 2019 $ 17.Dd $Mdocdate: August 20 2019 $
18.Dt X509_CRL_NEW 3 18.Dt X509_CRL_NEW 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
@@ -111,6 +111,7 @@ returns 1 on success or 0 on error.
111.Xr X509_CRL_get_ext_d2i 3 , 111.Xr X509_CRL_get_ext_d2i 3 ,
112.Xr X509_CRL_get_issuer 3 , 112.Xr X509_CRL_get_issuer 3 ,
113.Xr X509_CRL_get_version 3 , 113.Xr X509_CRL_get_version 3 ,
114.Xr X509_CRL_match 3 ,
114.Xr X509_CRL_sign 3 , 115.Xr X509_CRL_sign 3 ,
115.Xr X509_EXTENSION_new 3 , 116.Xr X509_EXTENSION_new 3 ,
116.Xr X509_INFO_new 3 , 117.Xr X509_INFO_new 3 ,
diff --git a/src/lib/libcrypto/man/X509_NAME_new.3 b/src/lib/libcrypto/man/X509_NAME_new.3
index 19dd1066f5..5895dd5a10 100644
--- a/src/lib/libcrypto/man/X509_NAME_new.3
+++ b/src/lib/libcrypto/man/X509_NAME_new.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: X509_NAME_new.3,v 1.7 2019/06/06 01:06:59 schwarze Exp $ 1.\" $OpenBSD: X509_NAME_new.3,v 1.8 2019/08/20 13:27:19 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> 3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
4.\" 4.\"
@@ -14,7 +14,7 @@
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\" 16.\"
17.Dd $Mdocdate: June 6 2019 $ 17.Dd $Mdocdate: August 20 2019 $
18.Dt X509_NAME_NEW 3 18.Dt X509_NAME_NEW 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
@@ -81,6 +81,7 @@ if an error occurred.
81.Xr SSL_load_client_CA_file 3 , 81.Xr SSL_load_client_CA_file 3 ,
82.Xr X509_get_subject_name 3 , 82.Xr X509_get_subject_name 3 ,
83.Xr X509_NAME_add_entry_by_txt 3 , 83.Xr X509_NAME_add_entry_by_txt 3 ,
84.Xr X509_NAME_cmp 3 ,
84.Xr X509_NAME_digest 3 , 85.Xr X509_NAME_digest 3 ,
85.Xr X509_NAME_ENTRY_new 3 , 86.Xr X509_NAME_ENTRY_new 3 ,
86.Xr X509_NAME_get_index_by_NID 3 , 87.Xr X509_NAME_get_index_by_NID 3 ,
diff --git a/src/lib/libcrypto/man/X509_cmp.3 b/src/lib/libcrypto/man/X509_cmp.3
new file mode 100644
index 0000000000..1734d6a74d
--- /dev/null
+++ b/src/lib/libcrypto/man/X509_cmp.3
@@ -0,0 +1,226 @@
1.\" $OpenBSD: X509_cmp.3,v 1.1 2019/08/20 13:27:19 schwarze Exp $
2.\" full merge up to: OpenSSL ea5d4b89 Jun 6 11:42:02 2019 +0800
3.\"
4.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license:
6.\"
7.\" Copyright (c) 2019 Ingo Schwarze <schwarze@openbsd.org>
8.\"
9.\" Permission to use, copy, modify, and distribute this software for any
10.\" purpose with or without fee is hereby granted, provided that the above
11.\" copyright notice and this permission notice appear in all copies.
12.\"
13.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20.\"
21.\" The original file was written by Paul Yang <yang.yang@baishancloud.com>.
22.\" Copyright (c) 2019 The OpenSSL Project. All rights reserved.
23.\"
24.\" Redistribution and use in source and binary forms, with or without
25.\" modification, are permitted provided that the following conditions
26.\" are met:
27.\"
28.\" 1. Redistributions of source code must retain the above copyright
29.\" notice, this list of conditions and the following disclaimer.
30.\"
31.\" 2. Redistributions in binary form must reproduce the above copyright
32.\" notice, this list of conditions and the following disclaimer in
33.\" the documentation and/or other materials provided with the
34.\" distribution.
35.\"
36.\" 3. All advertising materials mentioning features or use of this
37.\" software must display the following acknowledgment:
38.\" "This product includes software developed by the OpenSSL Project
39.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
40.\"
41.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
42.\" endorse or promote products derived from this software without
43.\" prior written permission. For written permission, please contact
44.\" openssl-core@openssl.org.
45.\"
46.\" 5. Products derived from this software may not be called "OpenSSL"
47.\" nor may "OpenSSL" appear in their names without prior written
48.\" permission of the OpenSSL Project.
49.\"
50.\" 6. Redistributions of any form whatsoever must retain the following
51.\" acknowledgment:
52.\" "This product includes software developed by the OpenSSL Project
53.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
54.\"
55.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
56.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
57.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
58.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
59.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
60.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
61.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
62.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
63.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
64.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
65.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
66.\" OF THE POSSIBILITY OF SUCH DAMAGE.
67.\"
68.Dd $Mdocdate: August 20 2019 $
69.Dt X509_CMP 3
70.Os
71.Sh NAME
72.Nm X509_cmp ,
73.Nm X509_NAME_cmp ,
74.Nm X509_issuer_and_serial_cmp ,
75.Nm X509_issuer_name_cmp ,
76.Nm X509_subject_name_cmp ,
77.Nm X509_CRL_cmp ,
78.Nm X509_CRL_match
79.Nd compare X.509 certificates and related values
80.Sh SYNOPSIS
81.In openssl/x509.h
82.Ft int
83.Fo X509_cmp
84.Fa "const X509 *a"
85.Fa "const X509 *b"
86.Fc
87.Ft int
88.Fo X509_NAME_cmp
89.Fa "const X509_NAME *a"
90.Fa "const X509_NAME *b"
91.Fc
92.Ft int
93.Fo X509_issuer_and_serial_cmp
94.Fa "const X509 *a"
95.Fa "const X509 *b"
96.Fc
97.Ft int
98.Fo X509_issuer_name_cmp
99.Fa "const X509 *a"
100.Fa "const X509 *b"
101.Fc
102.Ft int
103.Fo X509_subject_name_cmp
104.Fa "const X509 *a"
105.Fa "const X509 *b"
106.Fc
107.Ft int
108.Fo X509_CRL_cmp
109.Fa "const X509_CRL *a"
110.Fa "const X509_CRL *b"
111.Fc
112.Ft int
113.Fo X509_CRL_match
114.Fa "const X509_CRL *a"
115.Fa "const X509_CRL *b"
116.Fc
117.Sh DESCRIPTION
118.Fn X509_cmp
119compares two X.509 certificates using
120.Xr memcmp 3
121on the SHA1 hashes of their canonical (DER) representations as generated with
122.Xr X509_digest 3 .
123.Pp
124.Fn X509_NAME_cmp
125compares two X.501
126.Vt Name
127objects using their canonical (DER) representations generated with
128.Xr i2d_X509_NAME 3 .
129.Pp
130.Fn X509_issuer_and_serial_cmp
131compares the
132.Fa issuer
133and
134.Fa serialNumber
135fields of two
136.Vt TBSCertificate
137structures, using
138.Fn X509_NAME_cmp
139for the
140.Fa issuer
141fields.
142.Pp
143.Fn X509_issuer_name_cmp
144compares the
145.Fa issuer
146fields of two
147.Vt TBSCertificate
148structures using
149.Fn X509_NAME_cmp .
150.Pp
151.Fn X509_subject_name_cmp
152compares the
153.Fa subject
154fields of two
155.Vt TBSCertificate
156structures using
157.Fn X509_NAME_cmp .
158.Pp
159.Fn X509_CRL_cmp
160is misnamed; it only compares the
161.Fa issuer
162fields of two
163.Vt TBSCertList
164structures using
165.Fn X509_NAME_cmp .
166.Pp
167.Fn X509_CRL_match
168compares two certificate revocation lists using
169.Xr memcmp 3
170on the SHA1 hashes of their canonical (DER) representations as generated with
171.Xr X509_CRL_digest 3 .
172.Sh RETURN VALUES
173All these functions return 0 to indicate a match or a non-zero value
174to indicate a mismatch.
175.Pp
176.Fn X509_NAME_cmp ,
177.Fn X509_issuer_and_serial_cmp ,
178.Fn X509_issuer_name_cmp ,
179.Fn X509_subject_name_cmp
180and
181.Fn X509_CRL_cmp
182may return -2 to indicate an error.
183.Sh SEE ALSO
184.Xr i2d_X509_NAME 3 ,
185.Xr X509_CRL_new 3 ,
186.Xr X509_digest 3 ,
187.Xr X509_NAME_new 3 ,
188.Xr X509_new 3
189.Sh STANDARDS
190RFC 5280: Internet X.509 Public Key Infrastructure Certificate
191and Certificate Revocation List (CRL) Profile
192.Bl -dash -compact -offset indent
193.It
194section 4.1: Basic Certificate Fields
195.It
196section 5.1: CRL Fields
197.El
198.Sh HISTORY
199.Fn X509_issuer_and_serial_cmp ,
200.Fn X509_issuer_name_cmp ,
201and
202.Fn X509_subject_name_cmp
203first appeared in SSLeay 0.5.1 and
204.Fn X509_NAME_cmp
205and
206.Fn X509_CRL_cmp
207in SSLeay 0.8.0.
208These functions have been available since
209.Ox 2.4 .
210.Pp
211.Fn X509_cmp
212first appeared in OpenSSL 0.9.5 and has been available since
213.Ox 2.7 .
214.Pp
215.Fn X509_CRL_match
216first appeared in OpenSSL 1.0.0 and has been available since
217.Ox 4.9 .
218.Sh BUGS
219For
220.Fn X509_NAME_cmp ,
221.Fn X509_issuer_and_serial_cmp ,
222.Fn X509_issuer_name_cmp ,
223.Fn X509_subject_name_cmp
224and
225.Fn X509_CRL_cmp ,
226the return value -2 sometimes indicates a mismatch and sometimes an error.
diff --git a/src/lib/libcrypto/man/X509_digest.3 b/src/lib/libcrypto/man/X509_digest.3
index 63016427c0..7627e07731 100644
--- a/src/lib/libcrypto/man/X509_digest.3
+++ b/src/lib/libcrypto/man/X509_digest.3
@@ -1,5 +1,5 @@
1.\" $OpenBSD: X509_digest.3,v 1.7 2019/06/06 01:06:59 schwarze Exp $ 1.\" $OpenBSD: X509_digest.3,v 1.8 2019/08/20 13:27:19 schwarze Exp $
2.\" OpenSSL X509_digest.pod 3ba4dac6 Mar 23 13:04:52 2017 -0400 2.\" full merge up to: OpenSSL 1212818e Sep 11 13:22:14 2018 +0100
3.\" 3.\"
4.\" This file was written by Rich Salz <rsalz@openssl.org> 4.\" This file was written by Rich Salz <rsalz@openssl.org>
5.\" Copyright (c) 2017 The OpenSSL Project. All rights reserved. 5.\" Copyright (c) 2017 The OpenSSL Project. All rights reserved.
@@ -48,7 +48,7 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 50.\"
51.Dd $Mdocdate: June 6 2019 $ 51.Dd $Mdocdate: August 20 2019 $
52.Dt X509_DIGEST 3 52.Dt X509_DIGEST 3
53.Os 53.Os
54.Sh NAME 54.Sh NAME
@@ -131,6 +131,7 @@ points to a place where the digest size will be stored.
131These functions return 1 for success or 0 for failure. 131These functions return 1 for success or 0 for failure.
132.Sh SEE ALSO 132.Sh SEE ALSO
133.Xr EVP_get_digestbyname 3 , 133.Xr EVP_get_digestbyname 3 ,
134.Xr X509_cmp 3 ,
134.Xr X509_CRL_new 3 , 135.Xr X509_CRL_new 3 ,
135.Xr X509_NAME_new 3 , 136.Xr X509_NAME_new 3 ,
136.Xr X509_new 3 , 137.Xr X509_new 3 ,
diff --git a/src/lib/libcrypto/man/X509_new.3 b/src/lib/libcrypto/man/X509_new.3
index 3ccd311e61..25b45b39bd 100644
--- a/src/lib/libcrypto/man/X509_new.3
+++ b/src/lib/libcrypto/man/X509_new.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: X509_new.3,v 1.18 2019/08/19 13:52:53 schwarze Exp $ 1.\" $OpenBSD: X509_new.3,v 1.19 2019/08/20 13:27:19 schwarze Exp $
2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 2.\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
3.\" 3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>. 4.\" This file was written by Dr. Stephen Henson <steve@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: August 19 2019 $ 52.Dd $Mdocdate: August 20 2019 $
53.Dt X509_NEW 3 53.Dt X509_NEW 3
54.Os 54.Os
55.Sh NAME 55.Sh NAME
@@ -147,6 +147,7 @@ if an error occurs.
147.Xr X509_check_issued 3 , 147.Xr X509_check_issued 3 ,
148.Xr X509_check_private_key 3 , 148.Xr X509_check_private_key 3 ,
149.Xr X509_CINF_new 3 , 149.Xr X509_CINF_new 3 ,
150.Xr X509_cmp 3 ,
150.Xr X509_CRL_new 3 , 151.Xr X509_CRL_new 3 ,
151.Xr X509_digest 3 , 152.Xr X509_digest 3 ,
152.Xr X509_EXTENSION_new 3 , 153.Xr X509_EXTENSION_new 3 ,