diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/man/Makefile | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/man/OCSP_REQUEST_new.3 | 241 | ||||
-rw-r--r-- | src/lib/libcrypto/man/OCSP_cert_to_id.3 | 187 | ||||
-rw-r--r-- | src/lib/libcrypto/man/OCSP_request_add1_nonce.3 | 160 | ||||
-rw-r--r-- | src/lib/libcrypto/man/OCSP_resp_find_status.3 | 285 | ||||
-rw-r--r-- | src/lib/libcrypto/man/OCSP_response_status.3 | 134 | ||||
-rw-r--r-- | src/lib/libcrypto/man/OCSP_sendreq_new.3 | 245 |
7 files changed, 1259 insertions, 1 deletions
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index 447c7d23c3..a1cc37cb35 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.55 2016/11/26 18:09:35 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.56 2016/11/27 20:40:07 schwarze Exp $ |
2 | 2 | ||
3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
4 | 4 | ||
@@ -122,6 +122,12 @@ MAN= \ | |||
122 | HMAC.3 \ | 122 | HMAC.3 \ |
123 | MD5.3 \ | 123 | MD5.3 \ |
124 | OBJ_nid2obj.3 \ | 124 | OBJ_nid2obj.3 \ |
125 | OCSP_REQUEST_new.3 \ | ||
126 | OCSP_cert_to_id.3 \ | ||
127 | OCSP_request_add1_nonce.3 \ | ||
128 | OCSP_resp_find_status.3 \ | ||
129 | OCSP_response_status.3 \ | ||
130 | OCSP_sendreq_new.3 \ | ||
125 | OPENSSL_VERSION_NUMBER.3 \ | 131 | OPENSSL_VERSION_NUMBER.3 \ |
126 | OPENSSL_config.3 \ | 132 | OPENSSL_config.3 \ |
127 | OPENSSL_load_builtin_modules.3 \ | 133 | OPENSSL_load_builtin_modules.3 \ |
diff --git a/src/lib/libcrypto/man/OCSP_REQUEST_new.3 b/src/lib/libcrypto/man/OCSP_REQUEST_new.3 new file mode 100644 index 0000000000..dd08b7c2ca --- /dev/null +++ b/src/lib/libcrypto/man/OCSP_REQUEST_new.3 | |||
@@ -0,0 +1,241 @@ | |||
1 | .\" $OpenBSD: OCSP_REQUEST_new.3,v 1.1 2016/11/27 20:40:07 schwarze Exp $ | ||
2 | .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2014, 2016 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: November 27 2016 $ | ||
52 | .Dt OCSP_REQUEST_NEW 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm OCSP_REQUEST_new , | ||
56 | .Nm OCSP_REQUEST_free , | ||
57 | .Nm OCSP_request_add0_id , | ||
58 | .Nm OCSP_request_sign , | ||
59 | .Nm OCSP_request_add1_cert , | ||
60 | .Nm OCSP_request_onereq_count , | ||
61 | .Nm OCSP_request_onereq_get0 , | ||
62 | .Nd OCSP request functions | ||
63 | .Sh SYNOPSIS | ||
64 | .In openssl/ocsp.h | ||
65 | .Ft OCSP_REQUEST * | ||
66 | .Fn OCSP_REQUEST_new void | ||
67 | .Ft void | ||
68 | .Fo OCSP_REQUEST_free | ||
69 | .Fa "OCSP_REQUEST *req" | ||
70 | .Fc | ||
71 | .Ft OCSP_ONEREQ * | ||
72 | .Fo OCSP_request_add0_id | ||
73 | .Fa "OCSP_REQUEST *req" | ||
74 | .Fa "OCSP_CERTID *cid" | ||
75 | .Fc | ||
76 | .Ft int | ||
77 | .Fo OCSP_request_sign | ||
78 | .Fa "OCSP_REQUEST *req" | ||
79 | .Fa "X509 *signer" | ||
80 | .Fa "EVP_PKEY *key" | ||
81 | .Fa "const EVP_MD *dgst" | ||
82 | .Fa "STACK_OF(X509) *certs" | ||
83 | .Fa "unsigned long flags" | ||
84 | .Fc | ||
85 | .Ft int | ||
86 | .Fo OCSP_request_add1_cert | ||
87 | .Fa "OCSP_REQUEST *req" | ||
88 | .Fa "X509 *cert" | ||
89 | .Fc | ||
90 | .Ft int | ||
91 | .Fo OCSP_request_onereq_count | ||
92 | .Fa "OCSP_REQUEST *req" | ||
93 | .Fc | ||
94 | .Ft OCSP_ONEREQ * | ||
95 | .Fo OCSP_request_onereq_get0 | ||
96 | .Fa "OCSP_REQUEST *req" | ||
97 | .Fa "int i" | ||
98 | .Fc | ||
99 | .Sh DESCRIPTION | ||
100 | .Fn OCSP_REQUEST_new | ||
101 | allocates and returns an empty | ||
102 | .Vt OCSP_REQUEST | ||
103 | structure. | ||
104 | .Pp | ||
105 | .Fn OCSP_REQUEST_free | ||
106 | frees up the request structure | ||
107 | .Fa req . | ||
108 | .Pp | ||
109 | .Fn OCSP_request_add0_id | ||
110 | adds certificate ID | ||
111 | .Fa cid | ||
112 | to | ||
113 | .Fa req . | ||
114 | It returns the | ||
115 | .Vt OCSP_ONEREQ | ||
116 | structure added so an application can add additional extensions to the | ||
117 | request. | ||
118 | The | ||
119 | .Fa cid | ||
120 | parameter must not be freed up after the operation. | ||
121 | .Pp | ||
122 | .Fn OCSP_request_sign | ||
123 | signs OCSP request | ||
124 | .Fa req | ||
125 | using certificate | ||
126 | .Fa signer , | ||
127 | private key | ||
128 | .Fa key , | ||
129 | digest | ||
130 | .Fa dgst , | ||
131 | and additional certificates | ||
132 | .Fa certs . | ||
133 | If the | ||
134 | .Fa flags | ||
135 | option | ||
136 | .Dv OCSP_NOCERTS | ||
137 | is set, then no certificates will be included in the request. | ||
138 | .Pp | ||
139 | .Fn OCSP_request_add1_cert | ||
140 | adds certificate | ||
141 | .Fa cert | ||
142 | to request | ||
143 | .Fa req . | ||
144 | The application is responsible for freeing up | ||
145 | .Fa cert | ||
146 | after use. | ||
147 | .Pp | ||
148 | .Fn OCSP_request_onereq_count | ||
149 | returns the total number of | ||
150 | .Vt OCSP_ONEREQ | ||
151 | structures in | ||
152 | .Fa req . | ||
153 | .Pp | ||
154 | .Fn OCSP_request_onereq_get0 | ||
155 | returns an internal pointer to the | ||
156 | .Vt OCSP_ONEREQ | ||
157 | contained in | ||
158 | .Fa req | ||
159 | of index | ||
160 | .Fa i . | ||
161 | The index value | ||
162 | .Fa i | ||
163 | runs from 0 to | ||
164 | .Fn OCSP_request_onereq_count req No - 1 . | ||
165 | .Pp | ||
166 | An | ||
167 | .Vt OCSP_REQUEST | ||
168 | structure contains one or more | ||
169 | .Vt OCSP_ONEREQ | ||
170 | structures corresponding to each certificate. | ||
171 | .Pp | ||
172 | .Fn OCSP_request_onereq_count | ||
173 | and | ||
174 | .Fn OCSP_request_onereq_get0 | ||
175 | are mainly used by OCSP responders. | ||
176 | .Sh RETURN VALUES | ||
177 | .Fn OCSP_REQUEST_new | ||
178 | returns an empty | ||
179 | .Vt OCSP_REQUEST | ||
180 | structure or | ||
181 | .Dv NULL | ||
182 | if an error occurred. | ||
183 | .Pp | ||
184 | .Fn OCSP_request_add0_id | ||
185 | returns the | ||
186 | .Vt OCSP_ONEREQ | ||
187 | structure containing | ||
188 | .Fa cid | ||
189 | or | ||
190 | .Dv NULL | ||
191 | if an error occurred. | ||
192 | .Pp | ||
193 | .Fn OCSP_request_sign | ||
194 | and | ||
195 | .Fn OCSP_request_add1_cert | ||
196 | return 1 for success or 0 for failure. | ||
197 | .Pp | ||
198 | .Fn OCSP_request_onereq_count | ||
199 | returns the total number of | ||
200 | .Vt OCSP_ONEREQ | ||
201 | structures in | ||
202 | .Fa req . | ||
203 | .Pp | ||
204 | .Fn OCSP_request_onereq_get0 | ||
205 | returns a pointer to an | ||
206 | .Vt OCSP_ONEREQ | ||
207 | structure or | ||
208 | .Dv NULL | ||
209 | if the index value is out or range. | ||
210 | .Sh EXAMPLE | ||
211 | Create an | ||
212 | .Vt OCSP_REQUEST | ||
213 | structure for certificate | ||
214 | .Fa cert | ||
215 | with issuer | ||
216 | .Fa issuer : | ||
217 | .Bd -literal -offset indent | ||
218 | OCSP_REQUEST *req; | ||
219 | OCSP_ID *cid; | ||
220 | |||
221 | req = OCSP_REQUEST_new(); | ||
222 | if (req == NULL) | ||
223 | /* error */ | ||
224 | cid = OCSP_cert_to_id(EVP_sha1(), cert, issuer); | ||
225 | if (cid == NULL) | ||
226 | /* error */ | ||
227 | |||
228 | if (OCSP_REQUEST_add0_id(req, cid) == NULL) | ||
229 | /* error */ | ||
230 | |||
231 | /* Do something with req, e.g. query responder */ | ||
232 | |||
233 | OCSP_REQUEST_free(req); | ||
234 | .Ed | ||
235 | .Sh SEE ALSO | ||
236 | .Xr crypto 3 , | ||
237 | .Xr OCSP_cert_to_id 3 , | ||
238 | .Xr OCSP_request_add1_nonce 3 , | ||
239 | .Xr OCSP_resp_find_status 3 , | ||
240 | .Xr OCSP_response_status 3 , | ||
241 | .Xr OCSP_sendreq_new 3 | ||
diff --git a/src/lib/libcrypto/man/OCSP_cert_to_id.3 b/src/lib/libcrypto/man/OCSP_cert_to_id.3 new file mode 100644 index 0000000000..6742e45415 --- /dev/null +++ b/src/lib/libcrypto/man/OCSP_cert_to_id.3 | |||
@@ -0,0 +1,187 @@ | |||
1 | .\" $OpenBSD: OCSP_cert_to_id.3,v 1.1 2016/11/27 20:40:07 schwarze Exp $ | ||
2 | .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2014, 2016 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: November 27 2016 $ | ||
52 | .Dt OCSP_CERT_TO_ID 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm OCSP_cert_to_id , | ||
56 | .Nm OCSP_cert_id_new , | ||
57 | .Nm OCSP_CERTID_free , | ||
58 | .Nm OCSP_id_issuer_cmp , | ||
59 | .Nm OCSP_id_cmp , | ||
60 | .Nm OCSP_id_get0_info | ||
61 | .Nd OCSP certificate ID utility functions | ||
62 | .Sh SYNOPSIS | ||
63 | .In openssl/ocsp.h | ||
64 | .Ft OCSP_CERTID * | ||
65 | .Fo OCSP_cert_to_id | ||
66 | .Fa "const EVP_MD *dgst" | ||
67 | .Fa "X509 *subject" | ||
68 | .Fa "X509 *issuer" | ||
69 | .Fc | ||
70 | .Ft OCSP_CERTID * | ||
71 | .Fo OCSP_cert_id_new | ||
72 | .Fa "const EVP_MD *dgst" | ||
73 | .Fa "X509_NAME *issuerName" | ||
74 | .Fa "ASN1_BIT_STRING *issuerKey" | ||
75 | .Fa "ASN1_INTEGER *serialNumber" | ||
76 | .Fc | ||
77 | .Ft void | ||
78 | .Fo OCSP_CERTID_free | ||
79 | .Fa "OCSP_CERTID *id" | ||
80 | .Fc | ||
81 | .Ft int | ||
82 | .Fo OCSP_id_issuer_cmp | ||
83 | .Fa "OCSP_CERTID *a" | ||
84 | .Fa "OCSP_CERTID *b" | ||
85 | .Fc | ||
86 | .Ft int | ||
87 | .Fo OCSP_id_cmp | ||
88 | .Fa "OCSP_CERTID *a" | ||
89 | .Fa "OCSP_CERTID *b" | ||
90 | .Fc | ||
91 | .Ft int | ||
92 | .Fo OCSP_id_get0_info | ||
93 | .Fa "ASN1_OCTET_STRING **piNameHash" | ||
94 | .Fa "ASN1_OBJECT **pmd" | ||
95 | .Fa "ASN1_OCTET_STRING **pikeyHash" | ||
96 | .Fa "ASN1_INTEGER **pserial" | ||
97 | .Fa "OCSP_CERTID *cid" | ||
98 | .Fc | ||
99 | .Sh DESCRIPTION | ||
100 | .Fn OCSP_cert_to_id | ||
101 | creates and returns a new | ||
102 | .Vt OCSP_CERTID | ||
103 | structure using message digest | ||
104 | .Fa dgst | ||
105 | for certificate | ||
106 | .Fa subject | ||
107 | with issuer | ||
108 | .Fa issuer . | ||
109 | If | ||
110 | .Fa dgst | ||
111 | is | ||
112 | .Dv NULL | ||
113 | then SHA1 is used. | ||
114 | .Pp | ||
115 | .Fn OCSP_cert_id_new | ||
116 | creates and returns a new | ||
117 | .Vt OCSP_CERTID | ||
118 | using | ||
119 | .Fa dgst | ||
120 | and issuer name | ||
121 | .Fa issuerName , | ||
122 | issuer key hash | ||
123 | .Fa issuerKey | ||
124 | and serial number | ||
125 | .Fa serialNumber . | ||
126 | .Pp | ||
127 | .Fn OCSP_CERTID_free | ||
128 | frees up | ||
129 | .Fa id . | ||
130 | .Pp | ||
131 | .Fn OCSP_id_cmp | ||
132 | compares | ||
133 | .Vt OCSP_CERTID | ||
134 | .Fa a | ||
135 | and | ||
136 | .Fa b . | ||
137 | .Pp | ||
138 | .Fn OCSP_id_issuer_cmp | ||
139 | compares only the issuer name of | ||
140 | .Vt OCSP_CERTID | ||
141 | .Fa a | ||
142 | and | ||
143 | .Fa b . | ||
144 | .Pp | ||
145 | .Fn OCSP_id_get0_info | ||
146 | returns the issuer name hash, hash OID, issuer key hash and serial | ||
147 | number contained in | ||
148 | .Fa cid . | ||
149 | If any of the values are not required the corresponding parameter can be | ||
150 | set to | ||
151 | .Dv NULL . | ||
152 | The values returned by | ||
153 | .Fn OCSP_id_get0_info | ||
154 | are internal pointers and must not be freed up by an application: | ||
155 | they will be freed when the corresponding | ||
156 | .Vt OCSP_CERTID | ||
157 | structure is freed. | ||
158 | .Pp | ||
159 | OCSP clients will typically only use | ||
160 | .Fn OCSP_cert_to_id | ||
161 | or | ||
162 | .Fn OCSP_cert_id_new : | ||
163 | the other functions are used by responder applications. | ||
164 | .Sh RETURN VALUES | ||
165 | .Fn OCSP_cert_to_id | ||
166 | and | ||
167 | .Fn OCSP_cert_id_new | ||
168 | return either a pointer to a valid | ||
169 | .Vt OCSP_CERTID | ||
170 | structure or | ||
171 | .Dv NULL | ||
172 | if an error occurred. | ||
173 | .Pp | ||
174 | .Fn OCSP_id_cmp | ||
175 | and | ||
176 | .Fn OCSP_id_issuer_cmp | ||
177 | returns 0 for a match or non-zero otherwise. | ||
178 | .Pp | ||
179 | .Fn OCSP_id_get0_info | ||
180 | returns 1 for success or 0 for failure. | ||
181 | .Sh SEE ALSO | ||
182 | .Xr crypto 3 , | ||
183 | .Xr OCSP_request_add1_nonce 3 , | ||
184 | .Xr OCSP_REQUEST_new 3 , | ||
185 | .Xr OCSP_resp_find_status 3 , | ||
186 | .Xr OCSP_response_status 3 , | ||
187 | .Xr OCSP_sendreq_new 3 | ||
diff --git a/src/lib/libcrypto/man/OCSP_request_add1_nonce.3 b/src/lib/libcrypto/man/OCSP_request_add1_nonce.3 new file mode 100644 index 0000000000..8de58d2731 --- /dev/null +++ b/src/lib/libcrypto/man/OCSP_request_add1_nonce.3 | |||
@@ -0,0 +1,160 @@ | |||
1 | .\" $OpenBSD: OCSP_request_add1_nonce.3,v 1.1 2016/11/27 20:40:07 schwarze Exp $ | ||
2 | .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2014, 2016 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: November 27 2016 $ | ||
52 | .Dt OCSP_REQUEST_ADD1_NONCE 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm OCSP_request_add1_nonce , | ||
56 | .Nm OCSP_basic_add1_nonce , | ||
57 | .Nm OCSP_check_nonce , | ||
58 | .Nm OCSP_copy_nonce | ||
59 | .Nd OCSP nonce functions | ||
60 | .Sh SYNOPSIS | ||
61 | .In openssl/ocsp.h | ||
62 | .Ft int | ||
63 | .Fo OCSP_request_add1_nonce | ||
64 | .Fa "OCSP_REQUEST *req" | ||
65 | .Fa "unsigned char *val" | ||
66 | .Fa "int len" | ||
67 | .Fc | ||
68 | .Ft int | ||
69 | .Fo OCSP_basic_add1_nonce | ||
70 | .Fa "OCSP_BASICRESP *resp" | ||
71 | .Fa "unsigned char *val" | ||
72 | .Fa "int len" | ||
73 | .Fc | ||
74 | .Ft int | ||
75 | .Fo OCSP_copy_nonce | ||
76 | .Fa "OCSP_BASICRESP *resp" | ||
77 | .Fa "OCSP_REQUEST *req" | ||
78 | .Fc | ||
79 | .Ft int | ||
80 | .Fo OCSP_check_nonce | ||
81 | .Fa "OCSP_REQUEST *req" | ||
82 | .Fa "OCSP_BASICRESP *resp" | ||
83 | .Fc | ||
84 | .Sh DESCRIPTION | ||
85 | An OCSP nonce is typically added to an OCSP request to thwart replay | ||
86 | attacks by checking the same nonce value appears in the response. | ||
87 | .Pp | ||
88 | .Fn OCSP_request_add1_nonce | ||
89 | adds a nonce of value | ||
90 | .Fa val | ||
91 | and length | ||
92 | .Fa len | ||
93 | to OCSP request | ||
94 | .Fa req . | ||
95 | If | ||
96 | .Fa val | ||
97 | is | ||
98 | .Dv NULL , | ||
99 | a random nonce is used. | ||
100 | If | ||
101 | .Fa len | ||
102 | is zero or negative, a default length will be used (currently 16 bytes). | ||
103 | For most purposes the nonce value in a request is set to a random value | ||
104 | so the | ||
105 | .Fa val | ||
106 | parameter in | ||
107 | .Fn OCSP_request_add1_nonce | ||
108 | is usually NULL. | ||
109 | .Pp | ||
110 | .Fn OCSP_basic_add1_nonce | ||
111 | is identical to | ||
112 | .Fn OCSP_request_add1_nonce | ||
113 | except it adds a nonce to OCSP basic response | ||
114 | .Fa resp . | ||
115 | .Pp | ||
116 | .Fn OCSP_check_nonce | ||
117 | compares the nonce value in | ||
118 | .Fa req | ||
119 | and | ||
120 | .Fa resp . | ||
121 | .Pp | ||
122 | .Fn OCSP_copy_nonce | ||
123 | copies any nonce value present in | ||
124 | .Fa req | ||
125 | to | ||
126 | .Fa resp . | ||
127 | .Pp | ||
128 | Some responders may include a nonce in all responses even if one is not | ||
129 | supplied. | ||
130 | .Pp | ||
131 | Some responders cache OCSP responses and do not sign each response for | ||
132 | performance reasons. | ||
133 | As a result they do not support nonces. | ||
134 | .Sh RETURN VALUES | ||
135 | .Fn OCSP_request_add1_nonce | ||
136 | and | ||
137 | .Fn OCSP_basic_add1_nonce | ||
138 | return 1 for success or 0 for failure. | ||
139 | .Pp | ||
140 | .Fn OCSP_copy_nonce | ||
141 | returns 1 if a nonce was successfully copied, 2 if no nonce was | ||
142 | present in | ||
143 | .Fa req , | ||
144 | or 0 if an error occurred. | ||
145 | .Pp | ||
146 | .Fn OCSP_check_nonce | ||
147 | returns positive values for success: 1 if nonces are present and | ||
148 | equal, 2 if both nonces are absent, or 3 if a nonce is present in | ||
149 | the response only. | ||
150 | A zero return value indicates that both nonces are present but | ||
151 | mismatch: this should be treated as an error condition. | ||
152 | A return value of -1 indicates that a nonce is present in the request | ||
153 | only: this will happen if the responder doesn't support nonces. | ||
154 | .Sh SEE ALSO | ||
155 | .Xr crypto 3 , | ||
156 | .Xr OCSP_cert_to_id 3 , | ||
157 | .Xr OCSP_REQUEST_new 3 , | ||
158 | .Xr OCSP_resp_find_status 3 , | ||
159 | .Xr OCSP_response_status 3 , | ||
160 | .Xr OCSP_sendreq_new 3 | ||
diff --git a/src/lib/libcrypto/man/OCSP_resp_find_status.3 b/src/lib/libcrypto/man/OCSP_resp_find_status.3 new file mode 100644 index 0000000000..603b155455 --- /dev/null +++ b/src/lib/libcrypto/man/OCSP_resp_find_status.3 | |||
@@ -0,0 +1,285 @@ | |||
1 | .\" $OpenBSD: OCSP_resp_find_status.3,v 1.1 2016/11/27 20:40:07 schwarze Exp $ | ||
2 | .\" OpenSSL c952780c Jun 21 07:03:34 2016 -0400 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2014 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: November 27 2016 $ | ||
52 | .Dt OCSP_RESP_FIND_STATUS 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm OCSP_resp_find_status , | ||
56 | .Nm OCSP_resp_count , | ||
57 | .Nm OCSP_resp_get0 , | ||
58 | .Nm OCSP_resp_find , | ||
59 | .Nm OCSP_single_get0_status , | ||
60 | .Nm OCSP_check_validity | ||
61 | .Nd OCSP response utility functions | ||
62 | .Sh SYNOPSIS | ||
63 | .In openssl/ocsp.h | ||
64 | .Ft int | ||
65 | .Fo OCSP_resp_find_status | ||
66 | .Fa "OCSP_BASICRESP *bs" | ||
67 | .Fa "OCSP_CERTID *id" | ||
68 | .Fa "int *status" | ||
69 | .Fa "int *reason" | ||
70 | .Fa "ASN1_GENERALIZEDTIME **revtime" | ||
71 | .Fa "ASN1_GENERALIZEDTIME **thisupd" | ||
72 | .Fa "ASN1_GENERALIZEDTIME **nextupd" | ||
73 | .Fc | ||
74 | .Ft int | ||
75 | .Fo OCSP_resp_count | ||
76 | .Fa "OCSP_BASICRESP *bs" | ||
77 | .Fc | ||
78 | .Ft OCSP_SINGLERESP * | ||
79 | .Fo OCSP_resp_get0 | ||
80 | .Fa "OCSP_BASICRESP *bs" | ||
81 | .Fa "int idx" | ||
82 | .Fc | ||
83 | .Ft int | ||
84 | .Fo OCSP_resp_find | ||
85 | .Fa "OCSP_BASICRESP *bs" | ||
86 | .Fa "OCSP_CERTID *id" | ||
87 | .Fa "int last" | ||
88 | .Fc | ||
89 | .Ft int | ||
90 | .Fo OCSP_single_get0_status | ||
91 | .Fa "OCSP_SINGLERESP *single" | ||
92 | .Fa "int *reason" | ||
93 | .Fa "ASN1_GENERALIZEDTIME **revtime" | ||
94 | .Fa "ASN1_GENERALIZEDTIME **thisupd" | ||
95 | .Fa "ASN1_GENERALIZEDTIME **nextupd" | ||
96 | .Fc | ||
97 | .Ft int | ||
98 | .Fo OCSP_check_validity | ||
99 | .Fa "ASN1_GENERALIZEDTIME *thisupd" | ||
100 | .Fa "ASN1_GENERALIZEDTIME *nextupd" | ||
101 | .Fa "long sec" | ||
102 | .Fa "long maxsec" | ||
103 | .Fc | ||
104 | .Sh DESCRIPTION | ||
105 | .Fn OCSP_resp_find_status | ||
106 | searches | ||
107 | .Fa bs | ||
108 | for an OCSP response for | ||
109 | .Fa id . | ||
110 | If it is successful, the fields of the response are returned in | ||
111 | .Pf * Fa status , | ||
112 | .Pf * Fa reason , | ||
113 | .Pf * Fa revtime , | ||
114 | .Pf * Fa thisupd | ||
115 | and | ||
116 | .Pf * Fa nextupd . | ||
117 | The | ||
118 | .Pf * Fa status | ||
119 | value will be one of | ||
120 | .Dv V_OCSP_CERTSTATUS_GOOD , | ||
121 | .Dv V_OCSP_CERTSTATUS_REVOKED , | ||
122 | or | ||
123 | .Dv V_OCSP_CERTSTATUS_UNKNOWN . | ||
124 | The | ||
125 | .Pf * Fa reason | ||
126 | and | ||
127 | .Pf * Fa revtime | ||
128 | fields are only set if the status is | ||
129 | .Dv V_OCSP_CERTSTATUS_REVOKED . | ||
130 | If set, the | ||
131 | .Pf * Fa reason | ||
132 | field will be set to the revocation reason which will be one of | ||
133 | .Dv OCSP_REVOKED_STATUS_NOSTATUS , | ||
134 | .Dv OCSP_REVOKED_STATUS_UNSPECIFIED , | ||
135 | .Dv OCSP_REVOKED_STATUS_KEYCOMPROMISE , | ||
136 | .Dv OCSP_REVOKED_STATUS_CACOMPROMISE , | ||
137 | .Dv OCSP_REVOKED_STATUS_AFFILIATIONCHANGED , | ||
138 | .Dv OCSP_REVOKED_STATUS_SUPERSEDED , | ||
139 | .Dv OCSP_REVOKED_STATUS_CESSATIONOFOPERATION , | ||
140 | .Dv OCSP_REVOKED_STATUS_CERTIFICATEHOLD | ||
141 | or | ||
142 | .Dv OCSP_REVOKED_STATUS_REMOVEFROMCRL . | ||
143 | .Pp | ||
144 | .Fn OCSP_resp_count | ||
145 | returns the number of | ||
146 | .Vt OCSP_SINGLERESP | ||
147 | structures in | ||
148 | .Fa bs . | ||
149 | .Pp | ||
150 | .Fn OCSP_resp_get0 | ||
151 | returns the | ||
152 | .Vt OCSP_SINGLERESP | ||
153 | structure in | ||
154 | .Fa bs | ||
155 | corresponding to index | ||
156 | .Fa idx , | ||
157 | where | ||
158 | .Fa idx | ||
159 | runs from 0 to | ||
160 | .Fn OCSP_resp_count bs No - 1 . | ||
161 | .Pp | ||
162 | .Fn OCSP_resp_find | ||
163 | searches | ||
164 | .Fa bs | ||
165 | for | ||
166 | .Fa id | ||
167 | and returns the index of the first matching entry after | ||
168 | .Fa last | ||
169 | or starting from the beginning if | ||
170 | .Fa last | ||
171 | is -1. | ||
172 | .Pp | ||
173 | .Fn OCSP_single_get0_status | ||
174 | extracts the fields of | ||
175 | .Fa single | ||
176 | in | ||
177 | .Pf * Fa reason , | ||
178 | .Pf * Fa revtime , | ||
179 | .Pf * Fa thisupd , | ||
180 | and | ||
181 | .Pf * Fa nextupd . | ||
182 | .Pp | ||
183 | .Fn OCSP_check_validity | ||
184 | checks the validity of | ||
185 | .Fa thisupd | ||
186 | and | ||
187 | .Fa nextupd | ||
188 | values which will be typically obtained from | ||
189 | .Fn OCSP_resp_find_status | ||
190 | or | ||
191 | .Fn OCSP_single_get0_status . | ||
192 | If | ||
193 | .Fa sec | ||
194 | is non-zero it indicates how many seconds leeway should be allowed in | ||
195 | the check. | ||
196 | If | ||
197 | .Fa maxsec | ||
198 | is positive it indicates the maximum age of | ||
199 | .Fa thisupd | ||
200 | in seconds. | ||
201 | .Pp | ||
202 | Applications will typically call | ||
203 | .Fn OCSP_resp_find_status | ||
204 | using the certificate ID of interest and then check its validity using | ||
205 | .Fn OCSP_check_validity . | ||
206 | They can then take appropriate action based on the status of the | ||
207 | certificate. | ||
208 | .Pp | ||
209 | An OCSP response for a certificate contains | ||
210 | .Sy thisUpdate | ||
211 | and | ||
212 | .Sy nextUpdate | ||
213 | fields. | ||
214 | Normally the current time should be between these two values. | ||
215 | To account for clock skew, the | ||
216 | .Fa maxsec | ||
217 | field can be set to non-zero in | ||
218 | .Fn OCSP_check_validity . | ||
219 | Some responders do not set the | ||
220 | .Sy nextUpdate | ||
221 | field. | ||
222 | This would otherwise mean an ancient response would be considered | ||
223 | valid: the | ||
224 | .Fa maxsec | ||
225 | parameter to | ||
226 | .Fn OCSP_check_validity | ||
227 | can be used to limit the permitted age of responses. | ||
228 | .Pp | ||
229 | The values written to | ||
230 | .Pf * Fa revtime , | ||
231 | .Pf * Fa thisupd , | ||
232 | and | ||
233 | .Pf * Fa nextupd | ||
234 | by | ||
235 | .Fn OCSP_resp_find_status | ||
236 | and | ||
237 | .Fn OCSP_single_get0_status | ||
238 | are internal pointers which must not be freed up by the calling | ||
239 | application. | ||
240 | Any or all of these parameters can be set to | ||
241 | .Dv NULL | ||
242 | if their value is not required. | ||
243 | .Sh RETURN VALUES | ||
244 | .Fn OCSP_resp_find_status | ||
245 | returns 1 if | ||
246 | .Fa id | ||
247 | is found in | ||
248 | .Fa bs | ||
249 | or 0 otherwise. | ||
250 | .Pp | ||
251 | .Fn OCSP_resp_count | ||
252 | returns the total number of | ||
253 | .Vt OCSP_SINGLERESP | ||
254 | fields in | ||
255 | .Fa bs . | ||
256 | .Pp | ||
257 | .Fn OCSP_resp_get0 | ||
258 | returns a pointer to an | ||
259 | .Vt OCSP_SINGLERESP | ||
260 | structure or | ||
261 | .Dv NULL | ||
262 | if | ||
263 | .Fa idx | ||
264 | is out of range. | ||
265 | .Pp | ||
266 | .Fn OCSP_resp_find | ||
267 | returns the index of | ||
268 | .Fa id | ||
269 | in | ||
270 | .Fa bs | ||
271 | (which may be 0) or -1 if | ||
272 | .Fa id | ||
273 | was not found. | ||
274 | .Pp | ||
275 | .Fn OCSP_single_get0_status | ||
276 | returns the status of | ||
277 | .Fa single | ||
278 | or -1 if an error occurred. | ||
279 | .Sh SEE ALSO | ||
280 | .Xr crypto 3 , | ||
281 | .Xr OCSP_cert_to_id 3 , | ||
282 | .Xr OCSP_request_add1_nonce 3 , | ||
283 | .Xr OCSP_REQUEST_new 3 , | ||
284 | .Xr OCSP_response_status 3 , | ||
285 | .Xr OCSP_sendreq_new 3 | ||
diff --git a/src/lib/libcrypto/man/OCSP_response_status.3 b/src/lib/libcrypto/man/OCSP_response_status.3 new file mode 100644 index 0000000000..c6fef0dc2e --- /dev/null +++ b/src/lib/libcrypto/man/OCSP_response_status.3 | |||
@@ -0,0 +1,134 @@ | |||
1 | .\" $OpenBSD: OCSP_response_status.3,v 1.1 2016/11/27 20:40:07 schwarze Exp $ | ||
2 | .\" OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2014, 2016 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: November 27 2016 $ | ||
52 | .Dt OCSP_RESPONSE_STATUS 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm OCSP_response_status , | ||
56 | .Nm OCSP_response_get1_basic , | ||
57 | .Nm OCSP_response_create , | ||
58 | .Nm OCSP_RESPONSE_free | ||
59 | .Nd OCSP response functions | ||
60 | .Sh SYNOPSIS | ||
61 | .In openssl/ocsp.h | ||
62 | .Ft int | ||
63 | .Fo OCSP_response_status | ||
64 | .Fa "OCSP_RESPONSE *resp" | ||
65 | .Fc | ||
66 | .Ft OCSP_BASICRESP * | ||
67 | .Fo OCSP_response_get1_basic | ||
68 | .Fa "OCSP_RESPONSE *resp" | ||
69 | .Fc | ||
70 | .Ft OCSP_RESPONSE * | ||
71 | .Fo OCSP_response_create | ||
72 | .Fa "int status" | ||
73 | .Fa "OCSP_BASICRESP *bs" | ||
74 | .Fc | ||
75 | .Ft void | ||
76 | .Fo OCSP_RESPONSE_free | ||
77 | .Fa "OCSP_RESPONSE *resp" | ||
78 | .Fc | ||
79 | .Sh DESCRIPTION | ||
80 | .Fn OCSP_response_status | ||
81 | returns the OCSP response status of | ||
82 | .Fa resp . | ||
83 | It returns one of the values: | ||
84 | .Dv OCSP_RESPONSE_STATUS_SUCCESSFUL , | ||
85 | .Dv OCSP_RESPONSE_STATUS_MALFORMEDREQUEST , | ||
86 | .Dv OCSP_RESPONSE_STATUS_INTERNALERROR , | ||
87 | .Dv OCSP_RESPONSE_STATUS_TRYLATER , | ||
88 | .Dv OCSP_RESPONSE_STATUS_SIGREQUIRED , | ||
89 | or | ||
90 | .Dv OCSP_RESPONSE_STATUS_UNAUTHORIZED . | ||
91 | .Pp | ||
92 | .Fn OCSP_response_get1_basic | ||
93 | decodes and returns the | ||
94 | .Vt OCSP_BASICRESP | ||
95 | structure contained in | ||
96 | .Fa resp . | ||
97 | It is only called if the status of a response is | ||
98 | .Dv OCSP_RESPONSE_STATUS_SUCCESSFUL . | ||
99 | .Pp | ||
100 | .Fn OCSP_response_create | ||
101 | creates and returns an | ||
102 | .Vt OCSP_RESPONSE | ||
103 | structure for | ||
104 | .Fa status | ||
105 | and optionally including basic response | ||
106 | .Fa bs . | ||
107 | .Pp | ||
108 | .Fn OCSP_RESPONSE_free | ||
109 | frees up OCSP response | ||
110 | .Fa resp . | ||
111 | .Sh RETURN VALUES | ||
112 | .Fn OCSP_response_status | ||
113 | returns a status value. | ||
114 | .Pp | ||
115 | .Fn OCSP_response_get1_basic | ||
116 | returns an | ||
117 | .Vt OCSP_BASICRESP | ||
118 | structure pointer or | ||
119 | .Dv NULL | ||
120 | if an error occurred. | ||
121 | .Pp | ||
122 | .Fn OCSP_response_create | ||
123 | returns an | ||
124 | .Vt OCSP_RESPONSE | ||
125 | structure pointer or | ||
126 | .Dv NULL | ||
127 | if an error occurred. | ||
128 | .Sh SEE ALSO | ||
129 | .Xr crypto 3 , | ||
130 | .Xr OCSP_cert_to_id 3 , | ||
131 | .Xr OCSP_request_add1_nonce 3 , | ||
132 | .Xr OCSP_REQUEST_new 3 , | ||
133 | .Xr OCSP_resp_find_status 3 , | ||
134 | .Xr OCSP_sendreq_new 3 | ||
diff --git a/src/lib/libcrypto/man/OCSP_sendreq_new.3 b/src/lib/libcrypto/man/OCSP_sendreq_new.3 new file mode 100644 index 0000000000..994ce9cc2a --- /dev/null +++ b/src/lib/libcrypto/man/OCSP_sendreq_new.3 | |||
@@ -0,0 +1,245 @@ | |||
1 | .\" $OpenBSD: OCSP_sendreq_new.3,v 1.1 2016/11/27 20:40:07 schwarze Exp $ | ||
2 | .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2014, 2016 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: November 27 2016 $ | ||
52 | .Dt OCSP_SENDREQ_NEW 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm OCSP_sendreq_new , | ||
56 | .Nm OCSP_sendreq_nbio , | ||
57 | .Nm OCSP_REQ_CTX_free , | ||
58 | .Nm OCSP_REQ_CTX_add1_header , | ||
59 | .Nm OCSP_REQ_CTX_set1_req , | ||
60 | .Nm OCSP_sendreq_bio | ||
61 | .Nd OCSP responder query functions | ||
62 | .Sh SYNOPSIS | ||
63 | .In openssl/ocsp.h | ||
64 | .Ft OCSP_REQ_CTX * | ||
65 | .Fo OCSP_sendreq_new | ||
66 | .Fa "BIO *io" | ||
67 | .Fa "const char *path" | ||
68 | .Fa "OCSP_REQUEST *req" | ||
69 | .Fa "int maxline" | ||
70 | .Fc | ||
71 | .Ft int | ||
72 | .Fo OCSP_sendreq_nbio | ||
73 | .Fa "OCSP_RESPONSE **presp" | ||
74 | .Fa "OCSP_REQ_CTX *rctx" | ||
75 | .Fc | ||
76 | .Ft void | ||
77 | .Fo OCSP_REQ_CTX_free | ||
78 | .Fa "OCSP_REQ_CTX *rctx" | ||
79 | .Fc | ||
80 | .Ft int | ||
81 | .Fo OCSP_REQ_CTX_add1_header | ||
82 | .Fa "OCSP_REQ_CTX *rctx" | ||
83 | .Fa "const char *name" | ||
84 | .Fa "const char *value" | ||
85 | .Fc | ||
86 | .Ft int | ||
87 | .Fo OCSP_REQ_CTX_set1_req | ||
88 | .Fa "OCSP_REQ_CTX *rctx" | ||
89 | .Fa "OCSP_REQUEST *req" | ||
90 | .Fc | ||
91 | .Ft OCSP_RESPONSE * | ||
92 | .Fo OCSP_sendreq_bio | ||
93 | .Fa "BIO *io" | ||
94 | .Fa "const char *path" | ||
95 | .Fa "OCSP_REQUEST *req" | ||
96 | .Fc | ||
97 | .Sh DESCRIPTION | ||
98 | The function | ||
99 | .Fn OCSP_sendreq_new | ||
100 | returns an | ||
101 | .Vt OCSP_REQ_CTX | ||
102 | structure using the responder | ||
103 | .Fa io , | ||
104 | the URI path | ||
105 | .Fa path , | ||
106 | the OCSP request | ||
107 | .Fa req | ||
108 | and with a response header maximum line length of | ||
109 | .Fa maxline . | ||
110 | If | ||
111 | .Fa maxline | ||
112 | is zero, a default value of 4k is used. | ||
113 | The OCSP request | ||
114 | .Fa req | ||
115 | may be set to | ||
116 | .Dv NULL | ||
117 | and provided later if required. | ||
118 | .Pp | ||
119 | The arguments to | ||
120 | .Fn OCSP_sendreq_new | ||
121 | correspond to the components of the URI. | ||
122 | For example, if the responder URI is | ||
123 | .Pa http://ocsp.com/ocspreq , | ||
124 | the BIO | ||
125 | .Fa io | ||
126 | should be connected to host | ||
127 | .Pa ocsp.com | ||
128 | on port 80 and | ||
129 | .Fa path | ||
130 | should be set to | ||
131 | .Qq /ocspreq . | ||
132 | .Pp | ||
133 | .Fn OCSP_sendreq_nbio | ||
134 | performs non-blocking I/O on the OCSP request context | ||
135 | .Fa rctx . | ||
136 | When the operation is complete it returns the response in | ||
137 | .Pf * Fa presp . | ||
138 | If | ||
139 | .Fn OCSP_sendreq_nbio | ||
140 | indicates an operation should be retried, the corresponding BIO can | ||
141 | be examined to determine which operation (read or write) should be | ||
142 | retried and appropriate action can be taken, for example a | ||
143 | .Xr select 3 | ||
144 | call on the underlying socket. | ||
145 | .Pp | ||
146 | .Fn OCSP_REQ_CTX_free | ||
147 | frees up the OCSP context | ||
148 | .Fa rctx . | ||
149 | .Pp | ||
150 | .Fn OCSP_REQ_CTX_add1_header | ||
151 | adds header | ||
152 | .Fa name | ||
153 | with value | ||
154 | .Fa value | ||
155 | to the context | ||
156 | .Fa rctx . | ||
157 | The added headers are of the form | ||
158 | .Qq Fa name : value | ||
159 | or just | ||
160 | .Qq Fa name | ||
161 | if | ||
162 | .Fa value | ||
163 | is | ||
164 | .Dv NULL . | ||
165 | .Fn OCSP_REQ_CTX_add1_header | ||
166 | can be called more than once to add multiple headers. | ||
167 | It must be called before any calls to | ||
168 | .Fn OCSP_sendreq_nbio . | ||
169 | The | ||
170 | .Fa req | ||
171 | parameter in the initial to | ||
172 | .Fn OCSP_sendreq_new | ||
173 | call must be set to | ||
174 | .Dv NULL | ||
175 | if additional headers are set. | ||
176 | .Pp | ||
177 | .Fn OCSP_REQ_CTX_set1_req | ||
178 | sets the OCSP request in | ||
179 | .Fa rctx | ||
180 | to | ||
181 | .Fa req . | ||
182 | This function should be called after any calls to | ||
183 | .Fn OCSP_REQ_CTX_add1_header . | ||
184 | .Pp | ||
185 | .Fn OCSP_sendreq_bio | ||
186 | performs an OCSP request using the responder | ||
187 | .Fa io , | ||
188 | the URI path | ||
189 | .Fa path , | ||
190 | the OCSP request | ||
191 | .Fa req . | ||
192 | It does not support retries and so cannot handle non-blocking I/O | ||
193 | efficiently. | ||
194 | It is retained for compatibility and its use in new applications | ||
195 | is not recommended. | ||
196 | .Sh RETURN VALUES | ||
197 | .Fn OCSP_sendreq_new | ||
198 | returns a valid | ||
199 | .Vt OCSP_REQ_CTX | ||
200 | structure or | ||
201 | .Dv NULL | ||
202 | if an error occurred. | ||
203 | .Pp | ||
204 | .Fn OCSP_sendreq_nbio | ||
205 | returns | ||
206 | .Sy 1 | ||
207 | if the operation was completed successfully, | ||
208 | .Sy -1 | ||
209 | if the operation should be retried, or | ||
210 | .Sy 0 | ||
211 | if an error occurred. | ||
212 | .Pp | ||
213 | .Fn OCSP_REQ_CTX_add1_header | ||
214 | and | ||
215 | .Fn OCSP_REQ_CTX_set1_req | ||
216 | return | ||
217 | .Sy 1 | ||
218 | for success or | ||
219 | .Sy 0 | ||
220 | for failure. | ||
221 | .Pp | ||
222 | .Fn OCSP_sendreq_bio | ||
223 | returns the | ||
224 | .Vt OCSP_RESPONSE | ||
225 | structure sent by the responder or | ||
226 | .Dv NULL | ||
227 | if an error occurred. | ||
228 | .Sh EXAMPLES | ||
229 | Add a Host header for | ||
230 | .Pa ocsp.com : | ||
231 | .Pp | ||
232 | .Dl OCSP_REQ_CTX_add1_header(ctx, "Host", "ocsp.com"); | ||
233 | .Sh SEE ALSO | ||
234 | .Xr crypto 3 , | ||
235 | .Xr OCSP_cert_to_id 3 , | ||
236 | .Xr OCSP_request_add1_nonce 3 , | ||
237 | .Xr OCSP_REQUEST_new 3 , | ||
238 | .Xr OCSP_resp_find_status 3 , | ||
239 | .Xr OCSP_response_status 3 | ||
240 | .Sh CAVEATS | ||
241 | These functions only perform a minimal HTTP query to a responder. | ||
242 | If an application wishes to support more advanced features, it | ||
243 | should use an alternative more complete HTTP library. | ||
244 | .Pp | ||
245 | Currently only HTTP POST queries to responders are supported. | ||