diff options
Diffstat (limited to 'src/lib/libcrypto/man/X509_STORE_CTX_set_flags.3')
| -rw-r--r-- | src/lib/libcrypto/man/X509_STORE_CTX_set_flags.3 | 420 |
1 files changed, 0 insertions, 420 deletions
diff --git a/src/lib/libcrypto/man/X509_STORE_CTX_set_flags.3 b/src/lib/libcrypto/man/X509_STORE_CTX_set_flags.3 deleted file mode 100644 index 7247927385..0000000000 --- a/src/lib/libcrypto/man/X509_STORE_CTX_set_flags.3 +++ /dev/null | |||
| @@ -1,420 +0,0 @@ | |||
| 1 | .\" $OpenBSD: X509_STORE_CTX_set_flags.3,v 1.3 2021/07/25 14:05:03 schwarze Exp $ | ||
| 2 | .\" full merge up to: OpenSSL aae41f8c Jun 25 09:47:15 2015 +0100 | ||
| 3 | .\" selective merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100 | ||
| 4 | .\" | ||
| 5 | .\" This file is a derived work. | ||
| 6 | .\" The changes are covered by the following Copyright and license: | ||
| 7 | .\" | ||
| 8 | .\" Copyright (c) 2019 Claudio Jeker <claudio@openbsd.org> | ||
| 9 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> | ||
| 10 | .\" | ||
| 11 | .\" Permission to use, copy, modify, and distribute this software for any | ||
| 12 | .\" purpose with or without fee is hereby granted, provided that the above | ||
| 13 | .\" copyright notice and this permission notice appear in all copies. | ||
| 14 | .\" | ||
| 15 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES | ||
| 16 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 17 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR | ||
| 18 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 19 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 20 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 21 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 22 | .\" | ||
| 23 | .\" The original file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
| 24 | .\" Copyright (c) 2009 The OpenSSL Project. All rights reserved. | ||
| 25 | .\" | ||
| 26 | .\" Redistribution and use in source and binary forms, with or without | ||
| 27 | .\" modification, are permitted provided that the following conditions | ||
| 28 | .\" are met: | ||
| 29 | .\" | ||
| 30 | .\" 1. Redistributions of source code must retain the above copyright | ||
| 31 | .\" notice, this list of conditions and the following disclaimer. | ||
| 32 | .\" | ||
| 33 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
| 34 | .\" notice, this list of conditions and the following disclaimer in | ||
| 35 | .\" the documentation and/or other materials provided with the | ||
| 36 | .\" distribution. | ||
| 37 | .\" | ||
| 38 | .\" 3. All advertising materials mentioning features or use of this | ||
| 39 | .\" software must display the following acknowledgment: | ||
| 40 | .\" "This product includes software developed by the OpenSSL Project | ||
| 41 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
| 42 | .\" | ||
| 43 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 44 | .\" endorse or promote products derived from this software without | ||
| 45 | .\" prior written permission. For written permission, please contact | ||
| 46 | .\" openssl-core@openssl.org. | ||
| 47 | .\" | ||
| 48 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
| 49 | .\" nor may "OpenSSL" appear in their names without prior written | ||
| 50 | .\" permission of the OpenSSL Project. | ||
| 51 | .\" | ||
| 52 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
| 53 | .\" acknowledgment: | ||
| 54 | .\" "This product includes software developed by the OpenSSL Project | ||
| 55 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
| 56 | .\" | ||
| 57 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 58 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 59 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 60 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 61 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 62 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 63 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 64 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 65 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 66 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 67 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 68 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 69 | .\" | ||
| 70 | .Dd $Mdocdate: July 25 2021 $ | ||
| 71 | .Dt X509_STORE_CTX_SET_FLAGS 3 | ||
| 72 | .Os | ||
| 73 | .Sh NAME | ||
| 74 | .Nm X509_STORE_CTX_set_flags , | ||
| 75 | .Nm X509_STORE_CTX_set_time , | ||
| 76 | .Nm X509_STORE_CTX_set_depth , | ||
| 77 | .Nm X509_STORE_CTX_set_trust , | ||
| 78 | .Nm X509_STORE_CTX_set_purpose , | ||
| 79 | .Nm X509_STORE_CTX_purpose_inherit , | ||
| 80 | .Nm X509_STORE_CTX_get0_param , | ||
| 81 | .Nm X509_STORE_CTX_set0_param , | ||
| 82 | .Nm X509_STORE_CTX_set_default | ||
| 83 | .Nd X509_STORE_CTX parameter initialisation | ||
| 84 | .Sh SYNOPSIS | ||
| 85 | .In openssl/x509_vfy.h | ||
| 86 | .Ft void | ||
| 87 | .Fo X509_STORE_CTX_set_flags | ||
| 88 | .Fa "X509_STORE_CTX *ctx" | ||
| 89 | .Fa "unsigned long flags" | ||
| 90 | .Fc | ||
| 91 | .Ft void | ||
| 92 | .Fo X509_STORE_CTX_set_time | ||
| 93 | .Fa "X509_STORE_CTX *ctx" | ||
| 94 | .Fa "unsigned long dummy" | ||
| 95 | .Fa "time_t time" | ||
| 96 | .Fc | ||
| 97 | .Ft void | ||
| 98 | .Fo X509_STORE_CTX_set_depth | ||
| 99 | .Fa "X509_STORE_CTX *ctx" | ||
| 100 | .Fa "int depth" | ||
| 101 | .Fc | ||
| 102 | .Ft int | ||
| 103 | .Fo X509_STORE_CTX_set_trust | ||
| 104 | .Fa "X509_STORE_CTX *ctx" | ||
| 105 | .Fa "int trust" | ||
| 106 | .Fc | ||
| 107 | .Ft int | ||
| 108 | .Fo X509_STORE_CTX_set_purpose | ||
| 109 | .Fa "X509_STORE_CTX *ctx" | ||
| 110 | .Fa "int purpose" | ||
| 111 | .Fc | ||
| 112 | .Ft int | ||
| 113 | .Fo X509_STORE_CTX_purpose_inherit | ||
| 114 | .Fa "X509_STORE_CTX *ctx" | ||
| 115 | .Fa "int def_purpose" | ||
| 116 | .Fa "int purpose" | ||
| 117 | .Fa "int trust" | ||
| 118 | .Fc | ||
| 119 | .Ft X509_VERIFY_PARAM * | ||
| 120 | .Fo X509_STORE_CTX_get0_param | ||
| 121 | .Fa "X509_STORE_CTX *ctx" | ||
| 122 | .Fc | ||
| 123 | .Ft void | ||
| 124 | .Fo X509_STORE_CTX_set0_param | ||
| 125 | .Fa "X509_STORE_CTX *ctx" | ||
| 126 | .Fa "X509_VERIFY_PARAM *param" | ||
| 127 | .Fc | ||
| 128 | .Ft int | ||
| 129 | .Fo X509_STORE_CTX_set_default | ||
| 130 | .Fa "X509_STORE_CTX *ctx" | ||
| 131 | .Fa "const char *name" | ||
| 132 | .Fc | ||
| 133 | .Sh DESCRIPTION | ||
| 134 | These functions operate on the | ||
| 135 | .Vt X509_VERIFY_PARAM | ||
| 136 | object used by | ||
| 137 | .Fa ctx . | ||
| 138 | Usually, | ||
| 139 | .Xr X509_STORE_CTX_init 3 | ||
| 140 | is called on | ||
| 141 | .Fa ctx | ||
| 142 | before these functions, and | ||
| 143 | .Xr X509_verify_cert 3 | ||
| 144 | afterwards. | ||
| 145 | .Pp | ||
| 146 | .Fn X509_STORE_CTX_set_flags | ||
| 147 | sets the internal verification parameter flags to | ||
| 148 | .Fa flags . | ||
| 149 | See | ||
| 150 | .Xr X509_VERIFY_PARAM_set_flags 3 | ||
| 151 | for a description of the verification flags. | ||
| 152 | .Pp | ||
| 153 | .Fn X509_STORE_CTX_set_time | ||
| 154 | sets the verification | ||
| 155 | .Fa time | ||
| 156 | using | ||
| 157 | .Xr X509_VERIFY_PARAM_set_time 3 . | ||
| 158 | The | ||
| 159 | .Fa dummy | ||
| 160 | argument is ignored. | ||
| 161 | .Pp | ||
| 162 | .Fn X509_STORE_CTX_set_depth | ||
| 163 | sets the maximum verification | ||
| 164 | .Fa depth | ||
| 165 | using | ||
| 166 | .Xr X509_VERIFY_PARAM_set_depth 3 . | ||
| 167 | That is the maximum number of untrusted CA certificates | ||
| 168 | that can appear in a chain. | ||
| 169 | .Pp | ||
| 170 | .Fn X509_STORE_CTX_set_trust | ||
| 171 | sets the | ||
| 172 | .Fa trust | ||
| 173 | identifier that can also be set using | ||
| 174 | .Xr X509_VERIFY_PARAM_set_trust 3 . | ||
| 175 | If the | ||
| 176 | .Fa trust | ||
| 177 | argument is 0 or invalid | ||
| 178 | or the trust identifier is already set to a non-zero value in the | ||
| 179 | .Vt X509_VERIFY_PARAM | ||
| 180 | object, no action occurs. | ||
| 181 | Here and in the following, | ||
| 182 | .Dv X509_TRUST_DEFAULT | ||
| 183 | counts as invalid. | ||
| 184 | .Pp | ||
| 185 | .Fn X509_STORE_CTX_set_purpose | ||
| 186 | sets the | ||
| 187 | .Fa purpose | ||
| 188 | identifier that can also be set using | ||
| 189 | .Xr X509_VERIFY_PARAM_set_purpose 3 . | ||
| 190 | If the | ||
| 191 | .Fa purpose | ||
| 192 | argument is 0 or any failure occurs, nothing is changed. | ||
| 193 | .Pp | ||
| 194 | In the following, the trust identifier contained in the | ||
| 195 | .Vt X509_PURPOSE | ||
| 196 | object associated with | ||
| 197 | .Fa purpose | ||
| 198 | is called the | ||
| 199 | .Dq associated trust . | ||
| 200 | .Pp | ||
| 201 | The function fails if the | ||
| 202 | .Fa purpose | ||
| 203 | argument or the associated trust is not 0 but invalid; otherwise, | ||
| 204 | .Fn X509_STORE_CTX_set_purpose | ||
| 205 | also does the equivalent of calling | ||
| 206 | .Fn X509_STORE_CTX_set_trust | ||
| 207 | with the associated trust. | ||
| 208 | .Pp | ||
| 209 | If the purpose identifier is already set to a non-zero value in the | ||
| 210 | .Vt X509_VERIFY_PARAM | ||
| 211 | object, it is not changed, even if the | ||
| 212 | .Fa purpose | ||
| 213 | argument is valid, too. | ||
| 214 | .Pp | ||
| 215 | .Fn X509_STORE_CTX_purpose_inherit | ||
| 216 | is similar to | ||
| 217 | .Fn X509_STORE_CTX_set_purpose , | ||
| 218 | with the following modifications: | ||
| 219 | .Bl -bullet | ||
| 220 | .It | ||
| 221 | If the | ||
| 222 | .Fa purpose | ||
| 223 | argument is 0, | ||
| 224 | .Fa def_purpose | ||
| 225 | is used instead. | ||
| 226 | .It | ||
| 227 | If the associated trust is | ||
| 228 | .Dv X509_TRUST_DEFAULT , | ||
| 229 | the trust associated with | ||
| 230 | .Fa def_purpose | ||
| 231 | is used instead, or if | ||
| 232 | .Fa def_purpose | ||
| 233 | is 0 or invalid, the function fails. | ||
| 234 | .It | ||
| 235 | If the | ||
| 236 | .Fa trust | ||
| 237 | argument is not 0, it is used instead of the associated trust, | ||
| 238 | and the equivalent of calling | ||
| 239 | .Fn X509_STORE_CTX_set_trust | ||
| 240 | is done even if both | ||
| 241 | .Fa purpose | ||
| 242 | and | ||
| 243 | .Fa def_purpose | ||
| 244 | are 0. | ||
| 245 | Even if the | ||
| 246 | .Fa trust | ||
| 247 | argument is not 0, if the (then unused) associated trust is | ||
| 248 | .Dv X509_TRUST_DEFAULT , | ||
| 249 | .Fa def_purpose | ||
| 250 | is still required to be valid. | ||
| 251 | .El | ||
| 252 | .Pp | ||
| 253 | Note that, even if all arguments are valid and the return value is 1, | ||
| 254 | it is possible that nothing changed, or that only either one of the | ||
| 255 | purpose and trust identifiers were set, or that both were set. | ||
| 256 | It can also happen that the purpose identifier gets set according to the | ||
| 257 | .Fa purpose | ||
| 258 | argument, but the trust identifier gets set according to the | ||
| 259 | .Fa def_purpose | ||
| 260 | argument in the same call. | ||
| 261 | .Pp | ||
| 262 | The intended way of using this function is to pass the purpose and | ||
| 263 | trust attributes of another structure of an arbitrary type as the | ||
| 264 | .Fa purpose | ||
| 265 | and | ||
| 266 | .Fa trust | ||
| 267 | arguments, and to provide | ||
| 268 | .Fa def_purpose | ||
| 269 | as a fallback in case the settings in the other structure are incomplete. | ||
| 270 | .Pp | ||
| 271 | .Fn X509_STORE_CTX_get0_param | ||
| 272 | retrieves an internal pointer to the verification parameters associated | ||
| 273 | with | ||
| 274 | .Fa ctx . | ||
| 275 | .Pp | ||
| 276 | .Fn X509_STORE_CTX_set0_param | ||
| 277 | sets the internal verification parameter pointer to | ||
| 278 | .Fa param . | ||
| 279 | After this call | ||
| 280 | .Fa param | ||
| 281 | should not be used. | ||
| 282 | .Pp | ||
| 283 | .Fn X509_STORE_CTX_set_default | ||
| 284 | looks up and sets the default verification method to | ||
| 285 | .Fa name . | ||
| 286 | This uses the function | ||
| 287 | .Xr X509_VERIFY_PARAM_lookup 3 | ||
| 288 | to find an appropriate set of parameters from | ||
| 289 | .Fa name . | ||
| 290 | .Sh RETURN VALUES | ||
| 291 | .Fn X509_STORE_CTX_set_trust | ||
| 292 | returns 1 if the | ||
| 293 | .Fa trust | ||
| 294 | argument is 0 or valid or 0 if it is not 0 but invalid. | ||
| 295 | A return value of 1 does | ||
| 296 | .Em not | ||
| 297 | imply that the trust identifier stored in the | ||
| 298 | .Vt X509_VERIFY_PARAM | ||
| 299 | object was changed. | ||
| 300 | .Pp | ||
| 301 | .Fn X509_STORE_CTX_set_purpose | ||
| 302 | returns 1 if both the | ||
| 303 | .Fa purpose | ||
| 304 | argument and the associated trust are 0 or valid. | ||
| 305 | It returns 0 if either the | ||
| 306 | .Fa purpose | ||
| 307 | argument or the associated trust is not 0 but invalid. | ||
| 308 | A return value of 1 does not imply that any data was changed. | ||
| 309 | .Pp | ||
| 310 | .Fn X509_STORE_CTX_purpose_inherit | ||
| 311 | returns 0 if: | ||
| 312 | .Bl -bullet | ||
| 313 | .It | ||
| 314 | The | ||
| 315 | .Fa purpose | ||
| 316 | argument is not 0 and invalid. | ||
| 317 | .It | ||
| 318 | The | ||
| 319 | .Fa purpose | ||
| 320 | argument is 0 and the | ||
| 321 | .Fa def_purpose | ||
| 322 | argument is not 0 and invalid. | ||
| 323 | .It | ||
| 324 | The associated trust is | ||
| 325 | .Dv X509_TRUST_DEFAULT | ||
| 326 | and the | ||
| 327 | .Fa def_purpose | ||
| 328 | argument is 0 or invalid, | ||
| 329 | or the trust identifier associated with it is not 0 but invalid. | ||
| 330 | .It | ||
| 331 | The | ||
| 332 | .Fa trust | ||
| 333 | argument is not 0 and invalid. | ||
| 334 | .It | ||
| 335 | The | ||
| 336 | .Fa trust | ||
| 337 | argument is 0 and the associated trust is neither 0 nor | ||
| 338 | .Dv X509_TRUST_DEFAULT | ||
| 339 | but invalid. | ||
| 340 | .El | ||
| 341 | .Pp | ||
| 342 | Otherwise, | ||
| 343 | .Fn X509_STORE_CTX_purpose_inherit | ||
| 344 | returns 1, which does not imply that any data was changed. | ||
| 345 | .Pp | ||
| 346 | .Fn X509_STORE_CTX_get0_param | ||
| 347 | returns a pointer to an | ||
| 348 | .Vt X509_VERIFY_PARAM | ||
| 349 | structure or | ||
| 350 | .Dv NULL | ||
| 351 | if an error occurred. | ||
| 352 | .Pp | ||
| 353 | .Fn X509_STORE_CTX_set_default | ||
| 354 | returns 1 for success or 0 if an error occurred. | ||
| 355 | .Sh ERRORS | ||
| 356 | For | ||
| 357 | .Fn X509_STORE_CTX_set_trust , | ||
| 358 | .Fn X509_STORE_CTX_set_purpose , | ||
| 359 | and | ||
| 360 | .Fn X509_STORE_CTX_purpose_inherit , | ||
| 361 | the following diagnostics can be retrieved with | ||
| 362 | .Xr ERR_get_error 3 , | ||
| 363 | .Xr ERR_GET_REASON 3 , | ||
| 364 | and | ||
| 365 | .Xr ERR_reason_error_string 3 : | ||
| 366 | .Bl -tag -width Ds | ||
| 367 | .It Dv X509_R_UNKNOWN_TRUST_ID Qq "unknown trust id" | ||
| 368 | The | ||
| 369 | .Fa trust | ||
| 370 | argument or the trust identifier associated with | ||
| 371 | .Fa purpose | ||
| 372 | or | ||
| 373 | .Fa def_purpose | ||
| 374 | is not 0 but invalid, | ||
| 375 | .It Dv X509_R_UNKNOWN_PURPOSE_ID Qq "unknown purpose id" | ||
| 376 | The | ||
| 377 | .Fa purpose | ||
| 378 | argument is not 0 and invalid. | ||
| 379 | Or it is 0 and the | ||
| 380 | .Fa def_purpose | ||
| 381 | argument is not 0 and invalid. | ||
| 382 | Or the associated trust is | ||
| 383 | .Dv X509_TRUST_DEFAULT | ||
| 384 | and | ||
| 385 | .Fa def_purpose | ||
| 386 | is 0 or invalid. | ||
| 387 | .El | ||
| 388 | .Pp | ||
| 389 | The other functions provide no diagnostics. | ||
| 390 | .Sh SEE ALSO | ||
| 391 | .Xr X509_STORE_CTX_get_error 3 , | ||
| 392 | .Xr X509_STORE_CTX_new 3 , | ||
| 393 | .Xr X509_STORE_new 3 , | ||
| 394 | .Xr X509_STORE_set1_param 3 , | ||
| 395 | .Xr X509_verify_cert 3 , | ||
| 396 | .Xr X509_VERIFY_PARAM_set_flags 3 | ||
| 397 | .Sh HISTORY | ||
| 398 | .Fn X509_STORE_CTX_set_depth | ||
| 399 | first appeared in OpenSSL 0.9.3 and has been available since | ||
| 400 | .Ox 2.4 . | ||
| 401 | .Pp | ||
| 402 | .Fn X509_STORE_CTX_set_trust , | ||
| 403 | .Fn X509_STORE_CTX_set_purpose , | ||
| 404 | and | ||
| 405 | .Fn X509_STORE_CTX_purpose_inherit | ||
| 406 | first appeared in OpenSSL 0.9.5 and have been available since | ||
| 407 | .Ox 2.7 . | ||
| 408 | .Pp | ||
| 409 | .Fn X509_STORE_CTX_set_flags | ||
| 410 | and | ||
| 411 | .Fn X509_STORE_CTX_set_time | ||
| 412 | first appeared in OpenSSL 0.9.6 and have been available since | ||
| 413 | .Ox 2.9 . | ||
| 414 | .Pp | ||
| 415 | .Fn X509_STORE_CTX_get0_param , | ||
| 416 | .Fn X509_STORE_CTX_set0_param , | ||
| 417 | and | ||
| 418 | .Fn X509_STORE_CTX_set_default | ||
| 419 | first appeared in OpenSSL 0.9.8 and have been available since | ||
| 420 | .Ox 4.5 . | ||
