From 0f814687b95e5980744240b7a81672c89c255340 Mon Sep 17 00:00:00 2001 From: Geoff Thorpe Date: Mon, 17 May 2004 19:14:22 +0000 Subject: [PATCH] Deprecate the recursive includes of bn.h from various API headers (asn1.h, dh.h, dsa.h, ec.h, ecdh.h, ecdsa.h, rsa.h), as the opaque bignum types are already declared in ossl_typ.h. Add explicit includes for bn.h in those C files that need access to structure internals or API functions+macros. --- crypto/asn1/a_enum.c | 1 + crypto/asn1/a_int.c | 1 + crypto/asn1/asn1.h | 4 +++- crypto/asn1/t_spki.c | 1 + crypto/asn1/x_bignum.c | 1 + crypto/asn1/x_long.c | 1 + crypto/dh/dh.h | 5 +++-- crypto/dsa/dsa.h | 2 +- crypto/ec/ec.h | 4 +++- crypto/ec/ec_lcl.h | 1 + crypto/ec/ectest.c | 1 + crypto/ecdh/ecdh.h | 4 +++- crypto/ecdh/ech_ossl.c | 1 + crypto/ecdsa/ecdsa.h | 4 +++- crypto/ecdsa/ecs_lib.c | 1 + crypto/ecdsa/ecs_ossl.c | 1 + crypto/evp/evp_pkey.c | 1 + crypto/pkcs12/p12_key.c | 2 +- crypto/rsa/rsa.h | 4 +++- crypto/rsa/rsa_test.c | 1 + crypto/x509v3/v3_utl.c | 1 + 21 files changed, 33 insertions(+), 9 deletions(-) diff --git a/crypto/asn1/a_enum.c b/crypto/asn1/a_enum.c index d9db53f01d..49f9e994be 100644 --- a/crypto/asn1/a_enum.c +++ b/crypto/asn1/a_enum.c @@ -59,6 +59,7 @@ #include #include "cryptlib.h" #include +#include /* * Code for ENUMERATED type: identical to INTEGER apart from a different tag. diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c index 5d76de79ba..c81fa00c4c 100644 --- a/crypto/asn1/a_int.c +++ b/crypto/asn1/a_int.c @@ -59,6 +59,7 @@ #include #include "cryptlib.h" #include +#include ASN1_INTEGER *ASN1_INTEGER_dup(ASN1_INTEGER *x) { return M_ASN1_INTEGER_dup(x);} diff --git a/crypto/asn1/asn1.h b/crypto/asn1/asn1.h index dbf0f636e2..f7bb935e07 100644 --- a/crypto/asn1/asn1.h +++ b/crypto/asn1/asn1.h @@ -64,13 +64,15 @@ #ifndef OPENSSL_NO_BIO #include #endif -#include #include #include #include #include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif #ifdef OPENSSL_BUILD_SHLIBCRYPTO # undef OPENSSL_EXTERN diff --git a/crypto/asn1/t_spki.c b/crypto/asn1/t_spki.c index 67b0cc9f00..e84bae6438 100644 --- a/crypto/asn1/t_spki.c +++ b/crypto/asn1/t_spki.c @@ -62,6 +62,7 @@ #include #include #include +#include /* Print out an SPKI */ diff --git a/crypto/asn1/x_bignum.c b/crypto/asn1/x_bignum.c index a80532cefc..869c05d931 100644 --- a/crypto/asn1/x_bignum.c +++ b/crypto/asn1/x_bignum.c @@ -59,6 +59,7 @@ #include #include "cryptlib.h" #include +#include /* Custom primitive type for BIGNUM handling. This reads in an ASN1_INTEGER as a * BIGNUM directly. Currently it ignores the sign which isn't a problem since all diff --git a/crypto/asn1/x_long.c b/crypto/asn1/x_long.c index 71774fa33d..0db233cb95 100644 --- a/crypto/asn1/x_long.c +++ b/crypto/asn1/x_long.c @@ -59,6 +59,7 @@ #include #include "cryptlib.h" #include +#include /* Custom primitive type for long handling. This converts between an ASN1_INTEGER * and a long directly. diff --git a/crypto/dh/dh.h b/crypto/dh/dh.h index 28a1b4208d..312340e9f3 100644 --- a/crypto/dh/dh.h +++ b/crypto/dh/dh.h @@ -68,9 +68,10 @@ #ifndef OPENSSL_NO_BIO #include #endif -#include -#include #include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif #define DH_FLAG_CACHE_MONT_P 0x01 diff --git a/crypto/dsa/dsa.h b/crypto/dsa/dsa.h index cdb19457fb..068e18cb18 100644 --- a/crypto/dsa/dsa.h +++ b/crypto/dsa/dsa.h @@ -74,11 +74,11 @@ #ifndef OPENSSL_NO_BIO #include #endif -#include #include #include #ifndef OPENSSL_NO_DEPRECATED +#include #ifndef OPENSSL_NO_DH # include #endif diff --git a/crypto/ec/ec.h b/crypto/ec/ec.h index db15a81938..b3267df62b 100644 --- a/crypto/ec/ec.h +++ b/crypto/ec/ec.h @@ -78,9 +78,11 @@ #error EC is disabled. #endif -#include #include #include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif #ifdef __cplusplus extern "C" { diff --git a/crypto/ec/ec_lcl.h b/crypto/ec/ec_lcl.h index 9becad8283..30632ba915 100644 --- a/crypto/ec/ec_lcl.h +++ b/crypto/ec/ec_lcl.h @@ -74,6 +74,7 @@ #include #include +#include #if defined(__SUNPRO_C) # if __SUNPRO_C >= 0x520 diff --git a/crypto/ec/ectest.c b/crypto/ec/ectest.c index 9944d632c9..b96feae7f3 100644 --- a/crypto/ec/ectest.c +++ b/crypto/ec/ectest.c @@ -93,6 +93,7 @@ int main(int argc, char * argv[]) { puts("Elliptic curves are disabled."); retur #include #include #include +#include #define ABORT do { \ fflush(stdout); \ diff --git a/crypto/ecdh/ecdh.h b/crypto/ecdh/ecdh.h index 1a62a214b3..f9189e09ca 100644 --- a/crypto/ecdh/ecdh.h +++ b/crypto/ecdh/ecdh.h @@ -75,9 +75,11 @@ #error ECDH is disabled. #endif -#include #include #include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif #ifdef __cplusplus extern "C" { diff --git a/crypto/ecdh/ech_ossl.c b/crypto/ecdh/ech_ossl.c index c7633bac7f..d61e54f184 100644 --- a/crypto/ecdh/ech_ossl.c +++ b/crypto/ecdh/ech_ossl.c @@ -77,6 +77,7 @@ #include #include #include +#include static int ecdh_compute_key(void *out, size_t len, const EC_POINT *pub_key, EC_KEY *ecdh, void *(*KDF)(void *in, size_t inlen, void *out, size_t outlen)); diff --git a/crypto/ecdsa/ecdsa.h b/crypto/ecdsa/ecdsa.h index a57ba0f14f..e6081bb2af 100644 --- a/crypto/ecdsa/ecdsa.h +++ b/crypto/ecdsa/ecdsa.h @@ -65,9 +65,11 @@ #error ECDSA is disabled. #endif -#include #include #include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif #ifdef __cplusplus extern "C" { diff --git a/crypto/ecdsa/ecs_lib.c b/crypto/ecdsa/ecs_lib.c index 6ce5d927ca..d553ea1cd6 100644 --- a/crypto/ecdsa/ecs_lib.c +++ b/crypto/ecdsa/ecs_lib.c @@ -57,6 +57,7 @@ #include "ecdsa.h" #include #include +#include const char *ECDSA_version="ECDSA" OPENSSL_VERSION_PTEXT; diff --git a/crypto/ecdsa/ecs_ossl.c b/crypto/ecdsa/ecs_ossl.c index 7e4b61fdef..712f666641 100644 --- a/crypto/ecdsa/ecs_ossl.c +++ b/crypto/ecdsa/ecs_ossl.c @@ -59,6 +59,7 @@ #include "ecdsa.h" #include #include +#include static ECDSA_SIG *ecdsa_do_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey); diff --git a/crypto/evp/evp_pkey.c b/crypto/evp/evp_pkey.c index dd63e09e55..e81b810dea 100644 --- a/crypto/evp/evp_pkey.c +++ b/crypto/evp/evp_pkey.c @@ -63,6 +63,7 @@ #include #include #include +#include #ifndef OPENSSL_NO_DSA static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8inf, EVP_PKEY *pkey); diff --git a/crypto/pkcs12/p12_key.c b/crypto/pkcs12/p12_key.c index 9196a34b4a..18e72d0a1b 100644 --- a/crypto/pkcs12/p12_key.c +++ b/crypto/pkcs12/p12_key.c @@ -59,7 +59,7 @@ #include #include "cryptlib.h" #include - +#include /* Uncomment out this line to get debugging info about key generation */ /*#define DEBUG_KEYGEN*/ diff --git a/crypto/rsa/rsa.h b/crypto/rsa/rsa.h index 5bf862cd68..00a7873f92 100644 --- a/crypto/rsa/rsa.h +++ b/crypto/rsa/rsa.h @@ -64,9 +64,11 @@ #ifndef OPENSSL_NO_BIO #include #endif -#include #include #include +#ifndef OPENSSL_NO_DEPRECATED +#include +#endif #ifdef OPENSSL_NO_RSA #error RSA is disabled. diff --git a/crypto/rsa/rsa_test.c b/crypto/rsa/rsa_test.c index 236842a634..6f0a28aa25 100644 --- a/crypto/rsa/rsa_test.c +++ b/crypto/rsa/rsa_test.c @@ -8,6 +8,7 @@ #include #include #include +#include #ifdef OPENSSL_NO_RSA int main(int argc, char *argv[]) { diff --git a/crypto/x509v3/v3_utl.c b/crypto/x509v3/v3_utl.c index a2bb7b0043..191cfef1a5 100644 --- a/crypto/x509v3/v3_utl.c +++ b/crypto/x509v3/v3_utl.c @@ -63,6 +63,7 @@ #include "cryptlib.h" #include #include +#include static char *strip_spaces(char *name); static int sk_strcmp(const char * const *a, const char * const *b); -- 2.25.1