diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/man/X509_STORE_CTX_set_flags.3 | 172 |
1 files changed, 41 insertions, 131 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 index 2ac76951fa..db991bd52b 100644 --- a/src/lib/libcrypto/man/X509_STORE_CTX_set_flags.3 +++ b/src/lib/libcrypto/man/X509_STORE_CTX_set_flags.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: X509_STORE_CTX_set_flags.3,v 1.6 2021/11/17 16:08:32 schwarze Exp $ | 1 | .\" $OpenBSD: X509_STORE_CTX_set_flags.3,v 1.7 2024/01/12 19:28:02 tb Exp $ |
| 2 | .\" full merge up to: OpenSSL aae41f8c Jun 25 09:47:15 2015 +0100 | 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 | 3 | .\" selective merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100 |
| 4 | .\" | 4 | .\" |
| @@ -67,7 +67,7 @@ | |||
| 67 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 67 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 68 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 68 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 69 | .\" | 69 | .\" |
| 70 | .Dd $Mdocdate: November 17 2021 $ | 70 | .Dd $Mdocdate: January 12 2024 $ |
| 71 | .Dt X509_STORE_CTX_SET_FLAGS 3 | 71 | .Dt X509_STORE_CTX_SET_FLAGS 3 |
| 72 | .Os | 72 | .Os |
| 73 | .Sh NAME | 73 | .Sh NAME |
| @@ -76,7 +76,8 @@ | |||
| 76 | .Nm X509_STORE_CTX_set_depth , | 76 | .Nm X509_STORE_CTX_set_depth , |
| 77 | .Nm X509_STORE_CTX_set_trust , | 77 | .Nm X509_STORE_CTX_set_trust , |
| 78 | .Nm X509_STORE_CTX_set_purpose , | 78 | .Nm X509_STORE_CTX_set_purpose , |
| 79 | .Nm X509_STORE_CTX_purpose_inherit , | 79 | .\" .Nm X509_STORE_CTX_purpose_inherit is intentionally undocumented |
| 80 | .\" because it will be removed in the next major bump. | ||
| 80 | .Nm X509_STORE_CTX_get0_param , | 81 | .Nm X509_STORE_CTX_get0_param , |
| 81 | .Nm X509_STORE_CTX_set0_param , | 82 | .Nm X509_STORE_CTX_set0_param , |
| 82 | .Nm X509_STORE_CTX_set_default | 83 | .Nm X509_STORE_CTX_set_default |
| @@ -109,13 +110,6 @@ | |||
| 109 | .Fa "X509_STORE_CTX *ctx" | 110 | .Fa "X509_STORE_CTX *ctx" |
| 110 | .Fa "int purpose" | 111 | .Fa "int purpose" |
| 111 | .Fc | 112 | .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 * | 113 | .Ft X509_VERIFY_PARAM * |
| 120 | .Fo X509_STORE_CTX_get0_param | 114 | .Fo X509_STORE_CTX_get0_param |
| 121 | .Fa "X509_STORE_CTX *ctx" | 115 | .Fa "X509_STORE_CTX *ctx" |
| @@ -178,9 +172,6 @@ argument is 0 or invalid | |||
| 178 | or the trust identifier is already set to a non-zero value in the | 172 | or the trust identifier is already set to a non-zero value in the |
| 179 | .Vt X509_VERIFY_PARAM | 173 | .Vt X509_VERIFY_PARAM |
| 180 | object, no action occurs. | 174 | object, no action occurs. |
| 181 | Here and in the following, | ||
| 182 | .Dv X509_TRUST_DEFAULT | ||
| 183 | counts as invalid. | ||
| 184 | .Pp | 175 | .Pp |
| 185 | .Fn X509_STORE_CTX_set_purpose | 176 | .Fn X509_STORE_CTX_set_purpose |
| 186 | sets the | 177 | sets the |
| @@ -200,7 +191,7 @@ is called the | |||
| 200 | .Pp | 191 | .Pp |
| 201 | The function fails if the | 192 | The function fails if the |
| 202 | .Fa purpose | 193 | .Fa purpose |
| 203 | argument or the associated trust is not 0 but invalid; otherwise, | 194 | argument or the associated trust is invalid but not 0; otherwise, |
| 204 | .Fn X509_STORE_CTX_set_purpose | 195 | .Fn X509_STORE_CTX_set_purpose |
| 205 | also does the equivalent of calling | 196 | also does the equivalent of calling |
| 206 | .Fn X509_STORE_CTX_set_trust | 197 | .Fn X509_STORE_CTX_set_trust |
| @@ -212,62 +203,6 @@ object, it is not changed, even if the | |||
| 212 | .Fa purpose | 203 | .Fa purpose |
| 213 | argument is valid, too. | 204 | argument is valid, too. |
| 214 | .Pp | 205 | .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 | 206 | .Fn X509_STORE_CTX_get0_param |
| 272 | retrieves an internal pointer to the verification parameters associated | 207 | retrieves an internal pointer to the verification parameters associated |
| 273 | with | 208 | with |
| @@ -293,7 +228,7 @@ and copies them using | |||
| 293 | .Fn X509_STORE_CTX_set_trust | 228 | .Fn X509_STORE_CTX_set_trust |
| 294 | returns 1 if the | 229 | returns 1 if the |
| 295 | .Fa trust | 230 | .Fa trust |
| 296 | argument is 0 or valid or 0 if it is not 0 but invalid. | 231 | argument is 0 or valid or 0 if it is invalid but not 0. |
| 297 | A return value of 1 does | 232 | A return value of 1 does |
| 298 | .Em not | 233 | .Em not |
| 299 | imply that the trust identifier stored in the | 234 | imply that the trust identifier stored in the |
| @@ -306,45 +241,9 @@ returns 1 if both the | |||
| 306 | argument and the associated trust are 0 or valid. | 241 | argument and the associated trust are 0 or valid. |
| 307 | It returns 0 if either the | 242 | It returns 0 if either the |
| 308 | .Fa purpose | 243 | .Fa purpose |
| 309 | argument or the associated trust is not 0 but invalid. | 244 | argument or the associated trust is invalid but not 0. |
| 310 | A return value of 1 does not imply that any data was changed. | 245 | A return value of 1 does not imply that any data was changed. |
| 311 | .Pp | 246 | .Pp |
| 312 | .Fn X509_STORE_CTX_purpose_inherit | ||
| 313 | returns 0 if: | ||
| 314 | .Bl -bullet | ||
| 315 | .It | ||
| 316 | The | ||
| 317 | .Fa purpose | ||
| 318 | argument is not 0 and invalid. | ||
| 319 | .It | ||
| 320 | The | ||
| 321 | .Fa purpose | ||
| 322 | argument is 0 and the | ||
| 323 | .Fa def_purpose | ||
| 324 | argument is not 0 and invalid. | ||
| 325 | .It | ||
| 326 | The associated trust is | ||
| 327 | .Dv X509_TRUST_DEFAULT | ||
| 328 | and the | ||
| 329 | .Fa def_purpose | ||
| 330 | argument is 0 or invalid, | ||
| 331 | or the trust identifier associated with it is not 0 but invalid. | ||
| 332 | .It | ||
| 333 | The | ||
| 334 | .Fa trust | ||
| 335 | argument is not 0 and invalid. | ||
| 336 | .It | ||
| 337 | The | ||
| 338 | .Fa trust | ||
| 339 | argument is 0 and the associated trust is neither 0 nor | ||
| 340 | .Dv X509_TRUST_DEFAULT | ||
| 341 | but invalid. | ||
| 342 | .El | ||
| 343 | .Pp | ||
| 344 | Otherwise, | ||
| 345 | .Fn X509_STORE_CTX_purpose_inherit | ||
| 346 | returns 1, which does not imply that any data was changed. | ||
| 347 | .Pp | ||
| 348 | .Fn X509_STORE_CTX_get0_param | 247 | .Fn X509_STORE_CTX_get0_param |
| 349 | returns a pointer to an | 248 | returns a pointer to an |
| 350 | .Vt X509_VERIFY_PARAM | 249 | .Vt X509_VERIFY_PARAM |
| @@ -355,37 +254,26 @@ if an error occurred. | |||
| 355 | .Fn X509_STORE_CTX_set_default | 254 | .Fn X509_STORE_CTX_set_default |
| 356 | returns 1 for success or 0 if an error occurred. | 255 | returns 1 for success or 0 if an error occurred. |
| 357 | .Sh ERRORS | 256 | .Sh ERRORS |
| 358 | For | 257 | The following diagnostics can be retrieved with |
| 359 | .Fn X509_STORE_CTX_set_trust , | ||
| 360 | .Fn X509_STORE_CTX_set_purpose , | ||
| 361 | and | ||
| 362 | .Fn X509_STORE_CTX_purpose_inherit , | ||
| 363 | the following diagnostics can be retrieved with | ||
| 364 | .Xr ERR_get_error 3 , | 258 | .Xr ERR_get_error 3 , |
| 365 | .Xr ERR_GET_REASON 3 , | 259 | .Xr ERR_GET_REASON 3 , |
| 366 | and | 260 | and |
| 367 | .Xr ERR_reason_error_string 3 : | 261 | .Xr ERR_reason_error_string 3 : |
| 368 | .Bl -tag -width Ds | 262 | .Bl -tag -width Ds |
| 369 | .It Dv X509_R_UNKNOWN_TRUST_ID Qq "unknown trust id" | 263 | .It Dv X509_R_UNKNOWN_TRUST_ID Qq "unknown trust id" |
| 370 | The | 264 | .Fn X509_STORE_CTX_set_trust |
| 265 | was called with a | ||
| 371 | .Fa trust | 266 | .Fa trust |
| 372 | argument or the trust identifier associated with | 267 | argument that is invalid but not 0. |
| 268 | Other implementations may also return this when | ||
| 269 | .Fn X509_STORE_CTX_set_purpose | ||
| 270 | is called with a | ||
| 373 | .Fa purpose | 271 | .Fa purpose |
| 374 | or | 272 | argument with invalid associated trust. |
| 375 | .Fa def_purpose | ||
| 376 | is not 0 but invalid, | ||
| 377 | .It Dv X509_R_UNKNOWN_PURPOSE_ID Qq "unknown purpose id" | 273 | .It Dv X509_R_UNKNOWN_PURPOSE_ID Qq "unknown purpose id" |
| 378 | The | 274 | The |
| 379 | .Fa purpose | 275 | .Fa purpose |
| 380 | argument is not 0 and invalid. | 276 | argument is invalid but not 0. |
| 381 | Or it is 0 and the | ||
| 382 | .Fa def_purpose | ||
| 383 | argument is not 0 and invalid. | ||
| 384 | Or the associated trust is | ||
| 385 | .Dv X509_TRUST_DEFAULT | ||
| 386 | and | ||
| 387 | .Fa def_purpose | ||
| 388 | is 0 or invalid. | ||
| 389 | .El | 277 | .El |
| 390 | .Pp | 278 | .Pp |
| 391 | The other functions provide no diagnostics. | 279 | The other functions provide no diagnostics. |
| @@ -405,10 +293,9 @@ The other functions provide no diagnostics. | |||
| 405 | first appeared in OpenSSL 0.9.3 and has been available since | 293 | first appeared in OpenSSL 0.9.3 and has been available since |
| 406 | .Ox 2.4 . | 294 | .Ox 2.4 . |
| 407 | .Pp | 295 | .Pp |
| 408 | .Fn X509_STORE_CTX_set_trust , | 296 | .Fn X509_STORE_CTX_set_trust |
| 409 | .Fn X509_STORE_CTX_set_purpose , | ||
| 410 | and | 297 | and |
| 411 | .Fn X509_STORE_CTX_purpose_inherit | 298 | .Fn X509_STORE_CTX_set_purpose |
| 412 | first appeared in OpenSSL 0.9.5 and have been available since | 299 | first appeared in OpenSSL 0.9.5 and have been available since |
| 413 | .Ox 2.7 . | 300 | .Ox 2.7 . |
| 414 | .Pp | 301 | .Pp |
| @@ -424,3 +311,26 @@ and | |||
| 424 | .Fn X509_STORE_CTX_set_default | 311 | .Fn X509_STORE_CTX_set_default |
| 425 | first appeared in OpenSSL 0.9.8 and have been available since | 312 | first appeared in OpenSSL 0.9.8 and have been available since |
| 426 | .Ox 4.5 . | 313 | .Ox 4.5 . |
| 314 | .Sh CAVEATS | ||
| 315 | The precise effect of a successful call to | ||
| 316 | .Fn X509_STORE_CTX_set_trust | ||
| 317 | and | ||
| 318 | .Fn X509_STORE_CTX_set_purpose | ||
| 319 | is unclear unless only one of these functions is used immediately after | ||
| 320 | .Xr X509_STORE_CTX_init 3 . | ||
| 321 | It is therefore recommended to use | ||
| 322 | .Fn X509_STORE_CTX_get0_param , | ||
| 323 | .Xr X509_VERIFY_PARAM_set_trust 3 , | ||
| 324 | and | ||
| 325 | .Xr X509_VERIFY_PARAM_set_purpose 3 | ||
| 326 | instead. | ||
| 327 | .Pp | ||
| 328 | The confusingly named | ||
| 329 | .Dv X509_TRUST_DEFAULT | ||
| 330 | is less than | ||
| 331 | .Dv X509_TRUST_MIN | ||
| 332 | and different implementations treat it as valid or invalid | ||
| 333 | when used as an associated trust or as a | ||
| 334 | .Fa trust | ||
| 335 | argument for | ||
| 336 | .Fn X509_STORE_CTX_set_trust . | ||
