summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/man/Makefile3
-rw-r--r--src/lib/libcrypto/man/X509V3_EXT_print.3155
-rw-r--r--src/lib/libcrypto/man/X509V3_get_d2i.37
-rw-r--r--src/lib/libcrypto/man/X509_EXTENSION_set_object.35
-rw-r--r--src/lib/libcrypto/man/X509v3_get_ext_by_NID.35
5 files changed, 167 insertions, 8 deletions
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile
index f910d81c22..0216f12ab6 100644
--- a/src/lib/libcrypto/man/Makefile
+++ b/src/lib/libcrypto/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.178 2021/07/11 19:03:45 schwarze Exp $ 1# $OpenBSD: Makefile,v 1.179 2021/07/12 11:47:01 schwarze Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
@@ -324,6 +324,7 @@ MAN= \
324 X509_sign.3 \ 324 X509_sign.3 \
325 X509_signature_dump.3 \ 325 X509_signature_dump.3 \
326 X509_verify_cert.3 \ 326 X509_verify_cert.3 \
327 X509V3_EXT_print.3 \
327 X509v3_get_ext_by_NID.3 \ 328 X509v3_get_ext_by_NID.3 \
328 crypto.3 \ 329 crypto.3 \
329 d2i_ASN1_NULL.3 \ 330 d2i_ASN1_NULL.3 \
diff --git a/src/lib/libcrypto/man/X509V3_EXT_print.3 b/src/lib/libcrypto/man/X509V3_EXT_print.3
new file mode 100644
index 0000000000..d9063e4881
--- /dev/null
+++ b/src/lib/libcrypto/man/X509V3_EXT_print.3
@@ -0,0 +1,155 @@
1.\" $OpenBSD: X509V3_EXT_print.3,v 1.1 2021/07/12 11:47:01 schwarze Exp $
2.\"
3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: July 12 2021 $
18.Dt X509V3_EXT_PRINT 3
19.Os
20.Sh NAME
21.Nm X509V3_EXT_print
22.Nd pretty-print an X.509 extension
23.Sh SYNOPSIS
24.In openssl/x509v3.h
25.Ft int
26.Fo X509V3_EXT_print
27.Fa "BIO *bio"
28.Fa "X509_EXTENSION *ext"
29.Fa "unsigned long flags"
30.Fa "int indent"
31.Fc
32.Sh DESCRIPTION
33.Fn X509V3_EXT_print
34decodes
35.Fa ext
36and prints the data contained in it to
37.Fa bio
38in a human-readable format with a left margin of
39.Fa indent
40space characters.
41The details of both the decoding and the printing depend on the type of
42.Fa ext .
43.Pp
44For most extension types, the decoding is done in the same way
45as it would be done by the appropriate public API function, for example:
46.Pp
47.Bl -tag -width NID_authority_key_identifier -compact
48.It Sy extension type
49.Sy decoding function
50.It Dv NID_subject_key_identifier
51.Xr d2i_ASN1_OCTET_STRING 3
52.It Dv NID_key_usage
53.Xr d2i_ASN1_BIT_STRING 3
54.It Dv NID_crl_number
55.Xr d2i_ASN1_INTEGER 3
56.It Dv NID_crl_reason
57.Xr d2i_ASN1_ENUMERATED 3
58.It Dv NID_invalidity_date
59.Xr d2i_ASN1_GENERALIZEDTIME 3
60.It Dv NID_subject_alt_name
61.Xr d2i_GENERAL_NAMES 3
62.It Dv NID_hold_instruction_code
63.Xr d2i_ASN1_OBJECT 3
64.It Dv NID_id_pkix_OCSP_noCheck
65.Xr d2i_ASN1_NULL 3
66.It Dv NID_authority_key_identifier
67.Xr d2i_AUTHORITY_KEYID 3
68.It Dv NID_certificate_policies
69.Xr d2i_CERTIFICATEPOLICIES 3
70.It Dv NID_id_pkix_OCSP_CrlID
71.Xr d2i_OCSP_CRLID 3
72.It Dv NID_id_pkix_OCSP_Nonce
73non-public function built into the library
74.El
75.Pp
76For some types, the printing is performed
77by a dedicated non-public function built into the library.
78For some other types, the printing function is a public API function,
79but none of these printing functions are documented yet.
80.Pp
81If
82.Fa ext
83is of an unknown extension type or if decoding fails
84while using the decoding function for the relevant type,
85the action taken depends on the
86.Fa flags
87argument:
88.Bl -bullet
89.It
90If the bit
91.Dv X509V3_EXT_PARSE_UNKNOWN
92is set,
93.Xr ASN1_parse_dump 3
94is called on the BER-encoded data of the extension, passing \-1 for the
95.Fa dump
96argument.
97Thus, some information about the encoding of the extension gets printed
98and some about its decoded content, falling back to
99.Xr BIO_dump_indent 3
100for the decoded content unless a dedicated printing method is known
101for the respective data type(s).
102Note that even if an extension type is unknown, the data type used
103by the unknown extension, or, if that data type is constructed, of
104the values contained in it, may still be known, which may allow
105printing the content of even an unknown extension in a structured
106or partially structured form.
107.It
108If the bit
109.Dv X509V3_EXT_DUMP_UNKNOWN
110is set,
111.Xr BIO_dump_indent 3
112is called on the BER-encoded data of the extension without decoding
113it first, which is usually less readable than the above but poses
114a smaller risk of omitting or misrepresenting parts of the information.
115.It
116If the bit
117.Dv X509V3_EXT_ERROR_UNKNOWN
118is set, only the fixed string
119.Qq "<Not Supported>"
120is printed for an unknown type or only the fixed string
121.Qq "<Parse Error>"
122if the parsing functions fails,
123but printing is considered as successful anyway.
124.It
125If more than one of these three bits is set, or if a bit in
126.Dv X509V3_EXT_UNKNOWN_MASK
127is set that is not listed above, nothing is printed, but printing
128is considered as successful anyway.
129.It
130If none of the bits in
131.Dv X509V3_EXT_UNKNOWN_MASK
132are set, nothing is printed and printing is considered as failed.
133.El
134.Sh RETURN VALUES
135.Fn X509V3_EXT_print
136returns 0 if failure was both detected and considered relevant.
137Otherwise, 1 is returned, and in general the user cannot tell whether
138failure simply went undetected, whether the function detected failure
139but regarded it as irrelevant, or whether printing did indeed
140succeed.
141.Sh SEE ALSO
142.Xr BIO_new 3 ,
143.Xr X509_EXTENSION_new 3 ,
144.Xr X509_get0_extensions 3 ,
145.Xr X509_get_ext 3
146.Sh HISTORY
147.Fn X509V3_EXT_print
148first appeared in OpenSSL 0.9.2 and has been available since
149.Ox 2.6 .
150.Sh BUGS
151.Fn X509V3_EXT_print
152lacks error handling throughout.
153When a write operation fails, it will usually ignore the fact that
154information was omitted from the output and report success to the
155caller anyway.
diff --git a/src/lib/libcrypto/man/X509V3_get_d2i.3 b/src/lib/libcrypto/man/X509V3_get_d2i.3
index 13f1eda35d..8a4f4dfb06 100644
--- a/src/lib/libcrypto/man/X509V3_get_d2i.3
+++ b/src/lib/libcrypto/man/X509V3_get_d2i.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: X509V3_get_d2i.3,v 1.17 2019/08/22 15:15:35 schwarze Exp $ 1.\" $OpenBSD: X509V3_get_d2i.3,v 1.18 2021/07/12 11:47:01 schwarze Exp $
2.\" full merge up to: OpenSSL ff7fbfd5 Nov 2 11:52:01 2015 +0000 2.\" full merge up to: OpenSSL ff7fbfd5 Nov 2 11:52:01 2015 +0000
3.\" selective merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 3.\" selective merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400
4.\" 4.\"
@@ -49,7 +49,7 @@
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE. 50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\" 51.\"
52.Dd $Mdocdate: August 22 2019 $ 52.Dd $Mdocdate: July 12 2021 $
53.Dt X509V3_GET_D2I 3 53.Dt X509V3_GET_D2I 3
54.Os 54.Os
55.Sh NAME 55.Sh NAME
@@ -416,7 +416,8 @@ if no extensions are present.
416.Xr X509_get_subject_name 3 , 416.Xr X509_get_subject_name 3 ,
417.Xr X509_get_version 3 , 417.Xr X509_get_version 3 ,
418.Xr X509_new 3 , 418.Xr X509_new 3 ,
419.Xr X509_REVOKED_new 3 419.Xr X509_REVOKED_new 3 ,
420.Xr X509V3_EXT_print 3
420.Sh HISTORY 421.Sh HISTORY
421.Fn X509V3_EXT_d2i 422.Fn X509V3_EXT_d2i
422first appeared in OpenSSL 0.9.2b. 423first appeared in OpenSSL 0.9.2b.
diff --git a/src/lib/libcrypto/man/X509_EXTENSION_set_object.3 b/src/lib/libcrypto/man/X509_EXTENSION_set_object.3
index 95bbebfa25..36b48f61ac 100644
--- a/src/lib/libcrypto/man/X509_EXTENSION_set_object.3
+++ b/src/lib/libcrypto/man/X509_EXTENSION_set_object.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: X509_EXTENSION_set_object.3,v 1.10 2019/06/06 01:06:59 schwarze Exp $ 1.\" $OpenBSD: X509_EXTENSION_set_object.3,v 1.11 2021/07/12 11:47:01 schwarze Exp $
2.\" OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400 2.\" OpenSSL bb9ad09e Jun 6 00:43:05 2016 -0400
3.\" 3.\"
4.\" This file is a derived work. 4.\" This file is a derived work.
@@ -65,7 +65,7 @@
65.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 65.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
66.\" OF THE POSSIBILITY OF SUCH DAMAGE. 66.\" OF THE POSSIBILITY OF SUCH DAMAGE.
67.\" 67.\"
68.Dd $Mdocdate: June 6 2019 $ 68.Dd $Mdocdate: July 12 2021 $
69.Dt X509_EXTENSION_SET_OBJECT 3 69.Dt X509_EXTENSION_SET_OBJECT 3
70.Os 70.Os
71.Sh NAME 71.Sh NAME
@@ -287,6 +287,7 @@ pointer.
287.Xr X509_check_ca 3 , 287.Xr X509_check_ca 3 ,
288.Xr X509_check_host 3 , 288.Xr X509_check_host 3 ,
289.Xr X509_check_issued 3 , 289.Xr X509_check_issued 3 ,
290.Xr X509V3_EXT_print 3 ,
290.Xr X509V3_get_d2i 3 , 291.Xr X509V3_get_d2i 3 ,
291.Xr X509v3_get_ext_by_NID 3 292.Xr X509v3_get_ext_by_NID 3
292.Sh STANDARDS 293.Sh STANDARDS
diff --git a/src/lib/libcrypto/man/X509v3_get_ext_by_NID.3 b/src/lib/libcrypto/man/X509v3_get_ext_by_NID.3
index 97d54911f5..0267e185d1 100644
--- a/src/lib/libcrypto/man/X509v3_get_ext_by_NID.3
+++ b/src/lib/libcrypto/man/X509v3_get_ext_by_NID.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: X509v3_get_ext_by_NID.3,v 1.11 2019/06/06 01:06:59 schwarze Exp $ 1.\" $OpenBSD: X509v3_get_ext_by_NID.3,v 1.12 2021/07/12 11:47:01 schwarze Exp $
2.\" full merge up to: OpenSSL fd38836b Jun 20 15:25:43 2018 +0100 2.\" full merge up to: OpenSSL fd38836b Jun 20 15:25:43 2018 +0100
3.\" 3.\"
4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>. 4.\" This file was written by Dr. Stephen Henson <steve@openssl.org>.
@@ -48,7 +48,7 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 50.\"
51.Dd $Mdocdate: June 6 2019 $ 51.Dd $Mdocdate: July 12 2021 $
52.Dt X509V3_GET_EXT_BY_NID 3 52.Dt X509V3_GET_EXT_BY_NID 3
53.Os 53.Os
54.Sh NAME 54.Sh NAME
@@ -392,6 +392,7 @@ returns 1 on success or 0 on error.
392.Xr X509_EXTENSION_new 3 , 392.Xr X509_EXTENSION_new 3 ,
393.Xr X509_new 3 , 393.Xr X509_new 3 ,
394.Xr X509_REVOKED_new 3 , 394.Xr X509_REVOKED_new 3 ,
395.Xr X509V3_EXT_print 3 ,
395.Xr X509V3_get_d2i 3 396.Xr X509V3_get_d2i 3
396.Sh HISTORY 397.Sh HISTORY
397These functions first appeared in SSLeay 0.8.0 398These functions first appeared in SSLeay 0.8.0