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 /src/lib/libcrypto/man/ERR.3 | |
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.
Diffstat (limited to 'src/lib/libcrypto/man/ERR.3')
-rw-r--r-- | src/lib/libcrypto/man/ERR.3 | 88 |
1 files changed, 52 insertions, 36 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 , |