summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/ERR_error_string.3
diff options
context:
space:
mode:
authorschwarze <>2016-11-02 15:23:41 +0000
committerschwarze <>2016-11-02 15:23:41 +0000
commit878e440382fa65ddbadca1d2784ef1210f0ff652 (patch)
treed746bbb5cfe6d085f48965873fc3db01fe55f4d6 /src/lib/libcrypto/man/ERR_error_string.3
parent0f15bae599b571173b77a87f7c4949ff89c55a23 (diff)
downloadopenbsd-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.3114
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
38generates a human-readable string representing the error code
39.Fa e
40and places it in
41.Fa buf .
42.Fa buf
43must be at least 120 bytes long.
44If
45.Fa buf
46is
47.Dv NULL ,
48the error string is placed in a static buffer.
49.Fn ERR_error_string_n
50is a variant of
51.Fn ERR_error_string
52that writes at most
53.Fa len
54characters (including the terminating NUL) and truncates the string
55if necessary.
56For
57.Fn ERR_error_string_n ,
58.Fa buf
59may not be
60.Dv NULL .
61.Pp
62The string will have the following format:
63.Pp
64.Dl error:[error code]:[library name]:[function name]:[reason string]
65.Pp
66The error code is an 8 digit hexadecimal number.
67The library name, the function name, and the reason string are ASCII
68text.
69.Pp
70.Fn ERR_lib_error_string ,
71.Fn ERR_func_error_string ,
72and
73.Fn ERR_reason_error_string
74return the library name, the function name, and the reason string,
75respectively.
76.Pp
77The OpenSSL error strings should be loaded by calling
78.Xr ERR_load_crypto_strings 3
79or, for SSL applications,
80.Xr SSL_load_error_strings 3
81first.
82If there is no text string registered for the given error code, the
83error string will contain the numeric code.
84.Pp
85.Xr ERR_print_errors 3
86can be used to print all error codes currently in the queue.
87.Sh RETURN VALUES
88.Fn ERR_error_string
89returns a pointer to a static buffer containing the string if
90.Fa buf
91is
92.Dv NULL ,
93or
94.Fa buf
95otherwise.
96.Pp
97.Fn ERR_lib_error_string ,
98.Fn ERR_func_error_string ,
99and
100.Fn ERR_reason_error_string
101return the strings, or
102.Dv NULL
103if 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
112is available in all versions of SSLeay and OpenSSL.
113.Fn ERR_error_string_n
114was added in OpenSSL 0.9.6.