diff options
Diffstat (limited to 'src/lib/libcrypto/man/X509_CRL_METHOD_new.3')
-rw-r--r-- | src/lib/libcrypto/man/X509_CRL_METHOD_new.3 | 182 |
1 files changed, 182 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/X509_CRL_METHOD_new.3 b/src/lib/libcrypto/man/X509_CRL_METHOD_new.3 new file mode 100644 index 0000000000..f80ce743cd --- /dev/null +++ b/src/lib/libcrypto/man/X509_CRL_METHOD_new.3 | |||
@@ -0,0 +1,182 @@ | |||
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 | ||
46 | These functions customize BER decoding and signature verification | ||
47 | of X.509 certificate revocation lists, | ||
48 | as well as retrieval of revoked entries from such lists. | ||
49 | .Pp | ||
50 | .Fn X509_CRL_METHOD_new | ||
51 | allocates and initializes a new | ||
52 | .Vt X509_CRL_METHOD | ||
53 | object, storing the four pointers to callback functions in it | ||
54 | that are provided as arguments. | ||
55 | .Pp | ||
56 | .Fn X509_CRL_METHOD_free | ||
57 | frees the given | ||
58 | .Fa method | ||
59 | object. | ||
60 | If | ||
61 | .Fa method | ||
62 | is a | ||
63 | .Dv NULL | ||
64 | pointer or points to the static object built into the library, | ||
65 | no action occurs. | ||
66 | .Pp | ||
67 | .Fn X509_CRL_set_default_method | ||
68 | designates the given | ||
69 | .Fa method | ||
70 | to be used for objects that will be created with | ||
71 | .Xr X509_CRL_new 3 | ||
72 | in the future. | ||
73 | It has no effect on | ||
74 | .Vt X509_CRL | ||
75 | objects that already exist. | ||
76 | If | ||
77 | .Fa method | ||
78 | is | ||
79 | .Dv NULL , | ||
80 | any previously installed method will no longer be used for new | ||
81 | .Vt X509_CRL | ||
82 | objects created in the future, and those future objects will adhere | ||
83 | to the default behaviour instead. | ||
84 | .Pp | ||
85 | The optional function | ||
86 | .Fn crl_init | ||
87 | will be called at the end of | ||
88 | .Xr d2i_X509_CRL 3 , | ||
89 | the optional function | ||
90 | .Fn crl_free | ||
91 | near the end of | ||
92 | .Xr X509_CRL_free 3 , | ||
93 | immediately before freeing | ||
94 | .Fa crl | ||
95 | itself. | ||
96 | The function | ||
97 | .Fn crl_lookup | ||
98 | will be called by | ||
99 | .Xr X509_CRL_get0_by_serial 3 , | ||
100 | setting | ||
101 | .Fa issuer | ||
102 | to | ||
103 | .Dv NULL , | ||
104 | and by | ||
105 | .Xr X509_CRL_get0_by_cert 3 , | ||
106 | both instead of performing the default action. | ||
107 | The function | ||
108 | .Fn crl_verify | ||
109 | will be called by | ||
110 | .Xr X509_CRL_verify 3 | ||
111 | instead of performing the default action. | ||
112 | .Pp | ||
113 | .Fn X509_CRL_set_meth_data | ||
114 | stores the pointer to the auxiliary | ||
115 | .Fa data | ||
116 | inside the | ||
117 | .Fa crl | ||
118 | object. | ||
119 | The pointer is expected to remain valid during the whole lifetime of the | ||
120 | .Fa crl | ||
121 | object but is not automatically freed when the | ||
122 | .Fa crl | ||
123 | object is freed. | ||
124 | .Pp | ||
125 | .Fn X509_CRL_get_meth_data | ||
126 | retrieves the | ||
127 | .Fa data | ||
128 | from | ||
129 | .Fa crl | ||
130 | the was added with | ||
131 | .Fn X509_CRL_set_meth_data . | ||
132 | This may for example be useful inside the four callback methods | ||
133 | installed with | ||
134 | .Fn X509_CRL_METHOD_new . | ||
135 | .Sh RETURN VALUES | ||
136 | .Fn X509_CRL_METHOD_new | ||
137 | returns a pointer to the new object or | ||
138 | .Dv NULL | ||
139 | if memory allocation fails. | ||
140 | .Pp | ||
141 | .Fn X509_CRL_get_meth_data | ||
142 | returns the pointer previously installed with | ||
143 | .Fn X509_CRL_set_meth_data | ||
144 | or | ||
145 | .Dv NULL | ||
146 | if | ||
147 | .Fn X509_CRL_set_meth_data | ||
148 | was not called on | ||
149 | .Fa crl . | ||
150 | .Pp | ||
151 | The callback functions | ||
152 | .Fn crl_init | ||
153 | and | ||
154 | .Fn crl_free | ||
155 | are supposed to return 1 for success or 0 for failure. | ||
156 | .Pp | ||
157 | The callback function | ||
158 | .Fn crl_lookup | ||
159 | is supposed to return 0 for failure or 1 for success, | ||
160 | except if the revoked entry has the reason | ||
161 | .Qq removeFromCRL , | ||
162 | in which case it is supposed to return 2. | ||
163 | .Pp | ||
164 | The callback function | ||
165 | .Fn crl_verify | ||
166 | is supposed to return 1 if the signature is valid | ||
167 | or 0 if the signature check fails. | ||
168 | If the signature could not be checked at all because it was invalid | ||
169 | or 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 | ||
180 | These functions first appeared in OpenSSL 1.0.0 | ||
181 | and have been available since | ||
182 | .Ox 4.9 . | ||