summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2021-08-02 16:29:27 +0000
committerschwarze <>2021-08-02 16:29:27 +0000
commit0ecea185788b59c18b870883d6c5b87eb7356139 (patch)
tree4922183f586bbd2c1a947ebc56fc9dea3f098d64 /src
parent81222eb9d0105d482a5bbb50d4bafd1cf5810f8d (diff)
downloadopenbsd-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.336
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
171set to 171set to
172.Dv NULL . 172.Dv NULL .
173.Pp
174This lookup method is peculiar in so far as calling
175.Fn X509_LOOKUP_ctrl
176on a lookup object using it does not yet add any certificates to the associated
177.Vt X509_STORE
178object.
179They 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
174The 182The
175.Fa command 183.Fa command
@@ -290,6 +298,7 @@ to
290.Xr X509_NAME_hash 3 298.Xr X509_NAME_hash 3
291and converts the resulting hash to an eight-digit lower-case 299and converts the resulting hash to an eight-digit lower-case
292hexadecimal number. 300hexadecimal number.
301.Pp
293If the 302If the
294.Fa type 303.Fa type
295is 304is
@@ -314,6 +323,10 @@ i.e. they start with
314and the files are read with 323and the files are read with
315.Xr X509_load_crl_file 3 . 324.Xr X509_load_crl_file 3 .
316.Pp 325.Pp
326In case of success, the first match is returned in the
327.Pf * Fa object
328provided by the caller, overwriting any previous content.
329.Pp
317Unless an application program manually constructs its own 330Unless an application program manually constructs its own
318.Vt X509_LOOKUP_METHOD 331.Vt X509_LOOKUP_METHOD
319object containing its own callback functions, 332object containing its own callback functions,
@@ -369,7 +382,12 @@ is neither
369.Dv X509_LU_X509 382.Dv X509_LU_X509
370nor 383nor
371.Dv X509_LU_CRL , 384.Dv X509_LU_CRL ,
372or if memory allocation fails. 385if no match is found, or if memory allocation fails.
386If
387.Fa lookup
388uses a user-defined
389.Vt X509_LOOKUP_METHOD
390object, it might also return negative values for internal errors.
373.Pp 391.Pp
374.Fn X509_LOOKUP_init 392.Fn X509_LOOKUP_init
375and 393and
@@ -487,6 +505,7 @@ or calling
487with a 505with a
488.Dv NULL 506.Dv NULL
489.Fa name 507.Fa name
508or with arguments that yield no match
490causes failure but provides no diagnostics. 509causes 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
503and 523and