diff options
author | schwarze <> | 2016-11-23 17:54:15 +0000 |
---|---|---|
committer | schwarze <> | 2016-11-23 17:54:15 +0000 |
commit | e8e5f59d71b35259c933157f7919776b1de45d0f (patch) | |
tree | 0f19b6e404e7a501156bde628b1892450d5a3cad | |
parent | 59fa741ec83250040cc09a43447f94d846849067 (diff) | |
download | openbsd-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.3 | 88 | ||||
-rw-r--r-- | src/lib/libcrypto/man/ERR_put_error.3 | 98 |
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 |
12 | When a call to the OpenSSL library fails, this is usually signalled by | 61 | When a call to the OpenSSL library fails, this is usually signaled by |
13 | the return value, and an error code is stored in an error queue | 62 | the return value, and an error code is stored in an error queue |
14 | associated with the current thread. | 63 | associated with the current thread. |
15 | The | 64 | The |
@@ -41,45 +90,12 @@ within your application. | |||
41 | .Pp | 90 | .Pp |
42 | The remainder of this section is of interest only if you want to add new | 91 | The remainder of this section is of interest only if you want to add new |
43 | error codes to OpenSSL or add error codes from external libraries. | 92 | error codes to OpenSSL or add error codes from external libraries. |
44 | .Ss Reporting errors | ||
45 | Each sub-library has a specific macro | ||
46 | .Fn XXXerr f r | ||
47 | that is used to report errors. | ||
48 | Its first argument is a function code | ||
49 | .Dv XXX_F_* ; | ||
50 | the second argument is a reason code | ||
51 | .Dv XXX_R_* . | ||
52 | Function codes are derived from the function names | ||
53 | whereas reason codes consist of textual error descriptions. | ||
54 | For example, the function | ||
55 | .Fn ssl23_read | ||
56 | reports a "handshake failure" as follows: | ||
57 | .Pp | ||
58 | .Dl SSLerr(SSL_F_SSL23_READ, SSL_R_SSL_HANDSHAKE_FAILURE); | ||
59 | .Pp | ||
60 | Function and reason codes should consist of upper case characters, | ||
61 | numbers and underscores only. | ||
62 | The error file generation script translates function codes into function | ||
63 | names by looking in the header files for an appropriate function name. | ||
64 | If none is found it just uses the capitalized form such as "SSL23_READ" | ||
65 | in the above example. | ||
66 | .Pp | ||
67 | The trailing section of a reason code (after the "_R_") is translated | ||
68 | into lower case and underscores changed to spaces. | ||
69 | .Pp | 93 | .Pp |
70 | When you are using new function or reason codes, run | 94 | When you are using new function or reason codes, run |
71 | .Sy make errors . | 95 | .Sy make errors . |
72 | The necessary | 96 | The necessary |
73 | .Sy #define Ns s | 97 | .Sy #define Ns s |
74 | will then automatically be added to the sub-library's header file. | 98 | will then automatically be added to the sub-library's header file. |
75 | .Pp | ||
76 | Although a library will normally report errors using its own specific | ||
77 | .Fn XXXerr | ||
78 | macro, another library's macro can be used. | ||
79 | This is normally only done when a library wants to include ASN.1 code | ||
80 | which must use the | ||
81 | .Fn ASN1err | ||
82 | macro. | ||
83 | .Ss Adding new libraries | 99 | .Ss Adding new libraries |
84 | When adding a new sub-library to OpenSSL, assign it a library number | 100 | When 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 |
27 | adds an error code to the thread's error queue. | 80 | adds an error code to the thread's error queue. |
@@ -41,15 +94,46 @@ This function is usually called by a macro. | |||
41 | associates the concatenation of its | 94 | associates the concatenation of its |
42 | .Fa num | 95 | .Fa num |
43 | string arguments with the error code added last. | 96 | string arguments with the error code added last. |
97 | .Fn ERR_add_error_vdata | ||
98 | is 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 |
46 | can be used to register error strings so that the application can | 102 | can be used to register error strings so that the application can |
47 | generate human-readable error messages for the error code. | 103 | generate human-readable error messages for the error code. |
48 | .Sh RETURN VALUES | 104 | .Pp |
49 | .Fn ERR_put_error | 105 | Each sub-library has a specific macro |
50 | and | 106 | .Fn XXXerr f r |
51 | .Fn ERR_add_error_data | 107 | that is used to report errors. |
52 | return no values. | 108 | Its first argument is a function code |
109 | .Dv XXX_F_* ; | ||
110 | the second argument is a reason code | ||
111 | .Dv XXX_R_* . | ||
112 | Function codes are derived from the function names | ||
113 | whereas reason codes consist of textual error descriptions. | ||
114 | For example, the function | ||
115 | .Fn ssl23_read | ||
116 | reports a "handshake failure" as follows: | ||
117 | .Pp | ||
118 | .Dl SSLerr(SSL_F_SSL23_READ, SSL_R_SSL_HANDSHAKE_FAILURE); | ||
119 | .Pp | ||
120 | Function and reason codes should consist of upper case characters, | ||
121 | numbers and underscores only. | ||
122 | The error file generation script translates function codes into function | ||
123 | names by looking in the header files for an appropriate function name. | ||
124 | If none is found it just uses the capitalized form such as "SSL23_READ" | ||
125 | in the above example. | ||
126 | .Pp | ||
127 | The trailing section of a reason code (after the "_R_") is translated | ||
128 | into lower case and underscores changed to spaces. | ||
129 | .Pp | ||
130 | Although a library will normally report errors using its own specific | ||
131 | .Fn XXXerr | ||
132 | macro, another library's macro can be used. | ||
133 | This is normally only done when a library wants to include ASN.1 code | ||
134 | which must use the | ||
135 | .Fn ASN1err | ||
136 | macro. | ||
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 |