1*a7acfad9Sjsing /* $OpenBSD: err_all.c,v 1.36 2024/03/29 02:22:18 jsing Exp $ */
25b37fcf3Sryker /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
35b37fcf3Sryker * All rights reserved.
45b37fcf3Sryker *
55b37fcf3Sryker * This package is an SSL implementation written
65b37fcf3Sryker * by Eric Young (eay@cryptsoft.com).
75b37fcf3Sryker * The implementation was written so as to conform with Netscapes SSL.
85b37fcf3Sryker *
95b37fcf3Sryker * This library is free for commercial and non-commercial use as long as
105b37fcf3Sryker * the following conditions are aheared to. The following conditions
115b37fcf3Sryker * apply to all code found in this distribution, be it the RC4, RSA,
125b37fcf3Sryker * lhash, DES, etc., code; not just the SSL code. The SSL documentation
135b37fcf3Sryker * included with this distribution is covered by the same copyright terms
145b37fcf3Sryker * except that the holder is Tim Hudson (tjh@cryptsoft.com).
155b37fcf3Sryker *
165b37fcf3Sryker * Copyright remains Eric Young's, and as such any Copyright notices in
175b37fcf3Sryker * the code are not to be removed.
185b37fcf3Sryker * If this package is used in a product, Eric Young should be given attribution
195b37fcf3Sryker * as the author of the parts of the library used.
205b37fcf3Sryker * This can be in the form of a textual message at program startup or
215b37fcf3Sryker * in documentation (online or textual) provided with the package.
225b37fcf3Sryker *
235b37fcf3Sryker * Redistribution and use in source and binary forms, with or without
245b37fcf3Sryker * modification, are permitted provided that the following conditions
255b37fcf3Sryker * are met:
265b37fcf3Sryker * 1. Redistributions of source code must retain the copyright
275b37fcf3Sryker * notice, this list of conditions and the following disclaimer.
285b37fcf3Sryker * 2. Redistributions in binary form must reproduce the above copyright
295b37fcf3Sryker * notice, this list of conditions and the following disclaimer in the
305b37fcf3Sryker * documentation and/or other materials provided with the distribution.
315b37fcf3Sryker * 3. All advertising materials mentioning features or use of this software
325b37fcf3Sryker * must display the following acknowledgement:
335b37fcf3Sryker * "This product includes cryptographic software written by
345b37fcf3Sryker * Eric Young (eay@cryptsoft.com)"
355b37fcf3Sryker * The word 'cryptographic' can be left out if the rouines from the library
365b37fcf3Sryker * being used are not cryptographic related :-).
375b37fcf3Sryker * 4. If you include any Windows specific code (or a derivative thereof) from
385b37fcf3Sryker * the apps directory (application code) you must include an acknowledgement:
395b37fcf3Sryker * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
405b37fcf3Sryker *
415b37fcf3Sryker * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
425b37fcf3Sryker * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
435b37fcf3Sryker * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
445b37fcf3Sryker * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
455b37fcf3Sryker * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
465b37fcf3Sryker * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
475b37fcf3Sryker * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
485b37fcf3Sryker * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
495b37fcf3Sryker * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
505b37fcf3Sryker * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
515b37fcf3Sryker * SUCH DAMAGE.
525b37fcf3Sryker *
535b37fcf3Sryker * The licence and distribution terms for any publically available version or
545b37fcf3Sryker * derivative of this code cannot be changed. i.e. this code cannot simply be
555b37fcf3Sryker * copied and put under another distribution licence
565b37fcf3Sryker * [including the GNU Public Licence.]
575b37fcf3Sryker */
585b37fcf3Sryker
59e68eaf89Sbeck #include <pthread.h>
605b37fcf3Sryker #include <stdio.h>
618cf4d6a6Sjsing
628cf4d6a6Sjsing #include <openssl/opensslconf.h>
638cf4d6a6Sjsing
64913ec974Sbeck #include <openssl/asn1.h>
65913ec974Sbeck #include <openssl/bio.h>
66de3f78ccSjsing #include <openssl/bn.h>
67de3f78ccSjsing #include <openssl/buffer.h>
688b50cac1Stb #include <openssl/cms.h>
6924a3da60Stb #include <openssl/comp.h>
70de3f78ccSjsing #include <openssl/conf.h>
7124a3da60Stb #include <openssl/ct.h>
72de3f78ccSjsing #include <openssl/err.h>
73de3f78ccSjsing #include <openssl/evp.h>
7424a3da60Stb #include <openssl/kdf.h>
75de3f78ccSjsing #include <openssl/objects.h>
76de3f78ccSjsing #include <openssl/ocsp.h>
77*a7acfad9Sjsing #include <openssl/pem.h>
78de3f78ccSjsing #include <openssl/pkcs12.h>
79de3f78ccSjsing #include <openssl/rand.h>
80de3f78ccSjsing #include <openssl/ts.h>
81de3f78ccSjsing #include <openssl/ui.h>
82de3f78ccSjsing #include <openssl/x509.h>
83de3f78ccSjsing #include <openssl/x509v3.h>
84de3f78ccSjsing
85da347917Sbeck #ifndef OPENSSL_NO_DH
86913ec974Sbeck #include <openssl/dh.h>
875b37fcf3Sryker #endif
88da347917Sbeck #ifndef OPENSSL_NO_DSA
89913ec974Sbeck #include <openssl/dsa.h>
905b37fcf3Sryker #endif
91de3f78ccSjsing #ifndef OPENSSL_NO_EC
92de3f78ccSjsing #include <openssl/ec.h>
934fcf65c5Sdjm #endif
94de3f78ccSjsing #ifndef OPENSSL_NO_RSA
95de3f78ccSjsing #include <openssl/rsa.h>
964fcf65c5Sdjm #endif
975cdd308eSdjm
98e68eaf89Sbeck void ERR_load_ERR_strings_internal(void);
99e68eaf89Sbeck
100e68eaf89Sbeck static void
ERR_load_crypto_strings_internal(void)101e68eaf89Sbeck ERR_load_crypto_strings_internal(void)
1025b37fcf3Sryker {
103da347917Sbeck #ifndef OPENSSL_NO_ERR
104e68eaf89Sbeck ERR_load_ERR_strings_internal(); /* include error strings for SYSerr */
1058b50cac1Stb
1068b50cac1Stb ERR_load_ASN1_strings();
1078b50cac1Stb ERR_load_BIO_strings();
1085b37fcf3Sryker ERR_load_BN_strings();
1098b50cac1Stb ERR_load_BUF_strings();
1108b50cac1Stb #ifndef OPENSSL_NO_CMS
1118b50cac1Stb ERR_load_CMS_strings();
1128b50cac1Stb #endif
1138b50cac1Stb ERR_load_CONF_strings();
1148b50cac1Stb ERR_load_CRYPTO_strings();
1158b50cac1Stb #ifndef OPENSSL_NO_CT
1168b50cac1Stb ERR_load_CT_strings();
1175b37fcf3Sryker #endif
118da347917Sbeck #ifndef OPENSSL_NO_DH
1195b37fcf3Sryker ERR_load_DH_strings();
1205b37fcf3Sryker #endif
121da347917Sbeck #ifndef OPENSSL_NO_DSA
122da347917Sbeck ERR_load_DSA_strings();
123da347917Sbeck #endif
1248b50cac1Stb #ifndef OPENSSL_NO_EC
1258b50cac1Stb ERR_load_EC_strings();
1264fcf65c5Sdjm #endif
1278b50cac1Stb ERR_load_EVP_strings();
12824a3da60Stb ERR_load_KDF_strings();
1298b50cac1Stb ERR_load_OBJ_strings();
1308b50cac1Stb ERR_load_OCSP_strings();
1318b50cac1Stb ERR_load_PEM_strings();
1328b50cac1Stb ERR_load_PKCS12_strings();
1338b50cac1Stb ERR_load_PKCS7_strings();
1348b50cac1Stb ERR_load_RAND_strings();
1358b50cac1Stb #ifndef OPENSSL_NO_RSA
1368b50cac1Stb ERR_load_RSA_strings();
1378b50cac1Stb #endif
1388b50cac1Stb ERR_load_TS_strings();
1398b50cac1Stb ERR_load_UI_strings();
1408b50cac1Stb ERR_load_X509V3_strings();
1418b50cac1Stb ERR_load_X509_strings();
1425cdd308eSdjm #endif
1435b37fcf3Sryker }
144e68eaf89Sbeck
145e68eaf89Sbeck void
ERR_load_crypto_strings(void)146e68eaf89Sbeck ERR_load_crypto_strings(void)
147e68eaf89Sbeck {
148e68eaf89Sbeck static pthread_once_t loaded = PTHREAD_ONCE_INIT;
149e68eaf89Sbeck (void) pthread_once(&loaded, ERR_load_crypto_strings_internal);
150e68eaf89Sbeck }
151ea2baf45Sbeck LCRYPTO_ALIAS(ERR_load_crypto_strings);
152