summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/X509_CRL_METHOD_new.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/X509_CRL_METHOD_new.3')
-rw-r--r--src/lib/libcrypto/man/X509_CRL_METHOD_new.3182
1 files changed, 0 insertions, 182 deletions
diff --git a/src/lib/libcrypto/man/X509_CRL_METHOD_new.3 b/src/lib/libcrypto/man/X509_CRL_METHOD_new.3
deleted file mode 100644
index f80ce743cd..0000000000
--- a/src/lib/libcrypto/man/X509_CRL_METHOD_new.3
+++ /dev/null
@@ -1,182 +0,0 @@
1.\" $OpenBSD: X509_CRL_METHOD_new.3,v 1.1 2021/10/30 16:20:35 schwarze Exp $
2.\"
3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: October 30 2021 $
18.Dt X509_CRL_METHOD_NEW 3
19.Os
20.Sh NAME
21.Nm X509_CRL_METHOD_new ,
22.Nm X509_CRL_METHOD_free ,
23.Nm X509_CRL_set_default_method ,
24.Nm X509_CRL_set_meth_data ,
25.Nm X509_CRL_get_meth_data
26.Nd customize CRL handling
27.Sh SYNOPSIS
28.In openssl/x509.h
29.Ft X509_CRL_METHOD *
30.Fo X509_CRL_METHOD_new
31.Fa "int (*crl_init)(X509_CRL *crl)"
32.Fa "int (*crl_free)(X509_CRL *crl)"
33.Fa "int (*crl_lookup)(X509_CRL *crl, X509_REVOKED **ret,\
34 ASN1_INTEGER *ser, X509_NAME *issuer)"
35.Fa "int (*crl_verify)(X509_CRL *crl, EVP_PKEY *pk)"
36.Fc
37.Ft void
38.Fn X509_CRL_METHOD_free "X509_CRL_METHOD *method"
39.Ft void
40.Fn X509_CRL_set_default_method "const X509_CRL_METHOD *method"
41.Ft void
42.Fn X509_CRL_set_meth_data "X509_CRL *crl" "void *data"
43.Ft void *
44.Fn X509_CRL_get_meth_data "X509_CRL *crl"
45.Sh DESCRIPTION
46These functions customize BER decoding and signature verification
47of X.509 certificate revocation lists,
48as well as retrieval of revoked entries from such lists.
49.Pp
50.Fn X509_CRL_METHOD_new
51allocates and initializes a new
52.Vt X509_CRL_METHOD
53object, storing the four pointers to callback functions in it
54that are provided as arguments.
55.Pp
56.Fn X509_CRL_METHOD_free
57frees the given
58.Fa method
59object.
60If
61.Fa method
62is a
63.Dv NULL
64pointer or points to the static object built into the library,
65no action occurs.
66.Pp
67.Fn X509_CRL_set_default_method
68designates the given
69.Fa method
70to be used for objects that will be created with
71.Xr X509_CRL_new 3
72in the future.
73It has no effect on
74.Vt X509_CRL
75objects that already exist.
76If
77.Fa method
78is
79.Dv NULL ,
80any previously installed method will no longer be used for new
81.Vt X509_CRL
82objects created in the future, and those future objects will adhere
83to the default behaviour instead.
84.Pp
85The optional function
86.Fn crl_init
87will be called at the end of
88.Xr d2i_X509_CRL 3 ,
89the optional function
90.Fn crl_free
91near the end of
92.Xr X509_CRL_free 3 ,
93immediately before freeing
94.Fa crl
95itself.
96The function
97.Fn crl_lookup
98will be called by
99.Xr X509_CRL_get0_by_serial 3 ,
100setting
101.Fa issuer
102to
103.Dv NULL ,
104and by
105.Xr X509_CRL_get0_by_cert 3 ,
106both instead of performing the default action.
107The function
108.Fn crl_verify
109will be called by
110.Xr X509_CRL_verify 3
111instead of performing the default action.
112.Pp
113.Fn X509_CRL_set_meth_data
114stores the pointer to the auxiliary
115.Fa data
116inside the
117.Fa crl
118object.
119The pointer is expected to remain valid during the whole lifetime of the
120.Fa crl
121object but is not automatically freed when the
122.Fa crl
123object is freed.
124.Pp
125.Fn X509_CRL_get_meth_data
126retrieves the
127.Fa data
128from
129.Fa crl
130the was added with
131.Fn X509_CRL_set_meth_data .
132This may for example be useful inside the four callback methods
133installed with
134.Fn X509_CRL_METHOD_new .
135.Sh RETURN VALUES
136.Fn X509_CRL_METHOD_new
137returns a pointer to the new object or
138.Dv NULL
139if memory allocation fails.
140.Pp
141.Fn X509_CRL_get_meth_data
142returns the pointer previously installed with
143.Fn X509_CRL_set_meth_data
144or
145.Dv NULL
146if
147.Fn X509_CRL_set_meth_data
148was not called on
149.Fa crl .
150.Pp
151The callback functions
152.Fn crl_init
153and
154.Fn crl_free
155are supposed to return 1 for success or 0 for failure.
156.Pp
157The callback function
158.Fn crl_lookup
159is supposed to return 0 for failure or 1 for success,
160except if the revoked entry has the reason
161.Qq removeFromCRL ,
162in which case it is supposed to return 2.
163.Pp
164The callback function
165.Fn crl_verify
166is supposed to return 1 if the signature is valid
167or 0 if the signature check fails.
168If the signature could not be checked at all because it was invalid
169or some other error occurred, \-1 may be returned.
170.Sh SEE ALSO
171.Xr ASN1_INTEGER_new 3 ,
172.Xr d2i_X509_CRL 3 ,
173.Xr EVP_PKEY_new 3 ,
174.Xr X509_CRL_get0_by_serial 3 ,
175.Xr X509_CRL_new 3 ,
176.Xr X509_CRL_verify 3 ,
177.Xr X509_NAME_new 3 ,
178.Xr X509_REVOKED_new 3
179.Sh HISTORY
180These functions first appeared in OpenSSL 1.0.0
181and have been available since
182.Ox 4.9 .