diff options
author | cvs2svn <admin@example.com> | 2025-04-14 17:32:06 +0000 |
---|---|---|
committer | cvs2svn <admin@example.com> | 2025-04-14 17:32:06 +0000 |
commit | eb8dd9dca1228af0cd132f515509051ecfabf6f6 (patch) | |
tree | edb6da6af7e865d488dc1a29309f1e1ec226e603 /src/lib/libcrypto/man/X509_check_host.3 | |
parent | 247f0352e0ed72a4f476db9dc91f4d982bc83eb2 (diff) | |
download | openbsd-tb_20250414.tar.gz openbsd-tb_20250414.tar.bz2 openbsd-tb_20250414.zip |
This commit was manufactured by cvs2git to create tag 'tb_20250414'.tb_20250414
Diffstat (limited to 'src/lib/libcrypto/man/X509_check_host.3')
-rw-r--r-- | src/lib/libcrypto/man/X509_check_host.3 | 246 |
1 files changed, 0 insertions, 246 deletions
diff --git a/src/lib/libcrypto/man/X509_check_host.3 b/src/lib/libcrypto/man/X509_check_host.3 deleted file mode 100644 index dbc56c0d21..0000000000 --- a/src/lib/libcrypto/man/X509_check_host.3 +++ /dev/null | |||
@@ -1,246 +0,0 @@ | |||
1 | .\" $OpenBSD: X509_check_host.3,v 1.6 2020/09/17 08:04:22 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL a09e4d24 Jun 12 01:56:31 2014 -0400 | ||
3 | .\" selective merge up to: OpenSSL 6328d367 Jul 4 21:58:30 2020 +0200 | ||
4 | .\" | ||
5 | .\" This file was written by Florian Weimer <fweimer@redhat.com> and | ||
6 | .\" Viktor Dukhovni <openssl-users@dukhovni.org>. | ||
7 | .\" Copyright (c) 2012, 2014, 2015, 2016 The OpenSSL Project. | ||
8 | .\" All rights reserved. | ||
9 | .\" | ||
10 | .\" Redistribution and use in source and binary forms, with or without | ||
11 | .\" modification, are permitted provided that the following conditions | ||
12 | .\" are met: | ||
13 | .\" | ||
14 | .\" 1. Redistributions of source code must retain the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer. | ||
16 | .\" | ||
17 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
18 | .\" notice, this list of conditions and the following disclaimer in | ||
19 | .\" the documentation and/or other materials provided with the | ||
20 | .\" distribution. | ||
21 | .\" | ||
22 | .\" 3. All advertising materials mentioning features or use of this | ||
23 | .\" software must display the following acknowledgment: | ||
24 | .\" "This product includes software developed by the OpenSSL Project | ||
25 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
26 | .\" | ||
27 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
28 | .\" endorse or promote products derived from this software without | ||
29 | .\" prior written permission. For written permission, please contact | ||
30 | .\" openssl-core@openssl.org. | ||
31 | .\" | ||
32 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
33 | .\" nor may "OpenSSL" appear in their names without prior written | ||
34 | .\" permission of the OpenSSL Project. | ||
35 | .\" | ||
36 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
37 | .\" acknowledgment: | ||
38 | .\" "This product includes software developed by the OpenSSL Project | ||
39 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
40 | .\" | ||
41 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
42 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
43 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
44 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
45 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
46 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
47 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
48 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
49 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
50 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
51 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
52 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
53 | .\" | ||
54 | .Dd $Mdocdate: September 17 2020 $ | ||
55 | .Dt X509_CHECK_HOST 3 | ||
56 | .Os | ||
57 | .Sh NAME | ||
58 | .Nm X509_check_host , | ||
59 | .Nm X509_check_email , | ||
60 | .Nm X509_check_ip , | ||
61 | .Nm X509_check_ip_asc | ||
62 | .Nd X.509 certificate matching | ||
63 | .Sh SYNOPSIS | ||
64 | .In openssl/x509v3.h | ||
65 | .Ft int | ||
66 | .Fo X509_check_host | ||
67 | .Fa "X509 *x" | ||
68 | .Fa "const char *name" | ||
69 | .Fa "size_t namelen" | ||
70 | .Fa "unsigned int flags" | ||
71 | .Fa "char **peername" | ||
72 | .Fc | ||
73 | .Ft int | ||
74 | .Fo X509_check_email | ||
75 | .Fa "X509 *x" | ||
76 | .Fa "const char *address" | ||
77 | .Fa "size_t addresslen" | ||
78 | .Fa "unsigned int flags" | ||
79 | .Fc | ||
80 | .Ft int | ||
81 | .Fo X509_check_ip | ||
82 | .Fa "X509 *x" | ||
83 | .Fa "const unsigned char *address" | ||
84 | .Fa "size_t addresslen" | ||
85 | .Fa "unsigned int flags" | ||
86 | .Fc | ||
87 | .Ft int | ||
88 | .Fo X509_check_ip_asc | ||
89 | .Fa "X509 *x" | ||
90 | .Fa "const char *address" | ||
91 | .Fa "unsigned int flags" | ||
92 | .Fc | ||
93 | .Sh DESCRIPTION | ||
94 | The certificate matching functions are used to check whether a | ||
95 | certificate matches a given hostname, email address, or IP address. | ||
96 | The validity of the certificate and its trust level has to be checked by | ||
97 | other means. | ||
98 | .Pp | ||
99 | .Fn X509_check_host | ||
100 | checks if the certificate Subject Alternative Name (SAN) or Subject | ||
101 | CommonName (CN) matches the specified hostname, which must be encoded | ||
102 | in the preferred name syntax described in section 3.5 of RFC 1034. | ||
103 | By default, wildcards are supported and they match only in the | ||
104 | left-most label; they may match part of that label with an | ||
105 | explicit prefix or suffix. | ||
106 | For example, by default, the host | ||
107 | .Fa name | ||
108 | .Qq www.example.com | ||
109 | would match a certificate with a SAN or CN value of | ||
110 | .Qq *.example.com , | ||
111 | .Qq w*.example.com | ||
112 | or | ||
113 | .Qq *w.example.com . | ||
114 | .Pp | ||
115 | Per section 6.4.2 of RFC 6125, | ||
116 | .Fa name | ||
117 | values representing international domain names must be given in A-label | ||
118 | form. | ||
119 | The | ||
120 | .Fa namelen | ||
121 | argument must be the number of characters in the name string or zero, in | ||
122 | which case the length is calculated with | ||
123 | .Fn strlen name . | ||
124 | When | ||
125 | .Fa name | ||
126 | starts with a dot (e.g.\& | ||
127 | .Qq .example.com ) , | ||
128 | it will be matched by a certificate valid for any sub-domain of | ||
129 | .Fa name ; | ||
130 | see also | ||
131 | .Fa X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS | ||
132 | below. | ||
133 | .Pp | ||
134 | When the certificate is matched and | ||
135 | .Fa peername | ||
136 | is not | ||
137 | .Dv NULL , | ||
138 | a pointer to a copy of the matching SAN or CN from the peer | ||
139 | certificate is stored at the address passed in | ||
140 | .Fa peername . | ||
141 | The application is responsible for freeing the peername via | ||
142 | .Xr free 3 | ||
143 | when it is no longer needed. | ||
144 | .Pp | ||
145 | .Fn X509_check_email | ||
146 | checks if the certificate matches the specified email | ||
147 | .Fa address . | ||
148 | Only the mailbox syntax of RFC 822 is supported. | ||
149 | Comments are not allowed, | ||
150 | and no attempt is made to normalize quoted characters. | ||
151 | The | ||
152 | .Fa addresslen | ||
153 | argument must be the number of characters in the address string or zero, | ||
154 | in which case the length is calculated with | ||
155 | .Fn strlen address . | ||
156 | .Pp | ||
157 | .Fn X509_check_ip | ||
158 | checks if the certificate matches a specified IPv4 or IPv6 address. | ||
159 | The | ||
160 | .Fa address | ||
161 | array is in binary format, in network byte order. | ||
162 | The length is either 4 (IPv4) or 16 (IPv6). | ||
163 | Only explicitly marked addresses in the certificates are considered; | ||
164 | IP addresses stored in DNS names and Common Names are ignored. | ||
165 | .Pp | ||
166 | .Fn X509_check_ip_asc | ||
167 | is similar, except that the NUL-terminated string | ||
168 | .Fa address | ||
169 | is first converted to the internal representation. | ||
170 | .Pp | ||
171 | The | ||
172 | .Fa flags | ||
173 | argument is usually 0, but it can be the bitwise OR of the following | ||
174 | flags. | ||
175 | .Pp | ||
176 | The | ||
177 | .Dv X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT | ||
178 | flag causes the function to consider the subject DN even if the | ||
179 | certificate contains at least one subject alternative name of the right | ||
180 | type (DNS name or email address as appropriate); the default is to | ||
181 | ignore the subject DN when at least one corresponding subject | ||
182 | alternative names is present. | ||
183 | .Pp | ||
184 | The remaining flags are only meaningful for | ||
185 | .Fn X509_check_host . | ||
186 | .Pp | ||
187 | The | ||
188 | .Dv X509_CHECK_FLAG_NO_WILDCARDS | ||
189 | flag disables wildcard expansion. | ||
190 | .Pp | ||
191 | The | ||
192 | .Dv X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS | ||
193 | flag suppresses support for | ||
194 | .Qq * | ||
195 | as a wildcard pattern in labels that have a | ||
196 | prefix or suffix, such as | ||
197 | .Qq www* | ||
198 | or | ||
199 | .Qq *www . | ||
200 | .Pp | ||
201 | The | ||
202 | .Dv X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS | ||
203 | flag allows a | ||
204 | .Qq * | ||
205 | that constitutes the complete label of a DNS name (e.g.\& | ||
206 | .Qq *.example.com ) | ||
207 | to match more than one label in | ||
208 | .Fa name . | ||
209 | .Pp | ||
210 | The | ||
211 | .Dv X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS | ||
212 | flag restricts | ||
213 | .Fa name | ||
214 | values which start with | ||
215 | .Qq \&. , | ||
216 | that would otherwise match any sub-domain in the peer certificate, | ||
217 | to only match direct child sub-domains. | ||
218 | Thus, for instance, with this flag set a | ||
219 | .Fa name | ||
220 | of | ||
221 | .Qq .example.com | ||
222 | would match a peer certificate with a DNS name of | ||
223 | .Qq www.example.com , | ||
224 | but would not match a peer certificate with a DNS name of | ||
225 | .Qq www.sub.example.com . | ||
226 | .Sh RETURN VALUES | ||
227 | The functions return 1 for a successful match, 0 for a failed match and | ||
228 | -1 for an internal error: typically a memory allocation failure or an | ||
229 | ASN.1 decoding error. | ||
230 | .Pp | ||
231 | All functions can also return -2 if the input is malformed. | ||
232 | For example, | ||
233 | .Fn X509_check_host | ||
234 | returns -2 if the provided | ||
235 | .Fa name | ||
236 | contains embedded NUL bytes. | ||
237 | .Sh SEE ALSO | ||
238 | .Xr SSL_set1_host 3 , | ||
239 | .Xr X509_EXTENSION_new 3 , | ||
240 | .Xr X509_get1_email 3 , | ||
241 | .Xr X509_new 3 , | ||
242 | .Xr X509_VERIFY_PARAM_set1_host 3 | ||
243 | .Sh HISTORY | ||
244 | These functions first appeared in OpenSSL 1.0.2 | ||
245 | and have been available since | ||
246 | .Ox 6.1 . | ||