summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp
diff options
context:
space:
mode:
authorjsing <>2014-07-11 08:44:49 +0000
committerjsing <>2014-07-11 08:44:49 +0000
commit8c3482db610348be15fb633bb52b0511c2cabbcf (patch)
tree0e726f9e971e00f4c8cd8afab71589803fc11b7f /src/lib/libcrypto/evp
parenta336cdb63c1fe5d934826147bf5c19d317ced73b (diff)
downloadopenbsd-8c3482db610348be15fb633bb52b0511c2cabbcf.tar.gz
openbsd-8c3482db610348be15fb633bb52b0511c2cabbcf.tar.bz2
openbsd-8c3482db610348be15fb633bb52b0511c2cabbcf.zip
Only import cryptlib.h in the four source files that actually need it.
Remove the openssl public includes from cryptlib.h and add a small number of includes into the source files that actually need them. While here, also sort/group/tidy the includes. ok beck@ miod@
Diffstat (limited to 'src/lib/libcrypto/evp')
-rw-r--r--src/lib/libcrypto/evp/bio_b64.c3
-rw-r--r--src/lib/libcrypto/evp/bio_enc.c3
-rw-r--r--src/lib/libcrypto/evp/bio_md.c4
-rw-r--r--src/lib/libcrypto/evp/c_allc.c5
-rw-r--r--src/lib/libcrypto/evp/c_alld.c5
-rw-r--r--src/lib/libcrypto/evp/digest.c6
-rw-r--r--src/lib/libcrypto/evp/e_bf.c9
-rw-r--r--src/lib/libcrypto/evp/e_cast.c8
-rw-r--r--src/lib/libcrypto/evp/e_des.c9
-rw-r--r--src/lib/libcrypto/evp/e_des3.c9
-rw-r--r--src/lib/libcrypto/evp/e_idea.c8
-rw-r--r--src/lib/libcrypto/evp/e_null.c3
-rw-r--r--src/lib/libcrypto/evp/e_rc2.c8
-rw-r--r--src/lib/libcrypto/evp/e_rc4.c7
-rw-r--r--src/lib/libcrypto/evp/e_rc5.c7
-rw-r--r--src/lib/libcrypto/evp/e_xcbc_d.c7
-rw-r--r--src/lib/libcrypto/evp/encode.c3
-rw-r--r--src/lib/libcrypto/evp/evp_enc.c7
-rw-r--r--src/lib/libcrypto/evp/evp_key.c7
-rw-r--r--src/lib/libcrypto/evp/evp_lib.c4
-rw-r--r--src/lib/libcrypto/evp/evp_pbe.c5
-rw-r--r--src/lib/libcrypto/evp/evp_pkey.c8
-rw-r--r--src/lib/libcrypto/evp/m_dss.c4
-rw-r--r--src/lib/libcrypto/evp/m_dss1.c5
-rw-r--r--src/lib/libcrypto/evp/m_ecdsa.c3
-rw-r--r--src/lib/libcrypto/evp/m_md4.c7
-rw-r--r--src/lib/libcrypto/evp/m_md5.c8
-rw-r--r--src/lib/libcrypto/evp/m_mdc2.c7
-rw-r--r--src/lib/libcrypto/evp/m_null.c4
-rw-r--r--src/lib/libcrypto/evp/m_ripemd.c8
-rw-r--r--src/lib/libcrypto/evp/m_sha.c6
-rw-r--r--src/lib/libcrypto/evp/m_sha1.c6
-rw-r--r--src/lib/libcrypto/evp/m_sigver.c6
-rw-r--r--src/lib/libcrypto/evp/m_wp.c5
-rw-r--r--src/lib/libcrypto/evp/names.c4
-rw-r--r--src/lib/libcrypto/evp/p5_crpt.c6
-rw-r--r--src/lib/libcrypto/evp/p5_crpt2.c8
-rw-r--r--src/lib/libcrypto/evp/p_dec.c11
-rw-r--r--src/lib/libcrypto/evp/p_enc.c11
-rw-r--r--src/lib/libcrypto/evp/p_lib.c16
-rw-r--r--src/lib/libcrypto/evp/p_open.c7
-rw-r--r--src/lib/libcrypto/evp/p_seal.c10
-rw-r--r--src/lib/libcrypto/evp/p_sign.c5
-rw-r--r--src/lib/libcrypto/evp/p_verify.c5
-rw-r--r--src/lib/libcrypto/evp/pmeth_fn.c8
-rw-r--r--src/lib/libcrypto/evp/pmeth_gn.c10
-rw-r--r--src/lib/libcrypto/evp/pmeth_lib.c7
47 files changed, 157 insertions, 155 deletions
diff --git a/src/lib/libcrypto/evp/bio_b64.c b/src/lib/libcrypto/evp/bio_b64.c
index 7211195adf..632d056168 100644
--- a/src/lib/libcrypto/evp/bio_b64.c
+++ b/src/lib/libcrypto/evp/bio_b64.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_b64.c,v 1.17 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bio_b64.c,v 1.18 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,7 +60,6 @@
60#include <stdio.h> 60#include <stdio.h>
61#include <string.h> 61#include <string.h>
62 62
63#include "cryptlib.h"
64#include <openssl/buffer.h> 63#include <openssl/buffer.h>
65#include <openssl/evp.h> 64#include <openssl/evp.h>
66 65
diff --git a/src/lib/libcrypto/evp/bio_enc.c b/src/lib/libcrypto/evp/bio_enc.c
index 3b936f5843..e367faa967 100644
--- a/src/lib/libcrypto/evp/bio_enc.c
+++ b/src/lib/libcrypto/evp/bio_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_enc.c,v 1.17 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: bio_enc.c,v 1.18 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,7 +60,6 @@
60#include <stdio.h> 60#include <stdio.h>
61#include <string.h> 61#include <string.h>
62 62
63#include "cryptlib.h"
64#include <openssl/buffer.h> 63#include <openssl/buffer.h>
65#include <openssl/evp.h> 64#include <openssl/evp.h>
66 65
diff --git a/src/lib/libcrypto/evp/bio_md.c b/src/lib/libcrypto/evp/bio_md.c
index 3d13839df5..b1973746a7 100644
--- a/src/lib/libcrypto/evp/bio_md.c
+++ b/src/lib/libcrypto/evp/bio_md.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bio_md.c,v 1.13 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: bio_md.c,v 1.14 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -58,7 +58,7 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <errno.h> 60#include <errno.h>
61#include "cryptlib.h" 61
62#include <openssl/buffer.h> 62#include <openssl/buffer.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64 64
diff --git a/src/lib/libcrypto/evp/c_allc.c b/src/lib/libcrypto/evp/c_allc.c
index a4c796b6d5..657e14f86f 100644
--- a/src/lib/libcrypto/evp/c_allc.c
+++ b/src/lib/libcrypto/evp/c_allc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: c_allc.c,v 1.12 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: c_allc.c,v 1.13 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,10 +60,9 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include <openssl/evp.h> 63#include <openssl/evp.h>
65#include <openssl/pkcs12.h>
66#include <openssl/objects.h> 64#include <openssl/objects.h>
65#include <openssl/pkcs12.h>
67 66
68void 67void
69OpenSSL_add_all_ciphers(void) 68OpenSSL_add_all_ciphers(void)
diff --git a/src/lib/libcrypto/evp/c_alld.c b/src/lib/libcrypto/evp/c_alld.c
index 16726b6caa..8f59100caa 100644
--- a/src/lib/libcrypto/evp/c_alld.c
+++ b/src/lib/libcrypto/evp/c_alld.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: c_alld.c,v 1.10 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: c_alld.c,v 1.11 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,10 +60,9 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include <openssl/evp.h> 63#include <openssl/evp.h>
65#include <openssl/pkcs12.h>
66#include <openssl/objects.h> 64#include <openssl/objects.h>
65#include <openssl/pkcs12.h>
67 66
68void 67void
69OpenSSL_add_all_digests(void) 68OpenSSL_add_all_digests(void)
diff --git a/src/lib/libcrypto/evp/digest.c b/src/lib/libcrypto/evp/digest.c
index e1ce7dd3a3..9a4b1a6293 100644
--- a/src/lib/libcrypto/evp/digest.c
+++ b/src/lib/libcrypto/evp/digest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: digest.c,v 1.20 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: digest.c,v 1.21 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -114,9 +114,9 @@
114 114
115#include <openssl/opensslconf.h> 115#include <openssl/opensslconf.h>
116 116
117#include "cryptlib.h"
118#include <openssl/objects.h>
119#include <openssl/evp.h> 117#include <openssl/evp.h>
118#include <openssl/objects.h>
119
120#ifndef OPENSSL_NO_ENGINE 120#ifndef OPENSSL_NO_ENGINE
121#include <openssl/engine.h> 121#include <openssl/engine.h>
122#endif 122#endif
diff --git a/src/lib/libcrypto/evp/e_bf.c b/src/lib/libcrypto/evp/e_bf.c
index fe133fb8ea..615c9bd771 100644
--- a/src/lib/libcrypto/evp/e_bf.c
+++ b/src/lib/libcrypto/evp/e_bf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_bf.c,v 1.7 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_bf.c,v 1.8 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,12 +60,13 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#ifndef OPENSSL_NO_BF 63#ifndef OPENSSL_NO_BF
64
65#include <openssl/blowfish.h>
65#include <openssl/evp.h> 66#include <openssl/evp.h>
66#include "evp_locl.h"
67#include <openssl/objects.h> 67#include <openssl/objects.h>
68#include <openssl/blowfish.h> 68
69#include "evp_locl.h"
69 70
70static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 71static int bf_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
71 const unsigned char *iv, int enc); 72 const unsigned char *iv, int enc);
diff --git a/src/lib/libcrypto/evp/e_cast.c b/src/lib/libcrypto/evp/e_cast.c
index 2476bf2799..707daa9656 100644
--- a/src/lib/libcrypto/evp/e_cast.c
+++ b/src/lib/libcrypto/evp/e_cast.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_cast.c,v 1.6 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_cast.c,v 1.7 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,13 +60,13 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_CAST 63#ifndef OPENSSL_NO_CAST
64
65#include <openssl/cast.h>
66#include <openssl/evp.h> 66#include <openssl/evp.h>
67#include <openssl/objects.h> 67#include <openssl/objects.h>
68
68#include "evp_locl.h" 69#include "evp_locl.h"
69#include <openssl/cast.h>
70 70
71static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 71static int cast_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
72 const unsigned char *iv, int enc); 72 const unsigned char *iv, int enc);
diff --git a/src/lib/libcrypto/evp/e_des.c b/src/lib/libcrypto/evp/e_des.c
index 1f0de7cbfd..0a32d2adb9 100644
--- a/src/lib/libcrypto/evp/e_des.c
+++ b/src/lib/libcrypto/evp/e_des.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_des.c,v 1.10 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_des.c,v 1.11 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,14 +60,15 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#ifndef OPENSSL_NO_DES 63#ifndef OPENSSL_NO_DES
64
65#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/objects.h>
67#include "evp_locl.h"
68#include <openssl/des.h> 66#include <openssl/des.h>
67#include <openssl/objects.h>
69#include <openssl/rand.h> 68#include <openssl/rand.h>
70 69
70#include "evp_locl.h"
71
71static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 72static int des_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
72 const unsigned char *iv, int enc); 73 const unsigned char *iv, int enc);
73static int des_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr); 74static int des_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr);
diff --git a/src/lib/libcrypto/evp/e_des3.c b/src/lib/libcrypto/evp/e_des3.c
index f4264d8ca4..0f1974f6c9 100644
--- a/src/lib/libcrypto/evp/e_des3.c
+++ b/src/lib/libcrypto/evp/e_des3.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_des3.c,v 1.15 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_des3.c,v 1.16 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -61,14 +61,15 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#ifndef OPENSSL_NO_DES 64#ifndef OPENSSL_NO_DES
65
66#include <openssl/des.h>
66#include <openssl/evp.h> 67#include <openssl/evp.h>
67#include <openssl/objects.h> 68#include <openssl/objects.h>
68#include "evp_locl.h"
69#include <openssl/des.h>
70#include <openssl/rand.h> 69#include <openssl/rand.h>
71 70
71#include "evp_locl.h"
72
72static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 73static int des_ede_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
73 const unsigned char *iv, int enc); 74 const unsigned char *iv, int enc);
74 75
diff --git a/src/lib/libcrypto/evp/e_idea.c b/src/lib/libcrypto/evp/e_idea.c
index 7dd385e04e..3ba4dbcdb9 100644
--- a/src/lib/libcrypto/evp/e_idea.c
+++ b/src/lib/libcrypto/evp/e_idea.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_idea.c,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_idea.c,v 1.9 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,13 +60,13 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_IDEA 63#ifndef OPENSSL_NO_IDEA
64
66#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/idea.h>
67#include <openssl/objects.h> 67#include <openssl/objects.h>
68
68#include "evp_locl.h" 69#include "evp_locl.h"
69#include <openssl/idea.h>
70 70
71static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 71static int idea_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
72 const unsigned char *iv, int enc); 72 const unsigned char *iv, int enc);
diff --git a/src/lib/libcrypto/evp/e_null.c b/src/lib/libcrypto/evp/e_null.c
index 0d0a06f2e3..65374cc3f5 100644
--- a/src/lib/libcrypto/evp/e_null.c
+++ b/src/lib/libcrypto/evp/e_null.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_null.c,v 1.13 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: e_null.c,v 1.14 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -59,7 +59,6 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include "cryptlib.h"
63#include <openssl/evp.h> 62#include <openssl/evp.h>
64#include <openssl/objects.h> 63#include <openssl/objects.h>
65 64
diff --git a/src/lib/libcrypto/evp/e_rc2.c b/src/lib/libcrypto/evp/e_rc2.c
index c164ab10f7..456a22eeeb 100644
--- a/src/lib/libcrypto/evp/e_rc2.c
+++ b/src/lib/libcrypto/evp/e_rc2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_rc2.c,v 1.9 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_rc2.c,v 1.10 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,15 +60,15 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_RC2 63#ifndef OPENSSL_NO_RC2
66 64
65#include <openssl/err.h>
67#include <openssl/evp.h> 66#include <openssl/evp.h>
68#include <openssl/objects.h> 67#include <openssl/objects.h>
69#include "evp_locl.h"
70#include <openssl/rc2.h> 68#include <openssl/rc2.h>
71 69
70#include "evp_locl.h"
71
72static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 72static int rc2_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
73 const unsigned char *iv, int enc); 73 const unsigned char *iv, int enc);
74static int rc2_meth_to_magic(EVP_CIPHER_CTX *ctx); 74static int rc2_meth_to_magic(EVP_CIPHER_CTX *ctx);
diff --git a/src/lib/libcrypto/evp/e_rc4.c b/src/lib/libcrypto/evp/e_rc4.c
index f8e4149a62..e77a293141 100644
--- a/src/lib/libcrypto/evp/e_rc4.c
+++ b/src/lib/libcrypto/evp/e_rc4.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_rc4.c,v 1.13 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_rc4.c,v 1.14 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,15 +60,14 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_RC4 63#ifndef OPENSSL_NO_RC4
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
68#include "evp_locl.h"
69#include <openssl/objects.h> 66#include <openssl/objects.h>
70#include <openssl/rc4.h> 67#include <openssl/rc4.h>
71 68
69#include "evp_locl.h"
70
72/* FIXME: surely this is available elsewhere? */ 71/* FIXME: surely this is available elsewhere? */
73#define EVP_RC4_KEY_SIZE 16 72#define EVP_RC4_KEY_SIZE 16
74 73
diff --git a/src/lib/libcrypto/evp/e_rc5.c b/src/lib/libcrypto/evp/e_rc5.c
index 00e1251818..3a1dab9999 100644
--- a/src/lib/libcrypto/evp/e_rc5.c
+++ b/src/lib/libcrypto/evp/e_rc5.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_rc5.c,v 1.6 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_rc5.c,v 1.7 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,15 +60,14 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_RC5 63#ifndef OPENSSL_NO_RC5
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
68#include <openssl/objects.h> 66#include <openssl/objects.h>
69#include "evp_locl.h"
70#include <openssl/rc5.h> 67#include <openssl/rc5.h>
71 68
69#include "evp_locl.h"
70
72static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 71static int r_32_12_16_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
73 const unsigned char *iv, int enc); 72 const unsigned char *iv, int enc);
74static int rc5_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr); 73static int rc5_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr);
diff --git a/src/lib/libcrypto/evp/e_xcbc_d.c b/src/lib/libcrypto/evp/e_xcbc_d.c
index 496850b315..2aae0a9151 100644
--- a/src/lib/libcrypto/evp/e_xcbc_d.c
+++ b/src/lib/libcrypto/evp/e_xcbc_d.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: e_xcbc_d.c,v 1.11 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: e_xcbc_d.c,v 1.12 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -61,14 +61,13 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65
66#ifndef OPENSSL_NO_DES 64#ifndef OPENSSL_NO_DES
67 65
66#include <openssl/des.h>
68#include <openssl/evp.h> 67#include <openssl/evp.h>
69#include <openssl/objects.h> 68#include <openssl/objects.h>
69
70#include "evp_locl.h" 70#include "evp_locl.h"
71#include <openssl/des.h>
72 71
73static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, 72static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
74 const unsigned char *iv, int enc); 73 const unsigned char *iv, int enc);
diff --git a/src/lib/libcrypto/evp/encode.c b/src/lib/libcrypto/evp/encode.c
index a83cf76c9f..f33afb03d3 100644
--- a/src/lib/libcrypto/evp/encode.c
+++ b/src/lib/libcrypto/evp/encode.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: encode.c,v 1.17 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: encode.c,v 1.18 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -59,7 +59,6 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include "cryptlib.h"
63#include <openssl/evp.h> 62#include <openssl/evp.h>
64 63
65#define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f]) 64#define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f])
diff --git a/src/lib/libcrypto/evp/evp_enc.c b/src/lib/libcrypto/evp/evp_enc.c
index 798ac442f9..4333e4dff8 100644
--- a/src/lib/libcrypto/evp/evp_enc.c
+++ b/src/lib/libcrypto/evp/evp_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_enc.c,v 1.23 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: evp_enc.c,v 1.24 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -61,13 +61,14 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h"
65#include <openssl/evp.h>
66#include <openssl/err.h> 64#include <openssl/err.h>
65#include <openssl/evp.h>
67#include <openssl/rand.h> 66#include <openssl/rand.h>
67
68#ifndef OPENSSL_NO_ENGINE 68#ifndef OPENSSL_NO_ENGINE
69#include <openssl/engine.h> 69#include <openssl/engine.h>
70#endif 70#endif
71
71#include "evp_locl.h" 72#include "evp_locl.h"
72 73
73#define M_do_cipher(ctx, out, in, inl) ctx->cipher->do_cipher(ctx, out, in, inl) 74#define M_do_cipher(ctx, out, in, inl) ctx->cipher->do_cipher(ctx, out, in, inl)
diff --git a/src/lib/libcrypto/evp/evp_key.c b/src/lib/libcrypto/evp/evp_key.c
index 4380be9137..dffca300c6 100644
--- a/src/lib/libcrypto/evp/evp_key.c
+++ b/src/lib/libcrypto/evp/evp_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_key.c,v 1.17 2014/07/10 19:30:06 miod Exp $ */ 1/* $OpenBSD: evp_key.c,v 1.18 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -59,11 +59,10 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include "cryptlib.h"
63#include <openssl/x509.h>
64#include <openssl/objects.h>
65#include <openssl/evp.h> 62#include <openssl/evp.h>
63#include <openssl/objects.h>
66#include <openssl/ui.h> 64#include <openssl/ui.h>
65#include <openssl/x509.h>
67 66
68/* should be init to zeros. */ 67/* should be init to zeros. */
69static char prompt_string[80]; 68static char prompt_string[80];
diff --git a/src/lib/libcrypto/evp/evp_lib.c b/src/lib/libcrypto/evp/evp_lib.c
index 1664703288..310252d0e8 100644
--- a/src/lib/libcrypto/evp/evp_lib.c
+++ b/src/lib/libcrypto/evp/evp_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_lib.c,v 1.12 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: evp_lib.c,v 1.13 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -59,7 +59,7 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <string.h> 60#include <string.h>
61 61
62#include "cryptlib.h" 62#include <openssl/err.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64#include <openssl/objects.h> 64#include <openssl/objects.h>
65 65
diff --git a/src/lib/libcrypto/evp/evp_pbe.c b/src/lib/libcrypto/evp/evp_pbe.c
index 63e71c0bc9..42ec6e0dda 100644
--- a/src/lib/libcrypto/evp/evp_pbe.c
+++ b/src/lib/libcrypto/evp/evp_pbe.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_pbe.c,v 1.19 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: evp_pbe.c,v 1.20 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -61,10 +61,11 @@
61 61
62#include <openssl/opensslconf.h> 62#include <openssl/opensslconf.h>
63 63
64#include "cryptlib.h" 64#include <openssl/err.h>
65#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/pkcs12.h> 66#include <openssl/pkcs12.h>
67#include <openssl/x509.h> 67#include <openssl/x509.h>
68
68#include "evp_locl.h" 69#include "evp_locl.h"
69 70
70/* Password based encryption (PBE) functions */ 71/* Password based encryption (PBE) functions */
diff --git a/src/lib/libcrypto/evp/evp_pkey.c b/src/lib/libcrypto/evp/evp_pkey.c
index 46846d2c31..cf7a39be7b 100644
--- a/src/lib/libcrypto/evp/evp_pkey.c
+++ b/src/lib/libcrypto/evp/evp_pkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_pkey.c,v 1.15 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: evp_pkey.c,v 1.16 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -58,9 +58,11 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <stdlib.h> 60#include <stdlib.h>
61#include "cryptlib.h" 61
62#include <openssl/x509.h> 62#include <openssl/err.h>
63#include <openssl/rand.h> 63#include <openssl/rand.h>
64#include <openssl/x509.h>
65
64#include "asn1_locl.h" 66#include "asn1_locl.h"
65 67
66/* Extract a private key from a PKCS8 structure */ 68/* Extract a private key from a PKCS8 structure */
diff --git a/src/lib/libcrypto/evp/m_dss.c b/src/lib/libcrypto/evp/m_dss.c
index 81e3dd1511..d23c9b4e71 100644
--- a/src/lib/libcrypto/evp/m_dss.c
+++ b/src/lib/libcrypto/evp/m_dss.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_dss.c,v 1.15 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_dss.c,v 1.16 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,10 +60,10 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64#include <openssl/evp.h> 63#include <openssl/evp.h>
65#include <openssl/objects.h> 64#include <openssl/objects.h>
66#include <openssl/sha.h> 65#include <openssl/sha.h>
66
67#ifndef OPENSSL_NO_DSA 67#ifndef OPENSSL_NO_DSA
68#include <openssl/dsa.h> 68#include <openssl/dsa.h>
69#endif 69#endif
diff --git a/src/lib/libcrypto/evp/m_dss1.c b/src/lib/libcrypto/evp/m_dss1.c
index efa91230dc..a906c11b69 100644
--- a/src/lib/libcrypto/evp/m_dss1.c
+++ b/src/lib/libcrypto/evp/m_dss1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_dss1.c,v 1.15 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_dss1.c,v 1.16 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,13 +60,12 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_SHA 63#ifndef OPENSSL_NO_SHA
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
68#include <openssl/objects.h> 66#include <openssl/objects.h>
69#include <openssl/sha.h> 67#include <openssl/sha.h>
68
70#ifndef OPENSSL_NO_DSA 69#ifndef OPENSSL_NO_DSA
71#include <openssl/dsa.h> 70#include <openssl/dsa.h>
72#endif 71#endif
diff --git a/src/lib/libcrypto/evp/m_ecdsa.c b/src/lib/libcrypto/evp/m_ecdsa.c
index d4872dcf29..b9af6423b5 100644
--- a/src/lib/libcrypto/evp/m_ecdsa.c
+++ b/src/lib/libcrypto/evp/m_ecdsa.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_ecdsa.c,v 1.7 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_ecdsa.c,v 1.8 2014/07/11 08:44:48 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -113,7 +113,6 @@
113 113
114#include <openssl/opensslconf.h> 114#include <openssl/opensslconf.h>
115 115
116#include "cryptlib.h"
117#include <openssl/evp.h> 116#include <openssl/evp.h>
118#include <openssl/objects.h> 117#include <openssl/objects.h>
119#include <openssl/x509.h> 118#include <openssl/x509.h>
diff --git a/src/lib/libcrypto/evp/m_md4.c b/src/lib/libcrypto/evp/m_md4.c
index e24d0ad66f..36ea818285 100644
--- a/src/lib/libcrypto/evp/m_md4.c
+++ b/src/lib/libcrypto/evp/m_md4.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_md4.c,v 1.12 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_md4.c,v 1.13 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,14 +60,13 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_MD4 63#ifndef OPENSSL_NO_MD4
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/md4.h>
68#include <openssl/objects.h> 67#include <openssl/objects.h>
69#include <openssl/x509.h> 68#include <openssl/x509.h>
70#include <openssl/md4.h> 69
71#ifndef OPENSSL_NO_RSA 70#ifndef OPENSSL_NO_RSA
72#include <openssl/rsa.h> 71#include <openssl/rsa.h>
73#endif 72#endif
diff --git a/src/lib/libcrypto/evp/m_md5.c b/src/lib/libcrypto/evp/m_md5.c
index 445b2b4381..5bd9100a03 100644
--- a/src/lib/libcrypto/evp/m_md5.c
+++ b/src/lib/libcrypto/evp/m_md5.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_md5.c,v 1.13 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_md5.c,v 1.14 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,17 +60,17 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_MD5 63#ifndef OPENSSL_NO_MD5
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/md5.h>
68#include <openssl/objects.h> 67#include <openssl/objects.h>
69#include <openssl/x509.h> 68#include <openssl/x509.h>
70#include <openssl/md5.h> 69
71#ifndef OPENSSL_NO_RSA 70#ifndef OPENSSL_NO_RSA
72#include <openssl/rsa.h> 71#include <openssl/rsa.h>
73#endif 72#endif
73
74#include "evp_locl.h" 74#include "evp_locl.h"
75 75
76static int 76static int
diff --git a/src/lib/libcrypto/evp/m_mdc2.c b/src/lib/libcrypto/evp/m_mdc2.c
index c360c986d5..0262f8dc77 100644
--- a/src/lib/libcrypto/evp/m_mdc2.c
+++ b/src/lib/libcrypto/evp/m_mdc2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_mdc2.c,v 1.13 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_mdc2.c,v 1.14 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,14 +60,13 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_MDC2 63#ifndef OPENSSL_NO_MDC2
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/mdc2.h>
68#include <openssl/objects.h> 67#include <openssl/objects.h>
69#include <openssl/x509.h> 68#include <openssl/x509.h>
70#include <openssl/mdc2.h> 69
71#ifndef OPENSSL_NO_RSA 70#ifndef OPENSSL_NO_RSA
72#include <openssl/rsa.h> 71#include <openssl/rsa.h>
73#endif 72#endif
diff --git a/src/lib/libcrypto/evp/m_null.c b/src/lib/libcrypto/evp/m_null.c
index 1a10101762..897be3cee9 100644
--- a/src/lib/libcrypto/evp/m_null.c
+++ b/src/lib/libcrypto/evp/m_null.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_null.c,v 1.8 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: m_null.c,v 1.9 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -57,7 +57,7 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/evp.h> 61#include <openssl/evp.h>
62#include <openssl/objects.h> 62#include <openssl/objects.h>
63#include <openssl/x509.h> 63#include <openssl/x509.h>
diff --git a/src/lib/libcrypto/evp/m_ripemd.c b/src/lib/libcrypto/evp/m_ripemd.c
index c496a205d6..765eec3138 100644
--- a/src/lib/libcrypto/evp/m_ripemd.c
+++ b/src/lib/libcrypto/evp/m_ripemd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_ripemd.c,v 1.10 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_ripemd.c,v 1.11 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,17 +60,17 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_RIPEMD 63#ifndef OPENSSL_NO_RIPEMD
66 64
67#include <openssl/ripemd.h>
68#include <openssl/evp.h> 65#include <openssl/evp.h>
69#include <openssl/objects.h> 66#include <openssl/objects.h>
67#include <openssl/ripemd.h>
70#include <openssl/x509.h> 68#include <openssl/x509.h>
69
71#ifndef OPENSSL_NO_RSA 70#ifndef OPENSSL_NO_RSA
72#include <openssl/rsa.h> 71#include <openssl/rsa.h>
73#endif 72#endif
73
74#include "evp_locl.h" 74#include "evp_locl.h"
75 75
76static int 76static int
diff --git a/src/lib/libcrypto/evp/m_sha.c b/src/lib/libcrypto/evp/m_sha.c
index ed22c1aec5..73678e4e45 100644
--- a/src/lib/libcrypto/evp/m_sha.c
+++ b/src/lib/libcrypto/evp/m_sha.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_sha.c,v 1.14 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_sha.c,v 1.15 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,16 +60,16 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA0) 63#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA0)
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
68#include <openssl/objects.h> 66#include <openssl/objects.h>
69#include <openssl/x509.h> 67#include <openssl/x509.h>
68
70#ifndef OPENSSL_NO_RSA 69#ifndef OPENSSL_NO_RSA
71#include <openssl/rsa.h> 70#include <openssl/rsa.h>
72#endif 71#endif
72
73#include "evp_locl.h" 73#include "evp_locl.h"
74 74
75static int 75static int
diff --git a/src/lib/libcrypto/evp/m_sha1.c b/src/lib/libcrypto/evp/m_sha1.c
index 0441f632d3..13d5b030d2 100644
--- a/src/lib/libcrypto/evp/m_sha1.c
+++ b/src/lib/libcrypto/evp/m_sha1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_sha1.c,v 1.16 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_sha1.c,v 1.17 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,18 +60,16 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_SHA 63#ifndef OPENSSL_NO_SHA
66 64
67#include <openssl/evp.h> 65#include <openssl/evp.h>
68#include <openssl/objects.h> 66#include <openssl/objects.h>
69#include <openssl/sha.h> 67#include <openssl/sha.h>
68
70#ifndef OPENSSL_NO_RSA 69#ifndef OPENSSL_NO_RSA
71#include <openssl/rsa.h> 70#include <openssl/rsa.h>
72#endif 71#endif
73 72
74
75static int 73static int
76init(EVP_MD_CTX *ctx) 74init(EVP_MD_CTX *ctx)
77{ 75{
diff --git a/src/lib/libcrypto/evp/m_sigver.c b/src/lib/libcrypto/evp/m_sigver.c
index 00c9b00732..cc0927325b 100644
--- a/src/lib/libcrypto/evp/m_sigver.c
+++ b/src/lib/libcrypto/evp/m_sigver.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: m_sigver.c,v 1.3 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: m_sigver.c,v 1.4 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -57,10 +57,12 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/err.h>
61#include <openssl/evp.h> 62#include <openssl/evp.h>
62#include <openssl/objects.h> 63#include <openssl/objects.h>
63#include <openssl/x509.h> 64#include <openssl/x509.h>
65
64#include "evp_locl.h" 66#include "evp_locl.h"
65 67
66static int 68static int
diff --git a/src/lib/libcrypto/evp/m_wp.c b/src/lib/libcrypto/evp/m_wp.c
index c6b246a3c5..5a391f514e 100644
--- a/src/lib/libcrypto/evp/m_wp.c
+++ b/src/lib/libcrypto/evp/m_wp.c
@@ -1,17 +1,16 @@
1/* $OpenBSD: m_wp.c,v 1.6 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: m_wp.c,v 1.7 2014/07/11 08:44:48 jsing Exp $ */
2 2
3#include <stdio.h> 3#include <stdio.h>
4 4
5#include <openssl/opensslconf.h> 5#include <openssl/opensslconf.h>
6 6
7#include "cryptlib.h"
8
9#ifndef OPENSSL_NO_WHIRLPOOL 7#ifndef OPENSSL_NO_WHIRLPOOL
10 8
11#include <openssl/evp.h> 9#include <openssl/evp.h>
12#include <openssl/objects.h> 10#include <openssl/objects.h>
13#include <openssl/x509.h> 11#include <openssl/x509.h>
14#include <openssl/whrlpool.h> 12#include <openssl/whrlpool.h>
13
15#include "evp_locl.h" 14#include "evp_locl.h"
16 15
17static int 16static int
diff --git a/src/lib/libcrypto/evp/names.c b/src/lib/libcrypto/evp/names.c
index fe185bc550..33d7dc8084 100644
--- a/src/lib/libcrypto/evp/names.c
+++ b/src/lib/libcrypto/evp/names.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: names.c,v 1.11 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: names.c,v 1.12 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -57,7 +57,7 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/evp.h> 61#include <openssl/evp.h>
62#include <openssl/objects.h> 62#include <openssl/objects.h>
63#include <openssl/x509.h> 63#include <openssl/x509.h>
diff --git a/src/lib/libcrypto/evp/p5_crpt.c b/src/lib/libcrypto/evp/p5_crpt.c
index 1fe6edb143..ec8d816f32 100644
--- a/src/lib/libcrypto/evp/p5_crpt.c
+++ b/src/lib/libcrypto/evp/p5_crpt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p5_crpt.c,v 1.12 2014/07/10 13:58:22 jsing Exp $ */ 1/* $OpenBSD: p5_crpt.c,v 1.13 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -60,9 +60,9 @@
60#include <stdlib.h> 60#include <stdlib.h>
61#include <string.h> 61#include <string.h>
62 62
63#include "cryptlib.h" 63#include <openssl/err.h>
64#include <openssl/x509.h>
65#include <openssl/evp.h> 64#include <openssl/evp.h>
65#include <openssl/x509.h>
66 66
67/* Doesn't do anything now: Builtin PBE algorithms in static table. 67/* Doesn't do anything now: Builtin PBE algorithms in static table.
68 */ 68 */
diff --git a/src/lib/libcrypto/evp/p5_crpt2.c b/src/lib/libcrypto/evp/p5_crpt2.c
index c072376912..61eadec804 100644
--- a/src/lib/libcrypto/evp/p5_crpt2.c
+++ b/src/lib/libcrypto/evp/p5_crpt2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p5_crpt2.c,v 1.16 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p5_crpt2.c,v 1.17 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -62,11 +62,13 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65#include "cryptlib.h"
66#if !defined(OPENSSL_NO_HMAC) && !defined(OPENSSL_NO_SHA) 65#if !defined(OPENSSL_NO_HMAC) && !defined(OPENSSL_NO_SHA)
67#include <openssl/x509.h> 66
67#include <openssl/err.h>
68#include <openssl/evp.h> 68#include <openssl/evp.h>
69#include <openssl/hmac.h> 69#include <openssl/hmac.h>
70#include <openssl/x509.h>
71
70#include "evp_locl.h" 72#include "evp_locl.h"
71 73
72/* set this to print out info about the keygen algorithm */ 74/* set this to print out info about the keygen algorithm */
diff --git a/src/lib/libcrypto/evp/p_dec.c b/src/lib/libcrypto/evp/p_dec.c
index c47408dff0..bb4e03091e 100644
--- a/src/lib/libcrypto/evp/p_dec.c
+++ b/src/lib/libcrypto/evp/p_dec.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_dec.c,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p_dec.c,v 1.9 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,14 +60,15 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h" 63#include <openssl/evp.h>
64#include <openssl/err.h>
65#include <openssl/objects.h>
64#include <openssl/rand.h> 66#include <openssl/rand.h>
67#include <openssl/x509.h>
68
65#ifndef OPENSSL_NO_RSA 69#ifndef OPENSSL_NO_RSA
66#include <openssl/rsa.h> 70#include <openssl/rsa.h>
67#endif 71#endif
68#include <openssl/evp.h>
69#include <openssl/objects.h>
70#include <openssl/x509.h>
71 72
72int 73int
73EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek, int ekl, 74EVP_PKEY_decrypt_old(unsigned char *key, const unsigned char *ek, int ekl,
diff --git a/src/lib/libcrypto/evp/p_enc.c b/src/lib/libcrypto/evp/p_enc.c
index a1fb9d1d2c..9421646cd3 100644
--- a/src/lib/libcrypto/evp/p_enc.c
+++ b/src/lib/libcrypto/evp/p_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_enc.c,v 1.8 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p_enc.c,v 1.9 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,14 +60,15 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h" 63#include <openssl/err.h>
64#include <openssl/evp.h>
65#include <openssl/objects.h>
64#include <openssl/rand.h> 66#include <openssl/rand.h>
67#include <openssl/x509.h>
68
65#ifndef OPENSSL_NO_RSA 69#ifndef OPENSSL_NO_RSA
66#include <openssl/rsa.h> 70#include <openssl/rsa.h>
67#endif 71#endif
68#include <openssl/evp.h>
69#include <openssl/objects.h>
70#include <openssl/x509.h>
71 72
72int 73int
73EVP_PKEY_encrypt_old(unsigned char *ek, const unsigned char *key, int key_len, 74EVP_PKEY_encrypt_old(unsigned char *ek, const unsigned char *key, int key_len,
diff --git a/src/lib/libcrypto/evp/p_lib.c b/src/lib/libcrypto/evp/p_lib.c
index 6db5e95cd0..617d0f8ec3 100644
--- a/src/lib/libcrypto/evp/p_lib.c
+++ b/src/lib/libcrypto/evp/p_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_lib.c,v 1.14 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p_lib.c,v 1.15 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,21 +60,21 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h" 63#include <openssl/asn1_mac.h>
64#include <openssl/bn.h> 64#include <openssl/bn.h>
65#include <openssl/err.h> 65#include <openssl/err.h>
66#include <openssl/objects.h>
67#include <openssl/evp.h> 66#include <openssl/evp.h>
68#include <openssl/asn1_mac.h> 67#include <openssl/objects.h>
69#include <openssl/x509.h> 68#include <openssl/x509.h>
70#ifndef OPENSSL_NO_RSA 69
71#include <openssl/rsa.h> 70#ifndef OPENSSL_NO_DH
71#include <openssl/dh.h>
72#endif 72#endif
73#ifndef OPENSSL_NO_DSA 73#ifndef OPENSSL_NO_DSA
74#include <openssl/dsa.h> 74#include <openssl/dsa.h>
75#endif 75#endif
76#ifndef OPENSSL_NO_DH 76#ifndef OPENSSL_NO_RSA
77#include <openssl/dh.h> 77#include <openssl/rsa.h>
78#endif 78#endif
79 79
80#ifndef OPENSSL_NO_ENGINE 80#ifndef OPENSSL_NO_ENGINE
diff --git a/src/lib/libcrypto/evp/p_open.c b/src/lib/libcrypto/evp/p_open.c
index aec4d9f3d0..aca83e74f6 100644
--- a/src/lib/libcrypto/evp/p_open.c
+++ b/src/lib/libcrypto/evp/p_open.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_open.c,v 1.15 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p_open.c,v 1.16 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,14 +60,13 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h"
64
65#ifndef OPENSSL_NO_RSA 63#ifndef OPENSSL_NO_RSA
66 64
65#include <openssl/err.h>
67#include <openssl/evp.h> 66#include <openssl/evp.h>
68#include <openssl/objects.h> 67#include <openssl/objects.h>
69#include <openssl/x509.h>
70#include <openssl/rsa.h> 68#include <openssl/rsa.h>
69#include <openssl/x509.h>
71 70
72int 71int
73EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, 72EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type,
diff --git a/src/lib/libcrypto/evp/p_seal.c b/src/lib/libcrypto/evp/p_seal.c
index 4acb9f8054..4f8417ae64 100644
--- a/src/lib/libcrypto/evp/p_seal.c
+++ b/src/lib/libcrypto/evp/p_seal.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_seal.c,v 1.12 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: p_seal.c,v 1.13 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -60,14 +60,14 @@
60 60
61#include <openssl/opensslconf.h> 61#include <openssl/opensslconf.h>
62 62
63#include "cryptlib.h" 63#include <openssl/evp.h>
64#include <openssl/objects.h>
64#include <openssl/rand.h> 65#include <openssl/rand.h>
66#include <openssl/x509.h>
67
65#ifndef OPENSSL_NO_RSA 68#ifndef OPENSSL_NO_RSA
66#include <openssl/rsa.h> 69#include <openssl/rsa.h>
67#endif 70#endif
68#include <openssl/evp.h>
69#include <openssl/objects.h>
70#include <openssl/x509.h>
71 71
72int 72int
73EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek, 73EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, unsigned char **ek,
diff --git a/src/lib/libcrypto/evp/p_sign.c b/src/lib/libcrypto/evp/p_sign.c
index 34fdf147c6..f68a950c9c 100644
--- a/src/lib/libcrypto/evp/p_sign.c
+++ b/src/lib/libcrypto/evp/p_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_sign.c,v 1.11 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: p_sign.c,v 1.12 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -57,7 +57,8 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/err.h>
61#include <openssl/evp.h> 62#include <openssl/evp.h>
62#include <openssl/objects.h> 63#include <openssl/objects.h>
63#include <openssl/x509.h> 64#include <openssl/x509.h>
diff --git a/src/lib/libcrypto/evp/p_verify.c b/src/lib/libcrypto/evp/p_verify.c
index a9a52e85d3..e653fcf6a5 100644
--- a/src/lib/libcrypto/evp/p_verify.c
+++ b/src/lib/libcrypto/evp/p_verify.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: p_verify.c,v 1.11 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: p_verify.c,v 1.12 2014/07/11 08:44:48 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -57,7 +57,8 @@
57 */ 57 */
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include "cryptlib.h" 60
61#include <openssl/err.h>
61#include <openssl/evp.h> 62#include <openssl/evp.h>
62#include <openssl/objects.h> 63#include <openssl/objects.h>
63#include <openssl/x509.h> 64#include <openssl/x509.h>
diff --git a/src/lib/libcrypto/evp/pmeth_fn.c b/src/lib/libcrypto/evp/pmeth_fn.c
index 0af978b6e2..c4a53b0d5f 100644
--- a/src/lib/libcrypto/evp/pmeth_fn.c
+++ b/src/lib/libcrypto/evp/pmeth_fn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pmeth_fn.c,v 1.3 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: pmeth_fn.c,v 1.4 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -58,9 +58,11 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <stdlib.h> 60#include <stdlib.h>
61#include "cryptlib.h" 61
62#include <openssl/objects.h> 62#include <openssl/err.h>
63#include <openssl/evp.h> 63#include <openssl/evp.h>
64#include <openssl/objects.h>
65
64#include "evp_locl.h" 66#include "evp_locl.h"
65 67
66#define M_check_autoarg(ctx, arg, arglen, err) \ 68#define M_check_autoarg(ctx, arg, arglen, err) \
diff --git a/src/lib/libcrypto/evp/pmeth_gn.c b/src/lib/libcrypto/evp/pmeth_gn.c
index 173df68a28..9eb10d4874 100644
--- a/src/lib/libcrypto/evp/pmeth_gn.c
+++ b/src/lib/libcrypto/evp/pmeth_gn.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pmeth_gn.c,v 1.3 2014/06/12 15:49:29 deraadt Exp $ */ 1/* $OpenBSD: pmeth_gn.c,v 1.4 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -58,10 +58,12 @@
58 58
59#include <stdio.h> 59#include <stdio.h>
60#include <stdlib.h> 60#include <stdlib.h>
61#include "cryptlib.h" 61
62#include <openssl/objects.h>
63#include <openssl/evp.h>
64#include <openssl/bn.h> 62#include <openssl/bn.h>
63#include <openssl/err.h>
64#include <openssl/evp.h>
65#include <openssl/objects.h>
66
65#include "evp_locl.h" 67#include "evp_locl.h"
66 68
67int 69int
diff --git a/src/lib/libcrypto/evp/pmeth_lib.c b/src/lib/libcrypto/evp/pmeth_lib.c
index f23524b8a9..c9c3444a13 100644
--- a/src/lib/libcrypto/evp/pmeth_lib.c
+++ b/src/lib/libcrypto/evp/pmeth_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: pmeth_lib.c,v 1.7 2014/07/10 22:45:57 jsing Exp $ */ 1/* $OpenBSD: pmeth_lib.c,v 1.8 2014/07/11 08:44:48 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -62,12 +62,13 @@
62 62
63#include <openssl/opensslconf.h> 63#include <openssl/opensslconf.h>
64 64
65#include "cryptlib.h"
66#include <openssl/objects.h>
67#include <openssl/evp.h> 65#include <openssl/evp.h>
66#include <openssl/objects.h>
67
68#ifndef OPENSSL_NO_ENGINE 68#ifndef OPENSSL_NO_ENGINE
69#include <openssl/engine.h> 69#include <openssl/engine.h>
70#endif 70#endif
71
71#include "asn1_locl.h" 72#include "asn1_locl.h"
72#include "evp_locl.h" 73#include "evp_locl.h"
73 74