summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/ERR_put_error.3
diff options
context:
space:
mode:
authorschwarze <>2016-11-23 17:54:15 +0000
committerschwarze <>2016-11-23 17:54:15 +0000
commite8e5f59d71b35259c933157f7919776b1de45d0f (patch)
tree0f19b6e404e7a501156bde628b1892450d5a3cad /src/lib/libcrypto/man/ERR_put_error.3
parent59fa741ec83250040cc09a43447f94d846849067 (diff)
downloadopenbsd-e8e5f59d71b35259c933157f7919776b1de45d0f.tar.gz
openbsd-e8e5f59d71b35259c933157f7919776b1de45d0f.tar.bz2
openbsd-e8e5f59d71b35259c933157f7919776b1de45d0f.zip
Add Copyright and license.
Like OpenSSL, move some text from ERR(3) to the fitting page ERR_put_error(3). Merge documentation of ERR_add_error_vdata(3) from OpenSSL. Drop useless statement about void functions returning no values.
Diffstat (limited to 'src/lib/libcrypto/man/ERR_put_error.3')
-rw-r--r--src/lib/libcrypto/man/ERR_put_error.398
1 files changed, 91 insertions, 7 deletions
diff --git a/src/lib/libcrypto/man/ERR_put_error.3 b/src/lib/libcrypto/man/ERR_put_error.3
index 496d975165..2b41bedea3 100644
--- a/src/lib/libcrypto/man/ERR_put_error.3
+++ b/src/lib/libcrypto/man/ERR_put_error.3
@@ -1,6 +1,54 @@
1.\" $OpenBSD: ERR_put_error.3,v 1.3 2016/11/17 21:06:16 jmc Exp $ 1.\" $OpenBSD: ERR_put_error.3,v 1.4 2016/11/23 17:54:15 schwarze Exp $
2.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
2.\" 3.\"
3.Dd $Mdocdate: November 17 2016 $ 4.\" This file was written by Ulf Moeller <ulf@openssl.org>.
5.\" Copyright (c) 2000, 2016 The OpenSSL Project. All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\" notice, this list of conditions and the following disclaimer.
13.\"
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\" notice, this list of conditions and the following disclaimer in
16.\" the documentation and/or other materials provided with the
17.\" distribution.
18.\"
19.\" 3. All advertising materials mentioning features or use of this
20.\" software must display the following acknowledgment:
21.\" "This product includes software developed by the OpenSSL Project
22.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23.\"
24.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25.\" endorse or promote products derived from this software without
26.\" prior written permission. For written permission, please contact
27.\" openssl-core@openssl.org.
28.\"
29.\" 5. Products derived from this software may not be called "OpenSSL"
30.\" nor may "OpenSSL" appear in their names without prior written
31.\" permission of the OpenSSL Project.
32.\"
33.\" 6. Redistributions of any form whatsoever must retain the following
34.\" acknowledgment:
35.\" "This product includes software developed by the OpenSSL Project
36.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37.\"
38.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
42.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\"
51.Dd $Mdocdate: November 23 2016 $
4.Dt ERR_PUT_ERROR 3 52.Dt ERR_PUT_ERROR 3
5.Os 53.Os
6.Sh NAME 54.Sh NAME
@@ -22,6 +70,11 @@
22.Fa "int num" 70.Fa "int num"
23.Fa ... 71.Fa ...
24.Fc 72.Fc
73.Ft void
74.Fo ERR_add_error_vdata
75.Fa "int num"
76.Fa "va_list arg"
77.Fc
25.Sh DESCRIPTION 78.Sh DESCRIPTION
26.Fn ERR_put_error 79.Fn ERR_put_error
27adds an error code to the thread's error queue. 80adds an error code to the thread's error queue.
@@ -41,15 +94,46 @@ This function is usually called by a macro.
41associates the concatenation of its 94associates the concatenation of its
42.Fa num 95.Fa num
43string arguments with the error code added last. 96string arguments with the error code added last.
97.Fn ERR_add_error_vdata
98is similar except the argument is a
99.Vt va_list .
44.Pp 100.Pp
45.Xr ERR_load_strings 3 101.Xr ERR_load_strings 3
46can be used to register error strings so that the application can 102can be used to register error strings so that the application can
47generate human-readable error messages for the error code. 103generate human-readable error messages for the error code.
48.Sh RETURN VALUES 104.Pp
49.Fn ERR_put_error 105Each sub-library has a specific macro
50and 106.Fn XXXerr f r
51.Fn ERR_add_error_data 107that is used to report errors.
52return no values. 108Its first argument is a function code
109.Dv XXX_F_* ;
110the second argument is a reason code
111.Dv XXX_R_* .
112Function codes are derived from the function names
113whereas reason codes consist of textual error descriptions.
114For example, the function
115.Fn ssl23_read
116reports a "handshake failure" as follows:
117.Pp
118.Dl SSLerr(SSL_F_SSL23_READ, SSL_R_SSL_HANDSHAKE_FAILURE);
119.Pp
120Function and reason codes should consist of upper case characters,
121numbers and underscores only.
122The error file generation script translates function codes into function
123names by looking in the header files for an appropriate function name.
124If none is found it just uses the capitalized form such as "SSL23_READ"
125in the above example.
126.Pp
127The trailing section of a reason code (after the "_R_") is translated
128into lower case and underscores changed to spaces.
129.Pp
130Although a library will normally report errors using its own specific
131.Fn XXXerr
132macro, another library's macro can be used.
133This is normally only done when a library wants to include ASN.1 code
134which must use the
135.Fn ASN1err
136macro.
53.Sh SEE ALSO 137.Sh SEE ALSO
54.Xr ERR 3 , 138.Xr ERR 3 ,
55.Xr ERR_load_strings 3 139.Xr ERR_load_strings 3