summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crypto/asn1/t_req.c2
-rw-r--r--crypto/asn1/t_spki.c2
-rw-r--r--crypto/asn1/x_pubkey.c2
-rw-r--r--crypto/cryptlib.c3
-rw-r--r--crypto/cversion.c3
-rw-r--r--crypto/dsa/dsa.h3
-rw-r--r--crypto/dsa/dsa_lib.c1
-rw-r--r--crypto/ec/ectest.c1
-rw-r--r--crypto/ecdh/ech_lib.c1
-rw-r--r--crypto/ecdsa/ecs_lib.c1
-rw-r--r--crypto/engine/eng_all.c3
-rw-r--r--crypto/engine/eng_cnf.c5
-rw-r--r--crypto/engine/eng_ctrl.c3
-rw-r--r--crypto/engine/eng_dyn.c4
-rw-r--r--crypto/engine/eng_fat.c3
-rw-r--r--crypto/engine/eng_init.c3
-rw-r--r--crypto/engine/eng_int.h1
-rw-r--r--crypto/engine/eng_lib.c5
-rw-r--r--crypto/engine/eng_list.c3
-rw-r--r--crypto/engine/eng_pkey.c3
-rw-r--r--crypto/engine/tb_cipher.c2
-rw-r--r--crypto/engine/tb_dh.c2
-rw-r--r--crypto/engine/tb_digest.c2
-rw-r--r--crypto/engine/tb_dsa.c2
-rw-r--r--crypto/engine/tb_ecdh.c2
-rw-r--r--crypto/engine/tb_ecdsa.c2
-rw-r--r--crypto/engine/tb_rand.c2
-rw-r--r--crypto/engine/tb_rsa.c2
-rw-r--r--crypto/engine/tb_store.c2
-rw-r--r--crypto/evp/evp_pkey.c2
-rw-r--r--crypto/evp/m_dss.c1
-rw-r--r--crypto/evp/m_dss1.c1
-rw-r--r--crypto/evp/m_md2.c1
-rw-r--r--crypto/evp/m_md4.c1
-rw-r--r--crypto/evp/m_md5.c1
-rw-r--r--crypto/evp/m_mdc2.c1
-rw-r--r--crypto/evp/m_ripemd.c1
-rw-r--r--crypto/evp/m_sha.c1
-rw-r--r--crypto/evp/m_sha1.c1
-rw-r--r--crypto/evp/p_lib.c3
-rw-r--r--crypto/evp/p_open.c1
-rw-r--r--crypto/ex_data.c6
-rw-r--r--crypto/pem/pem_all.c3
-rw-r--r--crypto/pem/pem_info.c2
-rw-r--r--crypto/pem/pem_seal.c1
-rw-r--r--crypto/x509/x509.h17
-rw-r--r--crypto/x509/x_all.c2
-rw-r--r--ssl/s2_lib.c1
-rw-r--r--ssl/s3_clnt.c1
-rw-r--r--ssl/s3_lib.c1
-rw-r--r--ssl/s3_srvr.c1
-rw-r--r--ssl/ssl_cert.c1
-rw-r--r--ssl/ssl_lib.c1
-rw-r--r--ssl/ssl_locl.h2
-rw-r--r--ssl/ssltest.c3
55 files changed, 60 insertions, 67 deletions
diff --git a/crypto/asn1/t_req.c b/crypto/asn1/t_req.c
index 7088486a91..32eef7e78f 100644
--- a/crypto/asn1/t_req.c
+++ b/crypto/asn1/t_req.c
@@ -63,6 +63,8 @@
#include <openssl/objects.h>
#include <openssl/x509.h>
#include <openssl/x509v3.h>
+#include <openssl/rsa.h>
+#include <openssl/dsa.h>
#ifndef OPENSSL_NO_FP_API
int X509_REQ_print_fp(FILE *fp, X509_REQ *x)
diff --git a/crypto/asn1/t_spki.c b/crypto/asn1/t_spki.c
index 499e12834a..67b0cc9f00 100644
--- a/crypto/asn1/t_spki.c
+++ b/crypto/asn1/t_spki.c
@@ -60,6 +60,8 @@
#include "cryptlib.h"
#include <openssl/x509.h>
#include <openssl/asn1.h>
+#include <openssl/rsa.h>
+#include <openssl/dsa.h>
/* Print out an SPKI */
diff --git a/crypto/asn1/x_pubkey.c b/crypto/asn1/x_pubkey.c
index 83ead744f0..10b87def32 100644
--- a/crypto/asn1/x_pubkey.c
+++ b/crypto/asn1/x_pubkey.c
@@ -60,6 +60,8 @@
#include "cryptlib.h"
#include <openssl/asn1t.h>
#include <openssl/x509.h>
+#include <openssl/rsa.h>
+#include <openssl/dsa.h>
/* Minor tweak to operation: free up EVP_PKEY */
static int pubkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it)
diff --git a/crypto/cryptlib.c b/crypto/cryptlib.c
index 009c3be4c0..b180aebce9 100644
--- a/crypto/cryptlib.c
+++ b/crypto/cryptlib.c
@@ -114,10 +114,7 @@
* SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
*/
-#include <stdio.h>
-#include <string.h>
#include "cryptlib.h"
-#include <openssl/crypto.h>
#include <openssl/safestack.h>
#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WIN16)
diff --git a/crypto/cversion.c b/crypto/cversion.c
index beeeb14013..ea9f25fd16 100644
--- a/crypto/cversion.c
+++ b/crypto/cversion.c
@@ -56,10 +56,7 @@
* [including the GNU Public Licence.]
*/
-#include <stdio.h>
-#include <string.h>
#include "cryptlib.h"
-#include <openssl/crypto.h>
#ifndef NO_WINDOWS_BRAINDEATH
#include "buildinf.h"
diff --git a/crypto/dsa/dsa.h b/crypto/dsa/dsa.h
index d54c5d59bc..cdb19457fb 100644
--- a/crypto/dsa/dsa.h
+++ b/crypto/dsa/dsa.h
@@ -77,9 +77,12 @@
#include <openssl/bn.h>
#include <openssl/crypto.h>
#include <openssl/ossl_typ.h>
+
+#ifndef OPENSSL_NO_DEPRECATED
#ifndef OPENSSL_NO_DH
# include <openssl/dh.h>
#endif
+#endif
#define DSA_FLAG_CACHE_MONT_P 0x01
diff --git a/crypto/dsa/dsa_lib.c b/crypto/dsa/dsa_lib.c
index 4171af24c6..3a78082c01 100644
--- a/crypto/dsa/dsa_lib.c
+++ b/crypto/dsa/dsa_lib.c
@@ -66,6 +66,7 @@
#ifndef OPENSSL_NO_ENGINE
#include <openssl/engine.h>
#endif
+#include <openssl/dh.h>
const char *DSA_version="DSA" OPENSSL_VERSION_PTEXT;
diff --git a/crypto/ec/ectest.c b/crypto/ec/ectest.c
index 9b32f55be8..9944d632c9 100644
--- a/crypto/ec/ectest.c
+++ b/crypto/ec/ectest.c
@@ -92,6 +92,7 @@ int main(int argc, char * argv[]) { puts("Elliptic curves are disabled."); retur
#include <openssl/err.h>
#include <openssl/obj_mac.h>
#include <openssl/objects.h>
+#include <openssl/rand.h>
#define ABORT do { \
fflush(stdout); \
diff --git a/crypto/ecdh/ech_lib.c b/crypto/ecdh/ech_lib.c
index 8b3e5f1ddc..a0e4ef45f0 100644
--- a/crypto/ecdh/ech_lib.c
+++ b/crypto/ecdh/ech_lib.c
@@ -70,6 +70,7 @@
#include "ecdh.h"
#include <string.h>
#include <openssl/engine.h>
+#include <openssl/err.h>
const char *ECDH_version="ECDH" OPENSSL_VERSION_PTEXT;
diff --git a/crypto/ecdsa/ecs_lib.c b/crypto/ecdsa/ecs_lib.c
index 9465dee625..6ce5d927ca 100644
--- a/crypto/ecdsa/ecs_lib.c
+++ b/crypto/ecdsa/ecs_lib.c
@@ -56,6 +56,7 @@
#include <string.h>
#include "ecdsa.h"
#include <openssl/engine.h>
+#include <openssl/err.h>
const char *ECDSA_version="ECDSA" OPENSSL_VERSION_PTEXT;
diff --git a/crypto/engine/eng_all.c b/crypto/engine/eng_all.c
index 64ec2db901..1f28b4078b 100644
--- a/crypto/engine/eng_all.c
+++ b/crypto/engine/eng_all.c
@@ -56,8 +56,7 @@
*
*/
-#include <openssl/err.h>
-#include <openssl/engine.h>
+#include "cryptlib.h"
#include "eng_int.h"
void ENGINE_load_builtin_engines(void)
diff --git a/crypto/engine/eng_cnf.c b/crypto/engine/eng_cnf.c
index cdf670901a..8567f26675 100644
--- a/crypto/engine/eng_cnf.c
+++ b/crypto/engine/eng_cnf.c
@@ -56,11 +56,8 @@
*
*/
-#include <stdio.h>
-#include <openssl/crypto.h>
-#include "cryptlib.h"
+#include "eng_int.h"
#include <openssl/conf.h>
-#include <openssl/engine.h>
/* #define ENGINE_CONF_DEBUG */
diff --git a/crypto/engine/eng_ctrl.c b/crypto/engine/eng_ctrl.c
index 1a808bec41..18527484ce 100644
--- a/crypto/engine/eng_ctrl.c
+++ b/crypto/engine/eng_ctrl.c
@@ -53,10 +53,7 @@
*
*/
-#include <openssl/crypto.h>
-#include "cryptlib.h"
#include "eng_int.h"
-#include <openssl/engine.h>
/* When querying a ENGINE-specific control command's 'description', this string
* is used if the ENGINE_CMD_DEFN has cmd_desc set to NULL. */
diff --git a/crypto/engine/eng_dyn.c b/crypto/engine/eng_dyn.c
index 3cb46856cc..290b8bd395 100644
--- a/crypto/engine/eng_dyn.c
+++ b/crypto/engine/eng_dyn.c
@@ -57,11 +57,7 @@
*/
-#include <stdio.h>
-#include <openssl/crypto.h>
-#include "cryptlib.h"
#include "eng_int.h"
-#include <openssl/engine.h>
#include <openssl/dso.h>
/* Shared libraries implementing ENGINEs for use by the "dynamic" ENGINE loader
diff --git a/crypto/engine/eng_fat.c b/crypto/engine/eng_fat.c
index 1539ea039f..27c1662f62 100644
--- a/crypto/engine/eng_fat.c
+++ b/crypto/engine/eng_fat.c
@@ -58,10 +58,7 @@
* SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
*/
-#include <openssl/crypto.h>
-#include "cryptlib.h"
#include "eng_int.h"
-#include <openssl/engine.h>
#include <openssl/conf.h>
int ENGINE_set_default(ENGINE *e, unsigned int flags)
diff --git a/crypto/engine/eng_init.c b/crypto/engine/eng_init.c
index 170c1791b3..2843e4f0e4 100644
--- a/crypto/engine/eng_init.c
+++ b/crypto/engine/eng_init.c
@@ -53,10 +53,7 @@
*
*/
-#include <openssl/crypto.h>
-#include "cryptlib.h"
#include "eng_int.h"
-#include <openssl/engine.h>
/* Initialise a engine type for use (or up its functional reference count
* if it's already in use). This version is only used internally. */
diff --git a/crypto/engine/eng_int.h b/crypto/engine/eng_int.h
index 395c7fff1a..a5b1edebf4 100644
--- a/crypto/engine/eng_int.h
+++ b/crypto/engine/eng_int.h
@@ -64,6 +64,7 @@
#ifndef HEADER_ENGINE_INT_H
#define HEADER_ENGINE_INT_H
+#include "cryptlib.h"
/* Take public definitions from engine.h */
#include <openssl/engine.h>
diff --git a/crypto/engine/eng_lib.c b/crypto/engine/eng_lib.c
index 66ab06de74..7b3686ddc0 100644
--- a/crypto/engine/eng_lib.c
+++ b/crypto/engine/eng_lib.c
@@ -56,11 +56,8 @@
*
*/
-#include <openssl/crypto.h>
-#include "cryptlib.h"
#include "eng_int.h"
-#include <openssl/rand.h> /* FIXME: This shouldn't be needed */
-#include <openssl/engine.h>
+#include <openssl/rand.h>
/* The "new"/"free" stuff first */
diff --git a/crypto/engine/eng_list.c b/crypto/engine/eng_list.c
index f94d593b06..67d67df3ce 100644
--- a/crypto/engine/eng_list.c
+++ b/crypto/engine/eng_list.c
@@ -61,10 +61,7 @@
* SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
*/
-#include <openssl/crypto.h>
-#include "cryptlib.h"
#include "eng_int.h"
-#include <openssl/engine.h>
/* The linked-list of pointers to engine types. engine_list_head
* incorporates an implicit structural reference but engine_list_tail
diff --git a/crypto/engine/eng_pkey.c b/crypto/engine/eng_pkey.c
index 8c69171511..bc8b21abec 100644
--- a/crypto/engine/eng_pkey.c
+++ b/crypto/engine/eng_pkey.c
@@ -53,10 +53,7 @@
*
*/
-#include <openssl/crypto.h>
-#include "cryptlib.h"
#include "eng_int.h"
-#include <openssl/engine.h>
/* Basic get/set stuff */
diff --git a/crypto/engine/tb_cipher.c b/crypto/engine/tb_cipher.c
index 50b3cec1fa..177fc1fb73 100644
--- a/crypto/engine/tb_cipher.c
+++ b/crypto/engine/tb_cipher.c
@@ -52,8 +52,6 @@
*
*/
-#include <openssl/evp.h>
-#include <openssl/engine.h>
#include "eng_int.h"
/* If this symbol is defined then ENGINE_get_cipher_engine(), the function that
diff --git a/crypto/engine/tb_dh.c b/crypto/engine/tb_dh.c
index e290e1702b..6e9d428761 100644
--- a/crypto/engine/tb_dh.c
+++ b/crypto/engine/tb_dh.c
@@ -52,8 +52,6 @@
*
*/
-#include <openssl/evp.h>
-#include <openssl/engine.h>
#include "eng_int.h"
/* If this symbol is defined then ENGINE_get_default_DH(), the function that is
diff --git a/crypto/engine/tb_digest.c b/crypto/engine/tb_digest.c
index e82d2a17c9..d3f4bb2747 100644
--- a/crypto/engine/tb_digest.c
+++ b/crypto/engine/tb_digest.c
@@ -52,8 +52,6 @@
*
*/
-#include <openssl/evp.h>
-#include <openssl/engine.h>
#include "eng_int.h"
/* If this symbol is defined then ENGINE_get_digest_engine(), the function that
diff --git a/crypto/engine/tb_dsa.c b/crypto/engine/tb_dsa.c
index 80170591f2..d326a5f6da 100644
--- a/crypto/engine/tb_dsa.c
+++ b/crypto/engine/tb_dsa.c
@@ -52,8 +52,6 @@
*
*/
-#include <openssl/evp.h>
-#include <openssl/engine.h>
#include "eng_int.h"
/* If this symbol is defined then ENGINE_get_default_DSA(), the function that is
diff --git a/crypto/engine/tb_ecdh.c b/crypto/engine/tb_ecdh.c
index f40eb006eb..59977f7dd0 100644
--- a/crypto/engine/tb_ecdh.c
+++ b/crypto/engine/tb_ecdh.c
@@ -67,8 +67,6 @@
*
*/
-#include <openssl/evp.h>
-#include <openssl/engine.h>
#include "eng_int.h"
/* If this symbol is defined then ENGINE_get_default_ECDH(), the function that is
diff --git a/crypto/engine/tb_ecdsa.c b/crypto/engine/tb_ecdsa.c
index 76deefcdc5..e30b02e8c5 100644
--- a/crypto/engine/tb_ecdsa.c
+++ b/crypto/engine/tb_ecdsa.c
@@ -52,8 +52,6 @@
*
*/
-#include <openssl/evp.h>
-#include <openssl/engine.h>
#include "eng_int.h"
/* If this symbol is defined then ENGINE_get_default_ECDSA(), the function that is
diff --git a/crypto/engine/tb_rand.c b/crypto/engine/tb_rand.c
index 69b67111bc..f36f67c0f6 100644
--- a/crypto/engine/tb_rand.c
+++ b/crypto/engine/tb_rand.c
@@ -52,8 +52,6 @@
*
*/
-#include <openssl/evp.h>
-#include <openssl/engine.h>
#include "eng_int.h"
/* If this symbol is defined then ENGINE_get_default_RAND(), the function that is
diff --git a/crypto/engine/tb_rsa.c b/crypto/engine/tb_rsa.c
index fee4867f52..fbc707fd26 100644
--- a/crypto/engine/tb_rsa.c
+++ b/crypto/engine/tb_rsa.c
@@ -52,8 +52,6 @@
*
*/
-#include <openssl/evp.h>
-#include <openssl/engine.h>
#include "eng_int.h"
/* If this symbol is defined then ENGINE_get_default_RSA(), the function that is
diff --git a/crypto/engine/tb_store.c b/crypto/engine/tb_store.c
index 6cc6d759d9..8cc435c935 100644
--- a/crypto/engine/tb_store.c
+++ b/crypto/engine/tb_store.c
@@ -52,8 +52,6 @@
*
*/
-#include <openssl/evp.h>
-#include <openssl/engine.h>
#include "eng_int.h"
/* If this symbol is defined then ENGINE_get_default_STORE(), the function that is
diff --git a/crypto/evp/evp_pkey.c b/crypto/evp/evp_pkey.c
index a82090ead2..dd63e09e55 100644
--- a/crypto/evp/evp_pkey.c
+++ b/crypto/evp/evp_pkey.c
@@ -61,6 +61,8 @@
#include "cryptlib.h"
#include <openssl/x509.h>
#include <openssl/rand.h>
+#include <openssl/rsa.h>
+#include <openssl/dsa.h>
#ifndef OPENSSL_NO_DSA
static int dsa_pkey2pkcs8(PKCS8_PRIV_KEY_INFO *p8inf, EVP_PKEY *pkey);
diff --git a/crypto/evp/m_dss.c b/crypto/evp/m_dss.c
index beb8d7fc5c..c4c5f0bbe6 100644
--- a/crypto/evp/m_dss.c
+++ b/crypto/evp/m_dss.c
@@ -61,6 +61,7 @@
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/x509.h>
+#include <openssl/dsa.h>
#ifndef OPENSSL_NO_SHA
static int init(EVP_MD_CTX *ctx)
diff --git a/crypto/evp/m_dss1.c b/crypto/evp/m_dss1.c
index 9a0ebe0a50..6b65bfd54b 100644
--- a/crypto/evp/m_dss1.c
+++ b/crypto/evp/m_dss1.c
@@ -64,6 +64,7 @@
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/x509.h>
+#include <openssl/dsa.h>
static int init(EVP_MD_CTX *ctx)
{ return SHA1_Init(ctx->md_data); }
diff --git a/crypto/evp/m_md2.c b/crypto/evp/m_md2.c
index 38ce7f8cd7..e577d26411 100644
--- a/crypto/evp/m_md2.c
+++ b/crypto/evp/m_md2.c
@@ -65,6 +65,7 @@
#include <openssl/objects.h>
#include <openssl/x509.h>
#include <openssl/md2.h>
+#include <openssl/rsa.h>
static int init(EVP_MD_CTX *ctx)
{ return MD2_Init(ctx->md_data); }
diff --git a/crypto/evp/m_md4.c b/crypto/evp/m_md4.c
index a3f6be4f3b..787d6554c1 100644
--- a/crypto/evp/m_md4.c
+++ b/crypto/evp/m_md4.c
@@ -65,6 +65,7 @@
#include <openssl/objects.h>
#include <openssl/x509.h>
#include <openssl/md4.h>
+#include <openssl/rsa.h>
static int init(EVP_MD_CTX *ctx)
{ return MD4_Init(ctx->md_data); }
diff --git a/crypto/evp/m_md5.c b/crypto/evp/m_md5.c
index cc4216a538..a214315abe 100644
--- a/crypto/evp/m_md5.c
+++ b/crypto/evp/m_md5.c
@@ -65,6 +65,7 @@
#include <openssl/objects.h>
#include <openssl/x509.h>
#include <openssl/md5.h>
+#include <openssl/rsa.h>
static int init(EVP_MD_CTX *ctx)
{ return MD5_Init(ctx->md_data); }
diff --git a/crypto/evp/m_mdc2.c b/crypto/evp/m_mdc2.c
index 58df547e0c..14e8175790 100644
--- a/crypto/evp/m_mdc2.c
+++ b/crypto/evp/m_mdc2.c
@@ -65,6 +65,7 @@
#include <openssl/objects.h>
#include <openssl/x509.h>
#include <openssl/mdc2.h>
+#include <openssl/rsa.h>
static int init(EVP_MD_CTX *ctx)
{ return MDC2_Init(ctx->md_data); }
diff --git a/crypto/evp/m_ripemd.c b/crypto/evp/m_ripemd.c
index ca8ed75851..93910a44ab 100644
--- a/crypto/evp/m_ripemd.c
+++ b/crypto/evp/m_ripemd.c
@@ -65,6 +65,7 @@
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/x509.h>
+#include <openssl/rsa.h>
static int init(EVP_MD_CTX *ctx)
{ return RIPEMD160_Init(ctx->md_data); }
diff --git a/crypto/evp/m_sha.c b/crypto/evp/m_sha.c
index a3343bb2eb..f3b9610757 100644
--- a/crypto/evp/m_sha.c
+++ b/crypto/evp/m_sha.c
@@ -64,6 +64,7 @@
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/x509.h>
+#include <openssl/rsa.h>
static int init(EVP_MD_CTX *ctx)
{ return SHA_Init(ctx->md_data); }
diff --git a/crypto/evp/m_sha1.c b/crypto/evp/m_sha1.c
index 838225bf84..364b368877 100644
--- a/crypto/evp/m_sha1.c
+++ b/crypto/evp/m_sha1.c
@@ -64,6 +64,7 @@
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/x509.h>
+#include <openssl/rsa.h>
static int init(EVP_MD_CTX *ctx)
{ return SHA1_Init(ctx->md_data); }
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c
index d6d7234cd5..934f8ff8be 100644
--- a/crypto/evp/p_lib.c
+++ b/crypto/evp/p_lib.c
@@ -64,6 +64,9 @@
#include <openssl/evp.h>
#include <openssl/asn1_mac.h>
#include <openssl/x509.h>
+#include <openssl/rsa.h>
+#include <openssl/dsa.h>
+#include <openssl/dh.h>
static void EVP_PKEY_free_it(EVP_PKEY *x);
diff --git a/crypto/evp/p_open.c b/crypto/evp/p_open.c
index 8ec6c75a13..9935206d0f 100644
--- a/crypto/evp/p_open.c
+++ b/crypto/evp/p_open.c
@@ -64,6 +64,7 @@
#include <openssl/evp.h>
#include <openssl/objects.h>
#include <openssl/x509.h>
+#include <openssl/rsa.h>
int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
const unsigned char *ek, int ekl, const unsigned char *iv,
diff --git a/crypto/ex_data.c b/crypto/ex_data.c
index f68cf84525..8914218fe8 100644
--- a/crypto/ex_data.c
+++ b/crypto/ex_data.c
@@ -138,12 +138,8 @@
*
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <openssl/buffer.h>
-#include <openssl/bio.h>
-#include <openssl/lhash.h>
#include "cryptlib.h"
+#include <openssl/lhash.h>
/* What an "implementation of ex_data functionality" looks like */
struct st_CRYPTO_EX_DATA_IMPL
diff --git a/crypto/pem/pem_all.c b/crypto/pem/pem_all.c
index 60f5188f30..a4357d591c 100644
--- a/crypto/pem/pem_all.c
+++ b/crypto/pem/pem_all.c
@@ -117,6 +117,9 @@
#include <openssl/x509.h>
#include <openssl/pkcs7.h>
#include <openssl/pem.h>
+#include <openssl/rsa.h>
+#include <openssl/dsa.h>
+#include <openssl/dh.h>
#ifndef OPENSSL_NO_RSA
static RSA *pkey_get_rsa(EVP_PKEY *key, RSA **rsa);
diff --git a/crypto/pem/pem_info.c b/crypto/pem/pem_info.c
index 17ea85e4d7..7eba3b26c1 100644
--- a/crypto/pem/pem_info.c
+++ b/crypto/pem/pem_info.c
@@ -63,6 +63,8 @@
#include <openssl/evp.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
+#include <openssl/rsa.h>
+#include <openssl/dsa.h>
#ifndef OPENSSL_NO_FP_API
STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u)
diff --git a/crypto/pem/pem_seal.c b/crypto/pem/pem_seal.c
index 56e08abd70..0458093353 100644
--- a/crypto/pem/pem_seal.c
+++ b/crypto/pem/pem_seal.c
@@ -64,6 +64,7 @@
#include <openssl/objects.h>
#include <openssl/x509.h>
#include <openssl/pem.h>
+#include <openssl/rsa.h>
int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type,
unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk,
diff --git a/crypto/x509/x509.h b/crypto/x509/x509.h
index b73a699598..edf1cd4939 100644
--- a/crypto/x509/x509.h
+++ b/crypto/x509/x509.h
@@ -79,14 +79,6 @@
#include <openssl/asn1.h>
#include <openssl/safestack.h>
-#ifndef OPENSSL_NO_RSA
-#include <openssl/rsa.h>
-#endif
-
-#ifndef OPENSSL_NO_DSA
-#include <openssl/dsa.h>
-#endif
-
#ifndef OPENSSL_NO_EC
#include <openssl/ec.h>
#endif
@@ -99,9 +91,18 @@
#include <openssl/ecdh.h>
#endif
+#ifndef OPENSSL_NO_DEPRECATED
+#ifndef OPENSSL_NO_RSA
+#include <openssl/rsa.h>
+#endif
+#ifndef OPENSSL_NO_DSA
+#include <openssl/dsa.h>
+#endif
#ifndef OPENSSL_NO_DH
#include <openssl/dh.h>
#endif
+#endif
+
#ifndef OPENSSL_NO_SHA
#include <openssl/sha.h>
#endif
diff --git a/crypto/x509/x_all.c b/crypto/x509/x_all.c
index 801df78f08..eb33e0f6e6 100644
--- a/crypto/x509/x_all.c
+++ b/crypto/x509/x_all.c
@@ -64,6 +64,8 @@
#include <openssl/asn1.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
+#include <openssl/rsa.h>
+#include <openssl/dsa.h>
int X509_verify(X509 *a, EVP_PKEY *r)
{
diff --git a/ssl/s2_lib.c b/ssl/s2_lib.c
index 4a86ac2dd6..075e49dc83 100644
--- a/ssl/s2_lib.c
+++ b/ssl/s2_lib.c
@@ -59,7 +59,6 @@
#include "ssl_locl.h"
#ifndef OPENSSL_NO_SSL2
#include <stdio.h>
-#include <openssl/rsa.h>
#include <openssl/objects.h>
#include <openssl/evp.h>
#include <openssl/md5.h>
diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c
index 09f6c8d3ab..8feb24a142 100644
--- a/ssl/s3_clnt.c
+++ b/ssl/s3_clnt.c
@@ -130,6 +130,7 @@
#include <openssl/objects.h>
#include <openssl/evp.h>
#include <openssl/md5.h>
+#include <openssl/dh.h>
static SSL_METHOD *ssl3_get_client_method(int ver);
static int ssl3_client_hello(SSL *s);
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c
index 1ff9e3093b..adeb3418a9 100644
--- a/ssl/s3_lib.c
+++ b/ssl/s3_lib.c
@@ -127,6 +127,7 @@
#include "ssl_locl.h"
#include "kssl_lcl.h"
#include <openssl/md5.h>
+#include <openssl/dh.h>
const char *ssl3_version_str="SSLv3" OPENSSL_VERSION_PTEXT;
diff --git a/ssl/s3_srvr.c b/ssl/s3_srvr.c
index be92932bb6..cd96d67db7 100644
--- a/ssl/s3_srvr.c
+++ b/ssl/s3_srvr.c
@@ -133,6 +133,7 @@
#include <openssl/objects.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
+#include <openssl/dh.h>
#ifndef OPENSSL_NO_KRB5
#include <openssl/krb5_asn.h>
#endif
diff --git a/ssl/ssl_cert.c b/ssl/ssl_cert.c
index 9fa4e61633..aa074e499d 100644
--- a/ssl/ssl_cert.c
+++ b/ssl/ssl_cert.c
@@ -133,6 +133,7 @@
#include <openssl/bio.h>
#include <openssl/pem.h>
#include <openssl/x509v3.h>
+#include <openssl/dh.h>
#include "ssl_locl.h"
int SSL_get_ex_data_X509_STORE_CTX_idx(void)
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index b7b2e4086a..7da3dda900 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -125,6 +125,7 @@
#include <openssl/objects.h>
#include <openssl/lhash.h>
#include <openssl/x509v3.h>
+#include <openssl/dh.h>
const char *SSL_version_str=OPENSSL_VERSION_TEXT;
diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h
index 26e518ade7..9b03123ab1 100644
--- a/ssl/ssl_locl.h
+++ b/ssl/ssl_locl.h
@@ -130,6 +130,8 @@
#include <openssl/evp.h>
#include <openssl/stack.h>
#include <openssl/x509.h>
+#include <openssl/rsa.h>
+#include <openssl/dsa.h>
#include <openssl/err.h>
#include <openssl/ssl.h>
#include <openssl/symhacks.h>
diff --git a/ssl/ssltest.c b/ssl/ssltest.c
index 68eb654572..9e95bf6a6e 100644
--- a/ssl/ssltest.c
+++ b/ssl/ssltest.c
@@ -138,6 +138,9 @@
#endif
#include <openssl/err.h>
#include <openssl/rand.h>
+#include <openssl/rsa.h>
+#include <openssl/dsa.h>
+#include <openssl/dh.h>
#define _XOPEN_SOURCE_EXTENDED 1 /* Or gethostname won't be declared properly
on Compaq platforms (at least with DEC C).