summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2016-11-23 17:54:15 +0000
committerschwarze <>2016-11-23 17:54:15 +0000
commite8e5f59d71b35259c933157f7919776b1de45d0f (patch)
tree0f19b6e404e7a501156bde628b1892450d5a3cad
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.
-rw-r--r--src/lib/libcrypto/man/ERR.388
-rw-r--r--src/lib/libcrypto/man/ERR_put_error.398
2 files changed, 143 insertions, 43 deletions
diff --git a/src/lib/libcrypto/man/ERR.3 b/src/lib/libcrypto/man/ERR.3
index 6818a1cf46..973ba2713a 100644
--- a/src/lib/libcrypto/man/ERR.3
+++ b/src/lib/libcrypto/man/ERR.3
@@ -1,6 +1,55 @@
1.\" $OpenBSD: ERR.3,v 1.4 2016/11/17 21:06:16 jmc Exp $ 1.\" $OpenBSD: ERR.3,v 1.5 2016/11/23 17:54:15 schwarze Exp $
2.\" OpenSSL 186bb907 Apr 13 11:05:13 2015 -0700
2.\" 3.\"
3.Dd $Mdocdate: November 17 2016 $ 4.\" This file was written by Ulf Moeller <ulf@openssl.org> and
5.\" Dr. Stephen Henson <steve@openssl.org>.
6.\" Copyright (c) 2000, 2015 The OpenSSL Project. All rights reserved.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\" notice, this list of conditions and the following disclaimer.
14.\"
15.\" 2. Redistributions in binary form must reproduce the above copyright
16.\" notice, this list of conditions and the following disclaimer in
17.\" the documentation and/or other materials provided with the
18.\" distribution.
19.\"
20.\" 3. All advertising materials mentioning features or use of this
21.\" software must display the following acknowledgment:
22.\" "This product includes software developed by the OpenSSL Project
23.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
24.\"
25.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26.\" endorse or promote products derived from this software without
27.\" prior written permission. For written permission, please contact
28.\" openssl-core@openssl.org.
29.\"
30.\" 5. Products derived from this software may not be called "OpenSSL"
31.\" nor may "OpenSSL" appear in their names without prior written
32.\" permission of the OpenSSL Project.
33.\"
34.\" 6. Redistributions of any form whatsoever must retain the following
35.\" acknowledgment:
36.\" "This product includes software developed by the OpenSSL Project
37.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
38.\"
39.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\"
52.Dd $Mdocdate: November 23 2016 $
4.Dt ERR 3 53.Dt ERR 3
5.Os 54.Os
6.Sh NAME 55.Sh NAME
@@ -9,7 +58,7 @@
9.Sh SYNOPSIS 58.Sh SYNOPSIS
10.In openssl/err.h 59.In openssl/err.h
11.Sh DESCRIPTION 60.Sh DESCRIPTION
12When a call to the OpenSSL library fails, this is usually signalled by 61When a call to the OpenSSL library fails, this is usually signaled by
13the return value, and an error code is stored in an error queue 62the return value, and an error code is stored in an error queue
14associated with the current thread. 63associated with the current thread.
15The 64The
@@ -41,45 +90,12 @@ within your application.
41.Pp 90.Pp
42The remainder of this section is of interest only if you want to add new 91The remainder of this section is of interest only if you want to add new
43error codes to OpenSSL or add error codes from external libraries. 92error codes to OpenSSL or add error codes from external libraries.
44.Ss Reporting errors
45Each sub-library has a specific macro
46.Fn XXXerr f r
47that is used to report errors.
48Its first argument is a function code
49.Dv XXX_F_* ;
50the second argument is a reason code
51.Dv XXX_R_* .
52Function codes are derived from the function names
53whereas reason codes consist of textual error descriptions.
54For example, the function
55.Fn ssl23_read
56reports a "handshake failure" as follows:
57.Pp
58.Dl SSLerr(SSL_F_SSL23_READ, SSL_R_SSL_HANDSHAKE_FAILURE);
59.Pp
60Function and reason codes should consist of upper case characters,
61numbers and underscores only.
62The error file generation script translates function codes into function
63names by looking in the header files for an appropriate function name.
64If none is found it just uses the capitalized form such as "SSL23_READ"
65in the above example.
66.Pp
67The trailing section of a reason code (after the "_R_") is translated
68into lower case and underscores changed to spaces.
69.Pp 93.Pp
70When you are using new function or reason codes, run 94When you are using new function or reason codes, run
71.Sy make errors . 95.Sy make errors .
72The necessary 96The necessary
73.Sy #define Ns s 97.Sy #define Ns s
74will then automatically be added to the sub-library's header file. 98will then automatically be added to the sub-library's header file.
75.Pp
76Although a library will normally report errors using its own specific
77.Fn XXXerr
78macro, another library's macro can be used.
79This is normally only done when a library wants to include ASN.1 code
80which must use the
81.Fn ASN1err
82macro.
83.Ss Adding new libraries 99.Ss Adding new libraries
84When adding a new sub-library to OpenSSL, assign it a library number 100When adding a new sub-library to OpenSSL, assign it a library number
85.Dv ERR_LIB_XXX , 101.Dv ERR_LIB_XXX ,
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