diff options
author | schwarze <> | 2016-11-02 15:23:41 +0000 |
---|---|---|
committer | schwarze <> | 2016-11-02 15:23:41 +0000 |
commit | 878e440382fa65ddbadca1d2784ef1210f0ff652 (patch) | |
tree | d746bbb5cfe6d085f48965873fc3db01fe55f4d6 /src/lib/libcrypto/man/ERR_error_string.3 | |
parent | 0f15bae599b571173b77a87f7c4949ff89c55a23 (diff) | |
download | openbsd-878e440382fa65ddbadca1d2784ef1210f0ff652.tar.gz openbsd-878e440382fa65ddbadca1d2784ef1210f0ff652.tar.bz2 openbsd-878e440382fa65ddbadca1d2784ef1210f0ff652.zip |
convert ERR manuals from pod to mdoc; while reading this,
i wtfed, laughed, puked, and cried in more or less that order...
Diffstat (limited to 'src/lib/libcrypto/man/ERR_error_string.3')
-rw-r--r-- | src/lib/libcrypto/man/ERR_error_string.3 | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/ERR_error_string.3 b/src/lib/libcrypto/man/ERR_error_string.3 new file mode 100644 index 0000000000..75878d233e --- /dev/null +++ b/src/lib/libcrypto/man/ERR_error_string.3 | |||
@@ -0,0 +1,114 @@ | |||
1 | .Dd $Mdocdate: November 2 2016 $ | ||
2 | .Dt ERR_ERROR_STRING 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm ERR_error_string , | ||
6 | .Nm ERR_error_string_n , | ||
7 | .Nm ERR_lib_error_string , | ||
8 | .Nm ERR_func_error_string , | ||
9 | .Nm ERR_reason_error_string | ||
10 | .Nd obtain human-readable OpenSSL error messages | ||
11 | .Sh SYNOPSIS | ||
12 | .In openssl/err.h | ||
13 | .Ft char * | ||
14 | .Fo ERR_error_string | ||
15 | .Fa "unsigned long e" | ||
16 | .Fa "char *buf" | ||
17 | .Fc | ||
18 | .Ft void | ||
19 | .Fo ERR_error_string_n | ||
20 | .Fa "unsigned long e" | ||
21 | .Fa "char *buf" | ||
22 | .Fa "size_t len" | ||
23 | .Fc | ||
24 | .Ft const char * | ||
25 | .Fo ERR_lib_error_string | ||
26 | .Fa "unsigned long e" | ||
27 | .Fc | ||
28 | .Ft const char * | ||
29 | .Fo ERR_func_error_string | ||
30 | .Fa "unsigned long e" | ||
31 | .Fc | ||
32 | .Ft const char * | ||
33 | .Fo ERR_reason_error_string | ||
34 | .Fa "unsigned long e" | ||
35 | .Fc | ||
36 | .Sh DESCRIPTION | ||
37 | .Fn ERR_error_string | ||
38 | generates a human-readable string representing the error code | ||
39 | .Fa e | ||
40 | and places it in | ||
41 | .Fa buf . | ||
42 | .Fa buf | ||
43 | must be at least 120 bytes long. | ||
44 | If | ||
45 | .Fa buf | ||
46 | is | ||
47 | .Dv NULL , | ||
48 | the error string is placed in a static buffer. | ||
49 | .Fn ERR_error_string_n | ||
50 | is a variant of | ||
51 | .Fn ERR_error_string | ||
52 | that writes at most | ||
53 | .Fa len | ||
54 | characters (including the terminating NUL) and truncates the string | ||
55 | if necessary. | ||
56 | For | ||
57 | .Fn ERR_error_string_n , | ||
58 | .Fa buf | ||
59 | may not be | ||
60 | .Dv NULL . | ||
61 | .Pp | ||
62 | The string will have the following format: | ||
63 | .Pp | ||
64 | .Dl error:[error code]:[library name]:[function name]:[reason string] | ||
65 | .Pp | ||
66 | The error code is an 8 digit hexadecimal number. | ||
67 | The library name, the function name, and the reason string are ASCII | ||
68 | text. | ||
69 | .Pp | ||
70 | .Fn ERR_lib_error_string , | ||
71 | .Fn ERR_func_error_string , | ||
72 | and | ||
73 | .Fn ERR_reason_error_string | ||
74 | return the library name, the function name, and the reason string, | ||
75 | respectively. | ||
76 | .Pp | ||
77 | The OpenSSL error strings should be loaded by calling | ||
78 | .Xr ERR_load_crypto_strings 3 | ||
79 | or, for SSL applications, | ||
80 | .Xr SSL_load_error_strings 3 | ||
81 | first. | ||
82 | If there is no text string registered for the given error code, the | ||
83 | error string will contain the numeric code. | ||
84 | .Pp | ||
85 | .Xr ERR_print_errors 3 | ||
86 | can be used to print all error codes currently in the queue. | ||
87 | .Sh RETURN VALUES | ||
88 | .Fn ERR_error_string | ||
89 | returns a pointer to a static buffer containing the string if | ||
90 | .Fa buf | ||
91 | is | ||
92 | .Dv NULL , | ||
93 | or | ||
94 | .Fa buf | ||
95 | otherwise. | ||
96 | .Pp | ||
97 | .Fn ERR_lib_error_string , | ||
98 | .Fn ERR_func_error_string , | ||
99 | and | ||
100 | .Fn ERR_reason_error_string | ||
101 | return the strings, or | ||
102 | .Dv NULL | ||
103 | if none is registered for the error code. | ||
104 | .Sh SEE ALSO | ||
105 | .Xr ERR 3 , | ||
106 | .Xr ERR_get_error 3 , | ||
107 | .Xr ERR_load_crypto_strings 3 , | ||
108 | .Xr ERR_print_errors 3 , | ||
109 | .Xr SSL_load_error_strings 3 | ||
110 | .Sh HISTORY | ||
111 | .Fn ERR_error_string | ||
112 | is available in all versions of SSLeay and OpenSSL. | ||
113 | .Fn ERR_error_string_n | ||
114 | was added in OpenSSL 0.9.6. | ||