diff options
author | schwarze <> | 2021-08-02 16:29:27 +0000 |
---|---|---|
committer | schwarze <> | 2021-08-02 16:29:27 +0000 |
commit | 0ecea185788b59c18b870883d6c5b87eb7356139 (patch) | |
tree | 4922183f586bbd2c1a947ebc56fc9dea3f098d64 /src | |
parent | 81222eb9d0105d482a5bbb50d4bafd1cf5810f8d (diff) | |
download | openbsd-0ecea185788b59c18b870883d6c5b87eb7356139.tar.gz openbsd-0ecea185788b59c18b870883d6c5b87eb7356139.tar.bz2 openbsd-0ecea185788b59c18b870883d6c5b87eb7356139.zip |
tweaks regarding X509_LOOKUP_by_subject(3):
* document the X509_OBJECT output parameter
* more precision regarding return values
* clarify relationship with X509_LOOKUP_ctrl(3) for the dir lookup method
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/man/X509_LOOKUP_new.3 | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/src/lib/libcrypto/man/X509_LOOKUP_new.3 b/src/lib/libcrypto/man/X509_LOOKUP_new.3 index 02fe4c9f4e..2386e65de9 100644 --- a/src/lib/libcrypto/man/X509_LOOKUP_new.3 +++ b/src/lib/libcrypto/man/X509_LOOKUP_new.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: X509_LOOKUP_new.3,v 1.1 2021/07/31 14:54:33 schwarze Exp $ | 1 | .\" $OpenBSD: X509_LOOKUP_new.3,v 1.2 2021/08/02 16:29:27 schwarze Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> | 3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> |
4 | .\" | 4 | .\" |
@@ -14,7 +14,7 @@ | |||
14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16 | .\" | 16 | .\" |
17 | .Dd $Mdocdate: July 31 2021 $ | 17 | .Dd $Mdocdate: August 2 2021 $ |
18 | .Dt X509_LOOKUP_NEW 3 | 18 | .Dt X509_LOOKUP_NEW 3 |
19 | .Os | 19 | .Os |
20 | .Sh NAME | 20 | .Sh NAME |
@@ -70,7 +70,7 @@ | |||
70 | .Fa "X509_LOOKUP *lookup" | 70 | .Fa "X509_LOOKUP *lookup" |
71 | .Fa "int type" | 71 | .Fa "int type" |
72 | .Fa "X509_NAME *name" | 72 | .Fa "X509_NAME *name" |
73 | .Fa "X509_OBJECT *ret" | 73 | .Fa "X509_OBJECT *object" |
74 | .Fc | 74 | .Fc |
75 | .Ft int | 75 | .Ft int |
76 | .Fn X509_LOOKUP_init "X509_LOOKUP *lookup" | 76 | .Fn X509_LOOKUP_init "X509_LOOKUP *lookup" |
@@ -82,7 +82,7 @@ | |||
82 | .Fa "int type" | 82 | .Fa "int type" |
83 | .Fa "X509_NAME *name" | 83 | .Fa "X509_NAME *name" |
84 | .Fa "ASN1_INTEGER *serial" | 84 | .Fa "ASN1_INTEGER *serial" |
85 | .Fa "X509_OBJECT *ret" | 85 | .Fa "X509_OBJECT *object" |
86 | .Fc | 86 | .Fc |
87 | .Ft int | 87 | .Ft int |
88 | .Fo X509_LOOKUP_by_fingerprint | 88 | .Fo X509_LOOKUP_by_fingerprint |
@@ -90,7 +90,7 @@ | |||
90 | .Fa "int type" | 90 | .Fa "int type" |
91 | .Fa "const unsigned char *bytes" | 91 | .Fa "const unsigned char *bytes" |
92 | .Fa "int length" | 92 | .Fa "int length" |
93 | .Fa "X509_OBJECT *ret" | 93 | .Fa "X509_OBJECT *object" |
94 | .Fc | 94 | .Fc |
95 | .Ft int | 95 | .Ft int |
96 | .Fo X509_LOOKUP_by_alias | 96 | .Fo X509_LOOKUP_by_alias |
@@ -98,7 +98,7 @@ | |||
98 | .Fa "int type" | 98 | .Fa "int type" |
99 | .Fa "const char *string" | 99 | .Fa "const char *string" |
100 | .Fa "int length" | 100 | .Fa "int length" |
101 | .Fa "X509_OBJECT *ret" | 101 | .Fa "X509_OBJECT *object" |
102 | .Fc | 102 | .Fc |
103 | .In openssl/x509.h | 103 | .In openssl/x509.h |
104 | .Ft const char * | 104 | .Ft const char * |
@@ -170,6 +170,14 @@ and | |||
170 | .Fa ret | 170 | .Fa ret |
171 | set to | 171 | set to |
172 | .Dv NULL . | 172 | .Dv NULL . |
173 | .Pp | ||
174 | This lookup method is peculiar in so far as calling | ||
175 | .Fn X509_LOOKUP_ctrl | ||
176 | on a lookup object using it does not yet add any certificates to the associated | ||
177 | .Vt X509_STORE | ||
178 | object. | ||
179 | They need to be added selectively using | ||
180 | .Fn X509_LOOKUP_by_subject . | ||
173 | .It Xr X509_LOOKUP_file 3 | 181 | .It Xr X509_LOOKUP_file 3 |
174 | The | 182 | The |
175 | .Fa command | 183 | .Fa command |
@@ -290,6 +298,7 @@ to | |||
290 | .Xr X509_NAME_hash 3 | 298 | .Xr X509_NAME_hash 3 |
291 | and converts the resulting hash to an eight-digit lower-case | 299 | and converts the resulting hash to an eight-digit lower-case |
292 | hexadecimal number. | 300 | hexadecimal number. |
301 | .Pp | ||
293 | If the | 302 | If the |
294 | .Fa type | 303 | .Fa type |
295 | is | 304 | is |
@@ -314,6 +323,10 @@ i.e. they start with | |||
314 | and the files are read with | 323 | and the files are read with |
315 | .Xr X509_load_crl_file 3 . | 324 | .Xr X509_load_crl_file 3 . |
316 | .Pp | 325 | .Pp |
326 | In case of success, the first match is returned in the | ||
327 | .Pf * Fa object | ||
328 | provided by the caller, overwriting any previous content. | ||
329 | .Pp | ||
317 | Unless an application program manually constructs its own | 330 | Unless an application program manually constructs its own |
318 | .Vt X509_LOOKUP_METHOD | 331 | .Vt X509_LOOKUP_METHOD |
319 | object containing its own callback functions, | 332 | object containing its own callback functions, |
@@ -369,7 +382,12 @@ is neither | |||
369 | .Dv X509_LU_X509 | 382 | .Dv X509_LU_X509 |
370 | nor | 383 | nor |
371 | .Dv X509_LU_CRL , | 384 | .Dv X509_LU_CRL , |
372 | or if memory allocation fails. | 385 | if no match is found, or if memory allocation fails. |
386 | If | ||
387 | .Fa lookup | ||
388 | uses a user-defined | ||
389 | .Vt X509_LOOKUP_METHOD | ||
390 | object, it might also return negative values for internal errors. | ||
373 | .Pp | 391 | .Pp |
374 | .Fn X509_LOOKUP_init | 392 | .Fn X509_LOOKUP_init |
375 | and | 393 | and |
@@ -487,6 +505,7 @@ or calling | |||
487 | with a | 505 | with a |
488 | .Dv NULL | 506 | .Dv NULL |
489 | .Fa name | 507 | .Fa name |
508 | or with arguments that yield no match | ||
490 | causes failure but provides no diagnostics. | 509 | causes failure but provides no diagnostics. |
491 | .Sh SEE ALSO | 510 | .Sh SEE ALSO |
492 | .Xr d2i_X509_bio 3 , | 511 | .Xr d2i_X509_bio 3 , |
@@ -497,7 +516,8 @@ causes failure but provides no diagnostics. | |||
497 | .Xr X509_NAME_new 3 , | 516 | .Xr X509_NAME_new 3 , |
498 | .Xr X509_new 3 , | 517 | .Xr X509_new 3 , |
499 | .Xr X509_OBJECT_get_type 3 , | 518 | .Xr X509_OBJECT_get_type 3 , |
500 | .Xr X509_STORE_add_cert 3 | 519 | .Xr X509_STORE_add_cert 3 , |
520 | .Xr X509_STORE_get_by_subject 3 | ||
501 | .Sh HISTORY | 521 | .Sh HISTORY |
502 | .Fn X509_get_default_cert_dir | 522 | .Fn X509_get_default_cert_dir |
503 | and | 523 | and |