diff options
author | schwarze <> | 2021-07-10 15:56:18 +0000 |
---|---|---|
committer | schwarze <> | 2021-07-10 15:56:18 +0000 |
commit | 295a48e4f7e26e62353f13d97f649d07bf435662 (patch) | |
tree | be190dbc7a7e1aaf55bd1299a2b00d204a480791 /src | |
parent | c1da4349c38325cc82b5304667bba610e823b4d3 (diff) | |
download | openbsd-295a48e4f7e26e62353f13d97f649d07bf435662.tar.gz openbsd-295a48e4f7e26e62353f13d97f649d07bf435662.tar.bz2 openbsd-295a48e4f7e26e62353f13d97f649d07bf435662.zip |
new manual page BIO_dump(3)
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/man/BIO_dump.3 | 144 | ||||
-rw-r--r-- | src/lib/libcrypto/man/BIO_new.3 | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/man/Makefile | 3 |
3 files changed, 149 insertions, 3 deletions
diff --git a/src/lib/libcrypto/man/BIO_dump.3 b/src/lib/libcrypto/man/BIO_dump.3 new file mode 100644 index 0000000000..88ae7d571d --- /dev/null +++ b/src/lib/libcrypto/man/BIO_dump.3 | |||
@@ -0,0 +1,144 @@ | |||
1 | .\" $OpenBSD: BIO_dump.3,v 1.1 2021/07/10 15:56:18 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 10 2021 $ | ||
18 | .Dt BIO_DUMP 3 | ||
19 | .Os | ||
20 | .Sh NAME | ||
21 | .Nm BIO_dump , | ||
22 | .Nm BIO_dump_indent , | ||
23 | .Nm BIO_dump_fp , | ||
24 | .Nm BIO_dump_indent_fp | ||
25 | .Nd hexadecimal printout of arbitrary byte arrays | ||
26 | .Sh SYNOPSIS | ||
27 | .In openssl/bio.h | ||
28 | .Ft int | ||
29 | .Fo BIO_dump | ||
30 | .Fa "BIO *b" | ||
31 | .Fa "const char *s" | ||
32 | .Fa "int len" | ||
33 | .Fc | ||
34 | .Ft int | ||
35 | .Fo BIO_dump_indent | ||
36 | .Fa "BIO *b" | ||
37 | .Fa "const char *s" | ||
38 | .Fa "int len" | ||
39 | .Fa "int indent" | ||
40 | .Fc | ||
41 | .Ft int | ||
42 | .Fo BIO_dump_fp | ||
43 | .Fa "FILE *fp" | ||
44 | .Fa "const char *s" | ||
45 | .Fa "int len" | ||
46 | .Fc | ||
47 | .Ft int | ||
48 | .Fo BIO_dump_indent_fp | ||
49 | .Fa "FILE *fp" | ||
50 | .Fa "const char *s" | ||
51 | .Fa "int len" | ||
52 | .Fa "int indent" | ||
53 | .Fc | ||
54 | .Sh DESCRIPTION | ||
55 | .Fn BIO_dump | ||
56 | prints | ||
57 | .Fa len | ||
58 | bytes starting at | ||
59 | .Fa s | ||
60 | to | ||
61 | .Fa bio | ||
62 | in hexadecimal format. | ||
63 | .Pp | ||
64 | The first column of output contains the index, in the byte array starting at | ||
65 | .Fa s , | ||
66 | of the first byte shown on the respective output line, expressed as a | ||
67 | four-digit hexadecimal number starting at 0000, followed by a dash. | ||
68 | After the dash, sixteen bytes of data are printed as two-digit | ||
69 | hexadecimal numbers, respecting the order in which they appear in | ||
70 | the array | ||
71 | .Fa s . | ||
72 | Another dash is printed after the eighth column. | ||
73 | .Pp | ||
74 | To the right of the hexadecimal representation of the bytes, | ||
75 | the same bytes are printed again, this time as ASCII characters. | ||
76 | Non-printable ASCII characters are replaced with dots. | ||
77 | .Pp | ||
78 | Trailing space characters and NUL bytes are omitted from the main table. | ||
79 | If there are any, an additional line is printed, constisting of the | ||
80 | .Fa len | ||
81 | argument as a four-digit hexadecimal number, a dash, and the fixed string | ||
82 | .Qq <SPACES/NULS> . | ||
83 | .Pp | ||
84 | .Fn BIO_dump_indent | ||
85 | is similar except that | ||
86 | .Fa indent | ||
87 | space characters are prepended to each output line. | ||
88 | If | ||
89 | .Fa indent | ||
90 | is 7 or more, the number of data columns is reduced such that the | ||
91 | total width of the output does not exceed 79 characters per line. | ||
92 | .Pp | ||
93 | .Fn BIO_dump_fp | ||
94 | and | ||
95 | .Fn BIO_dump_indent_fp | ||
96 | are similar except that | ||
97 | .Xr fwrite 3 | ||
98 | is used instead of | ||
99 | .Xr BIO_write 3 . | ||
100 | .Sh RETURN VALUES | ||
101 | These functions return the sum of the return values of all calls to | ||
102 | .Xr BIO_write 3 | ||
103 | or | ||
104 | .Xr fwrite 3 | ||
105 | that were made. | ||
106 | This is useless because it may add a positive number, the total amount | ||
107 | of bytes written by successful calls to | ||
108 | .Xr BIO_write 3 , | ||
109 | to an incommensurable negative number, usually the number of calls to | ||
110 | .Xr BIO_write 3 | ||
111 | that failed. | ||
112 | All that can be said is that a negative return value indicates that | ||
113 | at least part of the printing failed, and a positive return value | ||
114 | indicates that at least some of the printing succeeded, but one | ||
115 | cannot tell whether success or failure were partial or complete. | ||
116 | Furthermore, a zero return value does not necessarily mean that | ||
117 | nothing was printed; it can also occur if a part of the printing | ||
118 | succeeded and another part failed. | ||
119 | .Sh SEE ALSO | ||
120 | .Xr hexdump 1 , | ||
121 | .Xr BIO_new 3 , | ||
122 | .Xr BIO_write 3 | ||
123 | .Sh HISTORY | ||
124 | .Fn BIO_dump | ||
125 | first appeared in SSLeay 0.6.5 and has been available since | ||
126 | .Ox 2.4 . | ||
127 | .Pp | ||
128 | .Fn BIO_dump_indent | ||
129 | first appeared in OpenSSL 0.9.6 and has been available since | ||
130 | .Ox 2.9 . | ||
131 | .Pp | ||
132 | .Fn BIO_dump_fp | ||
133 | and | ||
134 | .Fn BIO_dump_indent_fp | ||
135 | first appeared in OpenSSL 0.9.8 and have been available since | ||
136 | .Ox 4.5 . | ||
137 | .Sh BUGS | ||
138 | If some parts of the printing operations succeed | ||
139 | and some other parts fail, | ||
140 | .Fn BIO_dump | ||
141 | may silently yield incomplete results | ||
142 | such that the caller cannot detect the partial failure. | ||
143 | Besides, the function may have written more bytes than the return | ||
144 | value indicates. | ||
diff --git a/src/lib/libcrypto/man/BIO_new.3 b/src/lib/libcrypto/man/BIO_new.3 index a2bc40d368..e7c08c99f1 100644 --- a/src/lib/libcrypto/man/BIO_new.3 +++ b/src/lib/libcrypto/man/BIO_new.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: BIO_new.3,v 1.20 2021/03/12 07:05:35 jmc Exp $ | 1 | .\" $OpenBSD: BIO_new.3,v 1.21 2021/07/10 15:56:18 schwarze Exp $ |
2 | .\" full merge up to: | 2 | .\" full merge up to: |
3 | .\" OpenSSL man3/BIO_new.pod fb46be03 Feb 26 11:51:31 2016 +0000 | 3 | .\" OpenSSL man3/BIO_new.pod fb46be03 Feb 26 11:51:31 2016 +0000 |
4 | .\" OpenSSL man7/bio.pod 631c37be Dec 12 16:56:50 2017 +0100 | 4 | .\" OpenSSL man7/bio.pod 631c37be Dec 12 16:56:50 2017 +0100 |
@@ -52,7 +52,7 @@ | |||
52 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 52 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
53 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 53 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
54 | .\" | 54 | .\" |
55 | .Dd $Mdocdate: March 12 2021 $ | 55 | .Dd $Mdocdate: July 10 2021 $ |
56 | .Dt BIO_NEW 3 | 56 | .Dt BIO_NEW 3 |
57 | .Os | 57 | .Os |
58 | .Sh NAME | 58 | .Sh NAME |
@@ -229,6 +229,7 @@ Create a memory BIO: | |||
229 | .Dl BIO *mem = BIO_new(BIO_s_mem()); | 229 | .Dl BIO *mem = BIO_new(BIO_s_mem()); |
230 | .Sh SEE ALSO | 230 | .Sh SEE ALSO |
231 | .Xr BIO_ctrl 3 , | 231 | .Xr BIO_ctrl 3 , |
232 | .Xr BIO_dump 3 , | ||
232 | .Xr BIO_f_base64 3 , | 233 | .Xr BIO_f_base64 3 , |
233 | .Xr BIO_f_buffer 3 , | 234 | .Xr BIO_f_buffer 3 , |
234 | .Xr BIO_f_cipher 3 , | 235 | .Xr BIO_f_cipher 3 , |
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index bf76a1ce74..46a7d3beb2 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.175 2021/07/09 12:07:27 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.176 2021/07/10 15:56:18 schwarze Exp $ |
2 | 2 | ||
3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
4 | 4 | ||
@@ -22,6 +22,7 @@ MAN= \ | |||
22 | BASIC_CONSTRAINTS_new.3 \ | 22 | BASIC_CONSTRAINTS_new.3 \ |
23 | BF_set_key.3 \ | 23 | BF_set_key.3 \ |
24 | BIO_ctrl.3 \ | 24 | BIO_ctrl.3 \ |
25 | BIO_dump.3 \ | ||
25 | BIO_f_base64.3 \ | 26 | BIO_f_base64.3 \ |
26 | BIO_f_buffer.3 \ | 27 | BIO_f_buffer.3 \ |
27 | BIO_f_cipher.3 \ | 28 | BIO_f_cipher.3 \ |