.\" $OpenBSD: ERR_load_crypto_strings.3,v 1.7 2018/03/27 17:35:50 schwarze Exp $ .\" OpenSSL a528d4f0 Oct 27 13:40:11 2015 -0400 .\" .\" This file is a derived work. .\" The changes are covered by the following Copyright and license: .\" .\" Copyright (c) 2017 Ingo Schwarze .\" .\" Permission to use, copy, modify, and distribute this software for any .\" purpose with or without fee is hereby granted, provided that the above .\" copyright notice and this permission notice appear in all copies. .\" .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" The original file was written by Ulf Moeller . .\" Copyright (c) 2000 The OpenSSL Project. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in .\" the documentation and/or other materials provided with the .\" distribution. .\" .\" 3. All advertising materials mentioning features or use of this .\" software must display the following acknowledgment: .\" "This product includes software developed by the OpenSSL Project .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" .\" .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to .\" endorse or promote products derived from this software without .\" prior written permission. For written permission, please contact .\" openssl-core@openssl.org. .\" .\" 5. Products derived from this software may not be called "OpenSSL" .\" nor may "OpenSSL" appear in their names without prior written .\" permission of the OpenSSL Project. .\" .\" 6. Redistributions of any form whatsoever must retain the following .\" acknowledgment: .\" "This product includes software developed by the OpenSSL Project .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" .\" .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd $Mdocdate: March 27 2018 $ .Dt ERR_LOAD_CRYPTO_STRINGS 3 .Os .Sh NAME .Nm ERR_load_crypto_strings , .Nm ERR_free_strings , .Nm ERR_load_BN_strings , .Nm SSL_load_error_strings .Nd load and free OpenSSL error strings .Sh SYNOPSIS .In openssl/err.h .Ft void .Fn ERR_load_crypto_strings void .Ft void .Fn ERR_free_strings void .In openssl/bn.h .Ft void .Fn ERR_load_BN_strings void .In openssl/ssl.h .Ft void .Fn SSL_load_error_strings void .Sh DESCRIPTION .Fn ERR_load_crypto_strings registers the error strings for all .Xr crypto 3 functions. .Fn SSL_load_error_strings does the same, but also registers the .Xr ssl 3 error strings. .Pp .Fn ERR_load_BN_strings only registers the error strings for the .Vt BIGNUM part of the library, i.e. the functions documented in .Xr BN_new 3 and in the manual pages referenced from there. That may be useful if no other parts of the crypto library are used by the program. Similar functions exist for other parts of the crypto library, but they are not yet documented. .Pp If the error strings were already loaded before, no action occurs. .Pp One of these functions should be called before generating textual error messages. However, this is not required when memory usage is an issue. .Pp .Fn ERR_free_strings frees all previously loaded error strings. .Sh SEE ALSO .Xr ERR 3 , .Xr ERR_error_string 3 .Sh HISTORY .Fn ERR_load_crypto_strings and .Fn SSL_load_error_strings first appeared in SSLeay 0.4.4. .Fn ERR_free_strings and .Fn ERR_load_BN_strings first appeared in SSLeay 0.5.1. These functions been available since .Ox 2.4 . .Sh BUGS Even though the error strings are already compiled into the object code of the library as static strings, these functions store them again using dynamically allocated memory on the heap. That may fail if insufficient memory is available, but these functions do not report such errors. Instead, they fail silently, possibly having registered none or only a part of the strings requested.