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/lib/libcrypto/man/BIO_dump.3 | |
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/lib/libcrypto/man/BIO_dump.3')
-rw-r--r-- | src/lib/libcrypto/man/BIO_dump.3 | 144 |
1 files changed, 144 insertions, 0 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. | ||