Skip to content

Commit 01ed8c6

Browse files
author
schwarze
committed
document X509_LOOKUP_mem(3) in X509_LOOKUP_hash_dir(3)
and add a new manual page X509_LOOKUP_new(3)
1 parent 018212d commit 01ed8c6

File tree

8 files changed

+636
-32
lines changed

8 files changed

+636
-32
lines changed

src/lib/libcrypto/man/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $OpenBSD: Makefile,v 1.188 2021/07/27 13:27:46 schwarze Exp $
1+
# $OpenBSD: Makefile,v 1.189 2021/07/31 14:54:33 schwarze Exp $
22

33
.include <bsd.own.mk>
44

@@ -284,6 +284,7 @@ MAN= \
284284
X509_EXTENSION_set_object.3 \
285285
X509_INFO_new.3 \
286286
X509_LOOKUP_hash_dir.3 \
287+
X509_LOOKUP_new.3 \
287288
X509_NAME_ENTRY_get_object.3 \
288289
X509_NAME_add_entry_by_txt.3 \
289290
X509_NAME_get_index_by_NID.3 \

src/lib/libcrypto/man/PEM_X509_INFO_read.3

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.\" $OpenBSD: PEM_X509_INFO_read.3,v 1.2 2021/03/12 05:18:00 jsg Exp $
1+
.\" $OpenBSD: PEM_X509_INFO_read.3,v 1.3 2021/07/31 14:54:33 schwarze Exp $
22
.\"
33
.\" Copyright (c) 2020 Ingo Schwarze <schwarze@openbsd.org>
44
.\"
@@ -14,7 +14,7 @@
1414
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
1515
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1616
.\"
17-
.Dd $Mdocdate: March 12 2021 $
17+
.Dd $Mdocdate: July 31 2021 $
1818
.Dt PEM_X509_INFO_READ 3
1919
.Os
2020
.Sh NAME
@@ -161,6 +161,7 @@ may sometimes return 0 anyway.
161161
.Xr STACK_OF 3 ,
162162
.Xr X509_CRL_new 3 ,
163163
.Xr X509_INFO_new 3 ,
164+
.Xr X509_LOOKUP_new 3 ,
164165
.Xr X509_new 3
165166
.Sh HISTORY
166167
.Fn PEM_X509_INFO_read

src/lib/libcrypto/man/X509_LOOKUP_hash_dir.3

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
1-
.\" $OpenBSD: X509_LOOKUP_hash_dir.3,v 1.9 2019/06/06 01:06:59 schwarze Exp $
1+
.\" $OpenBSD: X509_LOOKUP_hash_dir.3,v 1.10 2021/07/31 14:54:33 schwarze Exp $
22
.\" full merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800
33
.\"
4-
.\" This file was written by Victor B. Wagner <vitus@cryptocom.ru>
4+
.\" This file is a derived work.
5+
.\" The changes are covered by the following Copyright and license:
6+
.\"
7+
.\" Copyright (c) 2021 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 Victor B. Wagner <vitus@cryptocom.ru>
522
.\" and Claus Assmann.
623
.\" Copyright (c) 2015, 2016, 2017 The OpenSSL Project. All rights reserved.
724
.\"
@@ -49,22 +66,25 @@
4966
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
5067
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
5168
.\"
52-
.Dd $Mdocdate: June 6 2019 $
69+
.Dd $Mdocdate: July 31 2021 $
5370
.Dt X509_LOOKUP_HASH_DIR 3
5471
.Os
5572
.Sh NAME
5673
.Nm X509_LOOKUP_hash_dir ,
5774
.Nm X509_LOOKUP_file ,
75+
.Nm X509_LOOKUP_mem ,
5876
.Nm X509_load_cert_file ,
5977
.Nm X509_load_crl_file ,
6078
.Nm X509_load_cert_crl_file
61-
.Nd default OpenSSL certificate lookup methods
79+
.Nd default certificate lookup methods
6280
.Sh SYNOPSIS
6381
.In openssl/x509_vfy.h
6482
.Ft X509_LOOKUP_METHOD *
6583
.Fn X509_LOOKUP_hash_dir void
6684
.Ft X509_LOOKUP_METHOD *
6785
.Fn X509_LOOKUP_file void
86+
.Ft X509_LOOKUP_METHOD *
87+
.Fn X509_LOOKUP_mem void
6888
.Ft int
6989
.Fo X509_load_cert_file
7090
.Fa "X509_LOOKUP *ctx"
@@ -84,16 +104,17 @@
84104
.Fa "int type"
85105
.Fc
86106
.Sh DESCRIPTION
87-
.Fn X509_LOOKUP_hash_dir
107+
.Fn X509_LOOKUP_hash_dir ,
108+
.Fn X509_LOOKUP_file ,
88109
and
89-
.Fn X509_LOOKUP_file
90-
are two certificate lookup methods to use with
91-
.Vt X509_STORE ,
92-
provided by the OpenSSL library.
110+
.Fn X509_LOOKUP_mem
111+
return pointers to static certificate lookup method objects
112+
built into the library, for use with
113+
.Vt X509_STORE .
93114
.Pp
94-
Users of the library typically do not need to create instances of these
95-
methods manually.
96-
They are created automatically by the
115+
Users of the library typically do not need
116+
to retrieve pointers to these method objects manually.
117+
They are automatically used by the
97118
.Xr X509_STORE_load_locations 3
98119
or
99120
.Xr SSL_CTX_load_verify_locations 3
@@ -141,7 +162,7 @@ filename causes these functions to load the default certificate
141162
store file (see
142163
.Xr X509_STORE_set_default_paths 3 ) .
143164
.Pp
144-
Both methods support adding several certificate locations into one
165+
All three methods support adding several certificate locations into one
145166
.Sy X509_STORE .
146167
.Pp
147168
This page documents certificate store formats used by these methods and
@@ -208,13 +229,22 @@ sequence number greater than that of the already cached CRL.
208229
Note that the hash algorithm used for subject name hashing changed in
209230
OpenSSL 1.0.0, and all certificate stores have to be rehashed when
210231
moving from OpenSSL 0.9.8 to 1.0.0.
232+
.Ss Memory Method
233+
The
234+
.Fn X509_LOOKUP_mem
235+
method supports loading PEM-encoded certificates and revocation lists
236+
that are already stored in memory, using the function
237+
.Xr X509_LOOKUP_add_mem 3 .
238+
This is particularly useful in processes using
239+
.Xr chroot 2 .
211240
.Sh RETURN VALUES
212-
.Fn X509_LOOKUP_hash_dir
241+
.Fn X509_LOOKUP_hash_dir ,
242+
.Fn X509_LOOKUP_file ,
213243
and
214-
.Fn X509_LOOKUP_file
244+
.Fn X509_LOOKUP_mem
215245
always return a pointer to a static
216246
.Vt X509_LOOKUP_METHOD
217-
structure.
247+
object.
218248
.Pp
219249
.Fn X509_load_cert_file ,
220250
.Fn X509_load_crl_file ,
@@ -227,6 +257,7 @@ or 0 on error.
227257
.Xr d2i_X509_bio 3 ,
228258
.Xr PEM_read_PrivateKey 3 ,
229259
.Xr SSL_CTX_load_verify_locations 3 ,
260+
.Xr X509_LOOKUP_new 3 ,
230261
.Xr X509_OBJECT_get0_X509 3 ,
231262
.Xr X509_STORE_load_locations 3 ,
232263
.Xr X509_STORE_new 3
@@ -244,3 +275,7 @@ These functions have been available since
244275
.Fn X509_load_cert_crl_file
245276
first appeared in OpenSSL 0.9.5 and has been available since
246277
.Ox 2.7 .
278+
.Pp
279+
.Fn X509_LOOKUP_mem
280+
first appeared in
281+
.Ox 5.7 .

0 commit comments

Comments
 (0)