diff options
author | Richard Levitte <levitte@openssl.org> | 2020-11-12 09:19:24 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-11-24 15:21:44 +0100 |
commit | f5a46ed7fe66520c6f1016eb96e96cb241ba229f (patch) | |
tree | aad7f22a6fbca9e545fa6f3af18b73c97059c6e1 /include | |
parent | 9343d3fe3bc5a4a2d6461c640d34a96e950177ad (diff) |
Modify the ERR init functions to use the internal ERR string loaders
This deprecates all the ERR_load_ functions, and moves their definition to
separate C source files that can easily be removed when those functions are
finally removed.
This also reduces include/openssl/kdferr.h to include cryptoerr_legacy.h,
moves the declaration of ERR_load_ERR_strings() from include/openssl/err.h
to include/openssl/cryptoerr_legacy.h, and finally removes the declaration
of ERR_load_DSO_strings(), which was entirely internal anyway.
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13390)
Diffstat (limited to 'include')
-rw-r--r-- | include/crypto/err.h | 1 | ||||
-rw-r--r-- | include/internal/dso.h | 2 | ||||
-rw-r--r-- | include/openssl/cryptoerr_legacy.h | 81 | ||||
-rw-r--r-- | include/openssl/err.h.in | 2 | ||||
-rw-r--r-- | include/openssl/kdferr.h | 107 | ||||
-rw-r--r-- | include/openssl/sslerr_legacy.h | 36 |
6 files changed, 121 insertions, 108 deletions
diff --git a/include/crypto/err.h b/include/crypto/err.h index 527f19667d..d4c32bcf67 100644 --- a/include/crypto/err.h +++ b/include/crypto/err.h @@ -10,6 +10,7 @@ #ifndef OSSL_CRYPTO_ERR_H # define OSSL_CRYPTO_ERR_H +int err_load_ERR_strings_int(void); int err_load_crypto_strings_int(void); void err_cleanup(void); int err_shelve_state(void **); diff --git a/include/internal/dso.h b/include/internal/dso.h index 76cb3c6e0a..214362f692 100644 --- a/include/internal/dso.h +++ b/include/internal/dso.h @@ -160,6 +160,4 @@ DSO *DSO_dsobyaddr(void *addr, int flags); */ void *DSO_global_lookup(const char *name); -int ERR_load_DSO_strings(void); - #endif diff --git a/include/openssl/cryptoerr_legacy.h b/include/openssl/cryptoerr_legacy.h new file mode 100644 index 0000000000..2729afde70 --- /dev/null +++ b/include/openssl/cryptoerr_legacy.h @@ -0,0 +1,81 @@ +/* + * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * This header file preserves symbols from pre-3.0 OpenSSL. + * It should never be included directly, as it's already included + * by the public {lib}err.h headers, and since it will go away some + * time in the future. + */ + +#ifndef OPENSSL_CRYPTOERR_LEGACY_H +# define OPENSSL_CRYPTOERR_LEGACY_H +# pragma once + +# include <openssl/macros.h> +# include <openssl/symhacks.h> + +# ifdef __cplusplus +extern "C" { +# endif + +# ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ERR_load_ASN1_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_ASYNC_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_BIO_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_BN_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_BUF_strings(void); +# ifndef OPENSSL_NO_CMS +OSSL_DEPRECATEDIN_3_0 int ERR_load_CMS_strings(void); +# endif +# ifndef OPENSSL_NO_COMP +OSSL_DEPRECATEDIN_3_0 int ERR_load_COMP_strings(void); +# endif +OSSL_DEPRECATEDIN_3_0 int ERR_load_CONF_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_CRYPTO_strings(void); +# ifndef OPENSSL_NO_CT +OSSL_DEPRECATEDIN_3_0 int ERR_load_CT_strings(void); +# endif +# ifndef OPENSSL_NO_DH +OSSL_DEPRECATEDIN_3_0 int ERR_load_DH_strings(void); +# endif +# ifndef OPENSSL_NO_DSA +OSSL_DEPRECATEDIN_3_0 int ERR_load_DSA_strings(void); +# endif +# ifndef OPENSSL_NO_EC +OSSL_DEPRECATEDIN_3_0 int ERR_load_EC_strings(void); +# endif +# ifndef OPENSSL_NO_ENGINE +OSSL_DEPRECATEDIN_3_0 int ERR_load_ENGINE_strings(void); +# endif +OSSL_DEPRECATEDIN_3_0 int ERR_load_ERR_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_EVP_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_KDF_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_OBJ_strings(void); +# ifndef OPENSSL_NO_OCSP +OSSL_DEPRECATEDIN_3_0 int ERR_load_OCSP_strings(void); +# endif +OSSL_DEPRECATEDIN_3_0 int ERR_load_PEM_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_PKCS12_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_PKCS7_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_RAND_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_RSA_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_OSSL_STORE_strings(void); +# ifndef OPENSSL_NO_TS +OSSL_DEPRECATEDIN_3_0 int ERR_load_TS_strings(void); +# endif +OSSL_DEPRECATEDIN_3_0 int ERR_load_UI_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_X509_strings(void); +OSSL_DEPRECATEDIN_3_0 int ERR_load_X509V3_strings(void); +# endif + +# ifdef __cplusplus +} +# endif +#endif diff --git a/include/openssl/err.h.in b/include/openssl/err.h.in index 1f2fde8317..c36fe7d1ed 100644 --- a/include/openssl/err.h.in +++ b/include/openssl/err.h.in @@ -30,6 +30,7 @@ use OpenSSL::stackhash qw(generate_lhash_macros); # include <openssl/types.h> # include <openssl/bio.h> # include <openssl/lhash.h> +# include <openssl/cryptoerr_legacy.h> #ifdef __cplusplus extern "C" { @@ -454,7 +455,6 @@ void ERR_add_error_mem_bio(const char *sep, BIO *bio); int ERR_load_strings(int lib, ERR_STRING_DATA *str); int ERR_load_strings_const(const ERR_STRING_DATA *str); int ERR_unload_strings(int lib, ERR_STRING_DATA *str); -int ERR_load_ERR_strings(void); #ifndef OPENSSL_NO_DEPRECATED_1_1_0 # define ERR_load_crypto_strings() \ diff --git a/include/openssl/kdferr.h b/include/openssl/kdferr.h index 0daec1c2a5..d339871f6a 100644 --- a/include/openssl/kdferr.h +++ b/include/openssl/kdferr.h @@ -1,6 +1,5 @@ /* - * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -8,106 +7,4 @@ * https://www.openssl.org/source/license.html */ -#ifndef OPENSSL_KDFERR_H -# define OPENSSL_KDFERR_H -# pragma once - -# include <openssl/opensslconf.h> -# include <openssl/symhacks.h> - - -# ifdef __cplusplus -extern "C" -# endif -DEPRECATEDIN_3_0(int ERR_load_KDF_strings(void)) - -/* - * KDF function codes. - */ -# ifndef OPENSSL_NO_DEPRECATED_3_0 -# define KDF_F_HKDF_EXTRACT 0 -# define KDF_F_KDF_HKDF_DERIVE 0 -# define KDF_F_KDF_HKDF_NEW 0 -# define KDF_F_KDF_HKDF_SIZE 0 -# define KDF_F_KDF_MD2CTRL 0 -# define KDF_F_KDF_PBKDF2_CTRL 0 -# define KDF_F_KDF_PBKDF2_CTRL_STR 0 -# define KDF_F_KDF_PBKDF2_DERIVE 0 -# define KDF_F_KDF_PBKDF2_NEW 0 -# define KDF_F_KDF_SCRYPT_CTRL_STR 0 -# define KDF_F_KDF_SCRYPT_CTRL_UINT32 0 -# define KDF_F_KDF_SCRYPT_CTRL_UINT64 0 -# define KDF_F_KDF_SCRYPT_DERIVE 0 -# define KDF_F_KDF_SCRYPT_NEW 0 -# define KDF_F_KDF_SSHKDF_CTRL 0 -# define KDF_F_KDF_SSHKDF_CTRL_STR 0 -# define KDF_F_KDF_SSHKDF_DERIVE 0 -# define KDF_F_KDF_SSHKDF_NEW 0 -# define KDF_F_KDF_TLS1_PRF_CTRL_STR 0 -# define KDF_F_KDF_TLS1_PRF_DERIVE 0 -# define KDF_F_KDF_TLS1_PRF_NEW 0 -# define KDF_F_PBKDF2_DERIVE 0 -# define KDF_F_PBKDF2_SET_MEMBUF 0 -# define KDF_F_PKEY_HKDF_CTRL_STR 0 -# define KDF_F_PKEY_HKDF_DERIVE 0 -# define KDF_F_PKEY_HKDF_INIT 0 -# define KDF_F_PKEY_SCRYPT_CTRL_STR 0 -# define KDF_F_PKEY_SCRYPT_CTRL_UINT64 0 -# define KDF_F_PKEY_SCRYPT_DERIVE 0 -# define KDF_F_PKEY_SCRYPT_INIT 0 -# define KDF_F_PKEY_SCRYPT_SET_MEMBUF 0 -# define KDF_F_PKEY_TLS1_PRF_CTRL_STR 0 -# define KDF_F_PKEY_TLS1_PRF_DERIVE 0 -# define KDF_F_PKEY_TLS1_PRF_INIT 0 -# define KDF_F_SCRYPT_SET_MEMBUF 0 -# define KDF_F_SSKDF_CTRL_STR 0 -# define KDF_F_SSKDF_DERIVE 0 -# define KDF_F_SSKDF_MAC2CTRL 0 -# define KDF_F_SSKDF_NEW 0 -# define KDF_F_SSKDF_SIZE 0 -# define KDF_F_TLS1_PRF_ALG 0 -# define KDF_F_X942KDF_CTRL 0 -# define KDF_F_X942KDF_DERIVE 0 -# define KDF_F_X942KDF_HASH_KDM 0 -# define KDF_F_X942KDF_NEW 0 -# define KDF_F_X942KDF_SIZE 0 -# define KDF_F_X963KDF_DERIVE 0 -# endif - -/* - * KDF reason codes. - */ -# ifndef OPENSSL_NO_DEPRECATED_3_0 -# define KDF_R_BAD_ENCODING 122 -# define KDF_R_BAD_LENGTH 123 -# define KDF_R_BOTH_MODE_AND_MODE_INT 127 -# define KDF_R_INAVLID_UKM_LEN 124 -# define KDF_R_INVALID_DIGEST 100 -# define KDF_R_INVALID_ITERATION_COUNT 119 -# define KDF_R_INVALID_KEY_LEN 120 -# define KDF_R_INVALID_MAC_TYPE 116 -# define KDF_R_INVALID_MODE 128 -# define KDF_R_INVALID_MODE_INT 129 -# define KDF_R_INVALID_SALT_LEN 121 -# define KDF_R_MISSING_CEK_ALG 125 -# define KDF_R_MISSING_ITERATION_COUNT 109 -# define KDF_R_MISSING_KEY 104 -# define KDF_R_MISSING_MESSAGE_DIGEST 105 -# define KDF_R_MISSING_PARAMETER 101 -# define KDF_R_MISSING_PASS 110 -# define KDF_R_MISSING_SALT 111 -# define KDF_R_MISSING_SECRET 107 -# define KDF_R_MISSING_SEED 106 -# define KDF_R_MISSING_SESSION_ID 113 -# define KDF_R_MISSING_TYPE 114 -# define KDF_R_MISSING_XCGHASH 115 -# define KDF_R_NOT_SUPPORTED 118 -# define KDF_R_UNKNOWN_PARAMETER_TYPE 103 -# define KDF_R_UNSUPPORTED_CEK_ALG 126 -# define KDF_R_UNSUPPORTED_MAC_TYPE 117 -# define KDF_R_VALUE_ERROR 108 -# define KDF_R_VALUE_MISSING 102 -# define KDF_R_WRONG_OUTPUT_BUFFER_SIZE 112 -# endif - -#endif +#include <openssl/cryptoerr_legacy.h> diff --git a/include/openssl/sslerr_legacy.h b/include/openssl/sslerr_legacy.h new file mode 100644 index 0000000000..1607b4e7dc --- /dev/null +++ b/include/openssl/sslerr_legacy.h @@ -0,0 +1,36 @@ +/* + * Copyright 2020 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * This header file preserves symbols from pre-3.0 OpenSSL. + * It should never be included directly, as it's already included + * by the public sslerr.h headers, and since it will go away some + * time in the future. + */ + +#ifndef OPENSSL_SSLERR_LEGACY_H +# define OPENSSL_SSLERR_LEGACY_H +# pragma once + +# include <openssl/macros.h> +# include <openssl/symhacks.h> + +# ifdef __cplusplus +extern "C" { +# endif + +# ifndef OPENSSL_NO_DEPRECATED_3_0 +OSSL_DEPRECATEDIN_3_0 int ERR_load_SSL_strings(void); +# endif + +# ifdef __cplusplus +} +# endif +#endif + |