summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2017-01-26 04:37:08 +0000
committerschwarze <>2017-01-26 04:37:08 +0000
commitc7118cf7a1b4ff8cec6c52fba26ecfbfba0d7919 (patch)
tree4f4c8d08d44f269fd37488942cdce03880ad29d6
parent119f57723b3389086c84a3c0d39d5cea07d6c598 (diff)
downloadopenbsd-c7118cf7a1b4ff8cec6c52fba26ecfbfba0d7919.tar.gz
openbsd-c7118cf7a1b4ff8cec6c52fba26ecfbfba0d7919.tar.bz2
openbsd-c7118cf7a1b4ff8cec6c52fba26ecfbfba0d7919.zip
Document ERR_load_BN_strings(3).
jsing@ confirmed that this function is public and worth documenting. This page needs much more work, it is outrageously incomplete and unclear. For example, it remains unexplained what error strings are, what "registering" means and what the benefit for the application is, what happens if it is not done, or what happens if an error occurs after calling ERR_free_strings(3). I tried to read the code, but it is so contorted that i postponed that work. For example, it looks like there are hooks for applications to replace the functions used for registering strings by other, application-supplied functions, and, of course, there are many levels of macro and function wrappers. For now, i only documented the most obvious BUGS.
-rw-r--r--src/lib/libcrypto/man/ERR_load_crypto_strings.358
1 files changed, 47 insertions, 11 deletions
diff --git a/src/lib/libcrypto/man/ERR_load_crypto_strings.3 b/src/lib/libcrypto/man/ERR_load_crypto_strings.3
index 213fb66222..812258f60a 100644
--- a/src/lib/libcrypto/man/ERR_load_crypto_strings.3
+++ b/src/lib/libcrypto/man/ERR_load_crypto_strings.3
@@ -1,7 +1,24 @@
1.\" $OpenBSD: ERR_load_crypto_strings.3,v 1.4 2016/11/23 17:59:29 schwarze Exp $ 1.\" $OpenBSD: ERR_load_crypto_strings.3,v 1.5 2017/01/26 04:37:08 schwarze Exp $
2.\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 2.\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400
3.\" 3.\"
4.\" This file was written by Ulf Moeller <ulf@openssl.org>. 4.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license:
6.\"
7.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
8.\"
9.\" Permission to use, copy, modify, and distribute this software for any
10.\" purpose with or without fee is hereby granted, provided that the above
11.\" copyright notice and this permission notice appear in all copies.
12.\"
13.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20.\"
21.\" The original file was written by Ulf Moeller <ulf@openssl.org>.
5.\" Copyright (c) 2000 The OpenSSL Project. All rights reserved. 22.\" Copyright (c) 2000 The OpenSSL Project. All rights reserved.
6.\" 23.\"
7.\" Redistribution and use in source and binary forms, with or without 24.\" Redistribution and use in source and binary forms, with or without
@@ -48,13 +65,14 @@
48.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 65.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49.\" OF THE POSSIBILITY OF SUCH DAMAGE. 66.\" OF THE POSSIBILITY OF SUCH DAMAGE.
50.\" 67.\"
51.Dd $Mdocdate: November 23 2016 $ 68.Dd $Mdocdate: January 26 2017 $
52.Dt ERR_LOAD_CRYPTO_STRINGS 3 69.Dt ERR_LOAD_CRYPTO_STRINGS 3
53.Os 70.Os
54.Sh NAME 71.Sh NAME
55.Nm ERR_load_crypto_strings , 72.Nm ERR_load_crypto_strings ,
56.Nm SSL_load_error_strings , 73.Nm ERR_free_strings ,
57.Nm ERR_free_strings 74.Nm ERR_load_BN_strings ,
75.Nm SSL_load_error_strings
58.Nd load and free OpenSSL error strings 76.Nd load and free OpenSSL error strings
59.Sh SYNOPSIS 77.Sh SYNOPSIS
60.In openssl/err.h 78.In openssl/err.h
@@ -62,6 +80,9 @@
62.Fn ERR_load_crypto_strings void 80.Fn ERR_load_crypto_strings void
63.Ft void 81.Ft void
64.Fn ERR_free_strings void 82.Fn ERR_free_strings void
83.In openssl/bn.h
84.Ft void
85.Fn ERR_load_BN_strings void
65.In openssl/ssl.h 86.In openssl/ssl.h
66.Ft void 87.Ft void
67.Fn SSL_load_error_strings void 88.Fn SSL_load_error_strings void
@@ -75,18 +96,25 @@ does the same, but also registers the
75.Xr ssl 3 96.Xr ssl 3
76error strings. 97error strings.
77.Pp 98.Pp
99.Fn ERR_load_BN_strings
100only registers the error strings for the
101.Vt BIGNUM
102part of the library, i.e. the functions documented in
103.Xr BN_new 3
104and in the manual pages referenced from there.
105That may be useful if no other parts of the crypto library
106are used by the program.
107Similar functions exist for other parts of the crypto library,
108but they are not yet documented.
109.Pp
110If the error strings were already loaded before, no action occurs.
111.Pp
78One of these functions should be called before generating textual error 112One of these functions should be called before generating textual error
79messages. 113messages.
80However, this is not required when memory usage is an issue. 114However, this is not required when memory usage is an issue.
81.Pp 115.Pp
82.Fn ERR_free_strings 116.Fn ERR_free_strings
83frees all previously loaded error strings. 117frees all previously loaded error strings.
84.Sh RETURN VALUES
85.Fn ERR_load_crypto_strings ,
86.Fn SSL_load_error_strings ,
87and
88.Fn ERR_free_strings
89return no values.
90.Sh SEE ALSO 118.Sh SEE ALSO
91.Xr ERR 3 , 119.Xr ERR 3 ,
92.Xr ERR_error_string 3 120.Xr ERR_error_string 3
@@ -96,3 +124,11 @@ return no values.
96and 124and
97.Fn ERR_free_strings 125.Fn ERR_free_strings
98are available in all versions of SSLeay and OpenSSL. 126are available in all versions of SSLeay and OpenSSL.
127.Sh BUGS
128Even though the error strings are already compiled into the object
129code of the library as static strings, these functions store them
130again using dynamically allocated memory on the heap.
131That may fail if insufficient memory is available,
132but these functions do not report such errors.
133Instead, they fail silently, possibly having registered none or only
134a part of the strings requested.