summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorsteve <steve>2011-02-16 14:40:03 +0000
committersteve <steve>2011-02-16 14:40:03 +0000
commit8cf0c51561248209905f0865fc09a5f8caf2c79a (patch)
treefee11c79e38487c25bc9675d19327d076fa026db /crypto
parentf342e1eaa0fae7cc73f5e6c38c2b812b03bf4f84 (diff)
downloadopenssl-8cf0c51561248209905f0865fc09a5f8caf2c79a.tar.gz
Experimental symbol renaming to avoid clashes with regular OpenSSL.
Make sure crypto.h is included first in any affected files.
Diffstat (limited to 'crypto')
-rw-r--r--crypto/aes/aes_cbc.c1
-rw-r--r--crypto/aes/aes_cfb.c1
-rw-r--r--crypto/aes/aes_core.c1
-rw-r--r--crypto/aes/aes_ecb.c1
-rw-r--r--crypto/aes/aes_ofb.c1
-rw-r--r--crypto/aes/aes_x86core.c1
-rw-r--r--crypto/bn/bn_asm.c7
-rw-r--r--crypto/crypto.h8
-rw-r--r--crypto/des/cfb64ede.c1
-rw-r--r--crypto/des/cfb64enc.c1
-rw-r--r--crypto/des/cfb_enc.c1
-rw-r--r--crypto/des/des_enc.c1
-rw-r--r--crypto/des/ecb3_enc.c1
-rw-r--r--crypto/des/ecb_enc.c1
-rw-r--r--crypto/des/fcrypt.c2
-rw-r--r--crypto/des/fcrypt_b.c1
-rw-r--r--crypto/des/ofb64ede.c1
-rw-r--r--crypto/des/set_key.c1
-rw-r--r--crypto/des/str2key.c2
-rw-r--r--crypto/modes/cbc128.c1
-rw-r--r--crypto/modes/cfb128.c1
-rw-r--r--crypto/modes/ctr128.c1
-rw-r--r--crypto/modes/ofb128.c1
-rw-r--r--crypto/rand/md_rand.c4
-rw-r--r--crypto/rand/rand_egd.c1
-rw-r--r--crypto/sha/sha1_one.c2
-rw-r--r--crypto/sha/sha1dgst.c1
-rw-r--r--crypto/sha/sha_dgst.c1
28 files changed, 42 insertions, 5 deletions
diff --git a/crypto/aes/aes_cbc.c b/crypto/aes/aes_cbc.c
index 227f75625..87545c34d 100644
--- a/crypto/aes/aes_cbc.c
+++ b/crypto/aes/aes_cbc.c
@@ -49,6 +49,7 @@
*
*/
+#include <openssl/crypto.h>
#include <openssl/aes.h>
#include <openssl/modes.h>
diff --git a/crypto/aes/aes_cfb.c b/crypto/aes/aes_cfb.c
index 0c6d058ce..7f1955560 100644
--- a/crypto/aes/aes_cfb.c
+++ b/crypto/aes/aes_cfb.c
@@ -49,6 +49,7 @@
*
*/
+#include <openssl/crypto.h>
#include <openssl/aes.h>
#include <openssl/modes.h>
diff --git a/crypto/aes/aes_core.c b/crypto/aes/aes_core.c
index a7ec54f4d..ba9095282 100644
--- a/crypto/aes/aes_core.c
+++ b/crypto/aes/aes_core.c
@@ -36,6 +36,7 @@
#include <assert.h>
#include <stdlib.h>
+#include <openssl/crypto.h>
#include <openssl/aes.h>
#include "aes_locl.h"
diff --git a/crypto/aes/aes_ecb.c b/crypto/aes/aes_ecb.c
index 28aa561c2..f342bbdf8 100644
--- a/crypto/aes/aes_ecb.c
+++ b/crypto/aes/aes_ecb.c
@@ -56,6 +56,7 @@
#endif
#include <assert.h>
+#include <openssl/crypto.h>
#include <openssl/aes.h>
#include "aes_locl.h"
diff --git a/crypto/aes/aes_ofb.c b/crypto/aes/aes_ofb.c
index 50bf0b832..7a87608a6 100644
--- a/crypto/aes/aes_ofb.c
+++ b/crypto/aes/aes_ofb.c
@@ -49,6 +49,7 @@
*
*/
+#include <openssl/crypto.h>
#include <openssl/aes.h>
#include <openssl/modes.h>
diff --git a/crypto/aes/aes_x86core.c b/crypto/aes/aes_x86core.c
index d323e265c..c1c94d7a3 100644
--- a/crypto/aes/aes_x86core.c
+++ b/crypto/aes/aes_x86core.c
@@ -43,6 +43,7 @@
#include <assert.h>
#include <stdlib.h>
+#include <crypto/aes.h>
#include <openssl/aes.h>
#include "aes_locl.h"
diff --git a/crypto/bn/bn_asm.c b/crypto/bn/bn_asm.c
index c43c91cc0..7b1280ae6 100644
--- a/crypto/bn/bn_asm.c
+++ b/crypto/bn/bn_asm.c
@@ -63,6 +63,7 @@
#include <stdio.h>
#include <assert.h>
+#include <openssl/crypto.h>
#include "cryptlib.h"
#include "bn_lcl.h"
@@ -428,10 +429,12 @@ BN_ULONG bn_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, int n)
#if defined(BN_MUL_COMBA) && !defined(OPENSSL_SMALL_FOOTPRINT)
+#ifndef OPENSSL_FIPSCANISTER
#undef bn_mul_comba8
#undef bn_mul_comba4
#undef bn_sqr_comba8
#undef bn_sqr_comba4
+#endif
/* mul_add_c(a,b,c0,c1,c2) -- c+=a*b for three word number c=(c2,c1,c0) */
/* mul_add_c2(a,b,c0,c1,c2) -- c+=2*a*b for three word number c=(c2,c1,c0) */
@@ -946,14 +949,16 @@ int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_U
#else /* !BN_MUL_COMBA */
/* hmm... is it faster just to do a multiply? */
+#ifndef OPENSSL_FIPSCANISTER
#undef bn_sqr_comba4
+#undef bn_sqr_comba8
+#endif
void bn_sqr_comba4(BN_ULONG *r, const BN_ULONG *a)
{
BN_ULONG t[8];
bn_sqr_normal(r,a,4,t);
}
-#undef bn_sqr_comba8
void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a)
{
BN_ULONG t[16];
diff --git a/crypto/crypto.h b/crypto/crypto.h
index 938c2bc14..443486d70 100644
--- a/crypto/crypto.h
+++ b/crypto/crypto.h
@@ -143,6 +143,14 @@
one way or another */
#include <openssl/symhacks.h>
+/* For FIPS mode rename all OpenSSL symbols to avoid clashes with a
+ * non-FIPS OpenSSL.
+ */
+
+#if defined(OPENSSL_FIPSCANISTER) && defined(OPENSSL_FIPSSYMS)
+#include <openssl/fipssyms.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/crypto/des/cfb64ede.c b/crypto/des/cfb64ede.c
index de34ecceb..40da95888 100644
--- a/crypto/des/cfb64ede.c
+++ b/crypto/des/cfb64ede.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#include <openssl/crypto.h>
#include "des_locl.h"
#include "e_os.h"
diff --git a/crypto/des/cfb64enc.c b/crypto/des/cfb64enc.c
index 5ec8683e4..45fa51893 100644
--- a/crypto/des/cfb64enc.c
+++ b/crypto/des/cfb64enc.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#include <openssl/crypto.h>
#include "des_locl.h"
/* The input and output encrypted as though 64bit cfb mode is being
diff --git a/crypto/des/cfb_enc.c b/crypto/des/cfb_enc.c
index 720f29a28..d8c195e1d 100644
--- a/crypto/des/cfb_enc.c
+++ b/crypto/des/cfb_enc.c
@@ -57,6 +57,7 @@
*/
#include "e_os.h"
+#include <openssl/crypto.h>
#include "des_locl.h"
#include <assert.h>
diff --git a/crypto/des/des_enc.c b/crypto/des/des_enc.c
index 828feba20..efe35aa3c 100644
--- a/crypto/des/des_enc.c
+++ b/crypto/des/des_enc.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#include <openssl/crypto.h>
#include "des_locl.h"
#include "spr.h"
diff --git a/crypto/des/ecb3_enc.c b/crypto/des/ecb3_enc.c
index c3437bc60..420c5d13f 100644
--- a/crypto/des/ecb3_enc.c
+++ b/crypto/des/ecb3_enc.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#include <openssl/crypto.h>
#include "des_locl.h"
void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
diff --git a/crypto/des/ecb_enc.c b/crypto/des/ecb_enc.c
index 0684e769b..de4ede1a7 100644
--- a/crypto/des/ecb_enc.c
+++ b/crypto/des/ecb_enc.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#include <openssl/crypto.h>
#include "des_locl.h"
#include "des_ver.h"
#include <openssl/opensslv.h>
diff --git a/crypto/des/fcrypt.c b/crypto/des/fcrypt.c
index ccbdff250..04f95fa5b 100644
--- a/crypto/des/fcrypt.c
+++ b/crypto/des/fcrypt.c
@@ -9,6 +9,8 @@
#include <openssl/ebcdic.h>
#endif
+#include <openssl/crypto.h>
+
/* This version of crypt has been developed from my MIT compatible
* DES library.
* Eric Young (eay@cryptsoft.com)
diff --git a/crypto/des/fcrypt_b.c b/crypto/des/fcrypt_b.c
index 882281693..18d7ffc18 100644
--- a/crypto/des/fcrypt_b.c
+++ b/crypto/des/fcrypt_b.c
@@ -57,6 +57,7 @@
*/
#include <stdio.h>
+#include <openssl/crypto.h>
/* This version of crypt has been developed from my MIT compatible
* DES library.
diff --git a/crypto/des/ofb64ede.c b/crypto/des/ofb64ede.c
index 26bbf9a6a..089407b69 100644
--- a/crypto/des/ofb64ede.c
+++ b/crypto/des/ofb64ede.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#include <openssl/crypto.h>
#include "des_locl.h"
/* The input and output encrypted as though 64bit ofb mode is being
diff --git a/crypto/des/set_key.c b/crypto/des/set_key.c
index 3004cc3ab..ce4faf232 100644
--- a/crypto/des/set_key.c
+++ b/crypto/des/set_key.c
@@ -63,6 +63,7 @@
* 1.1 added norm_expand_bits
* 1.0 First working version
*/
+#include <openssl/crypto.h>
#include "des_locl.h"
OPENSSL_IMPLEMENT_GLOBAL(int,DES_check_key,0) /* defaults to false */
diff --git a/crypto/des/str2key.c b/crypto/des/str2key.c
index 9c2054bda..1077f99d1 100644
--- a/crypto/des/str2key.c
+++ b/crypto/des/str2key.c
@@ -56,8 +56,8 @@
* [including the GNU Public Licence.]
*/
-#include "des_locl.h"
#include <openssl/crypto.h>
+#include "des_locl.h"
void DES_string_to_key(const char *str, DES_cblock *key)
{
diff --git a/crypto/modes/cbc128.c b/crypto/modes/cbc128.c
index dbf5b45a2..3d3782cbe 100644
--- a/crypto/modes/cbc128.c
+++ b/crypto/modes/cbc128.c
@@ -48,6 +48,7 @@
*
*/
+#include <openssl/crypto.h>
#include "modes_lcl.h"
#include <string.h>
diff --git a/crypto/modes/cfb128.c b/crypto/modes/cfb128.c
index b76514b9b..4e6f5d35e 100644
--- a/crypto/modes/cfb128.c
+++ b/crypto/modes/cfb128.c
@@ -48,6 +48,7 @@
*
*/
+#include <openssl/crypto.h>
#include "modes_lcl.h"
#include <string.h>
diff --git a/crypto/modes/ctr128.c b/crypto/modes/ctr128.c
index 087b1b686..ee642c586 100644
--- a/crypto/modes/ctr128.c
+++ b/crypto/modes/ctr128.c
@@ -48,6 +48,7 @@
*
*/
+#include <openssl/crypto.h>
#include "modes_lcl.h"
#include <string.h>
diff --git a/crypto/modes/ofb128.c b/crypto/modes/ofb128.c
index 4b5b4ec64..01c01702c 100644
--- a/crypto/modes/ofb128.c
+++ b/crypto/modes/ofb128.c
@@ -48,6 +48,7 @@
*
*/
+#include <openssl/crypto.h>
#include "modes_lcl.h"
#include <string.h>
diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c
index b17ad5203..f9583324e 100644
--- a/crypto/rand/md_rand.c
+++ b/crypto/rand/md_rand.c
@@ -123,10 +123,10 @@
#include "e_os.h"
+#include <openssl/crypto.h>
#include <openssl/rand.h>
#include "rand_lcl.h"
-#include <openssl/crypto.h>
#include <openssl/err.h>
#ifdef OPENSSL_FIPS
@@ -168,7 +168,7 @@ static int ssleay_rand_nopseudo_bytes(unsigned char *buf, int num);
static int ssleay_rand_pseudo_bytes(unsigned char *buf, int num);
static int ssleay_rand_status(void);
-RAND_METHOD rand_ssleay_meth={
+static RAND_METHOD rand_ssleay_meth={
ssleay_rand_seed,
ssleay_rand_nopseudo_bytes,
ssleay_rand_cleanup,
diff --git a/crypto/rand/rand_egd.c b/crypto/rand/rand_egd.c
index d53b916eb..967421976 100644
--- a/crypto/rand/rand_egd.c
+++ b/crypto/rand/rand_egd.c
@@ -54,6 +54,7 @@
*
*/
+#include <openssl/crypto.h>
#include <openssl/e_os2.h>
#include <openssl/rand.h>
#include <openssl/buffer.h>
diff --git a/crypto/sha/sha1_one.c b/crypto/sha/sha1_one.c
index 7c65b6027..c56ec9402 100644
--- a/crypto/sha/sha1_one.c
+++ b/crypto/sha/sha1_one.c
@@ -58,8 +58,8 @@
#include <stdio.h>
#include <string.h>
-#include <openssl/sha.h>
#include <openssl/crypto.h>
+#include <openssl/sha.h>
#ifndef OPENSSL_NO_SHA1
unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md)
diff --git a/crypto/sha/sha1dgst.c b/crypto/sha/sha1dgst.c
index 50d1925cd..a98690225 100644
--- a/crypto/sha/sha1dgst.c
+++ b/crypto/sha/sha1dgst.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#include <openssl/crypto.h>
#include <openssl/opensslconf.h>
#if !defined(OPENSSL_NO_SHA1) && !defined(OPENSSL_NO_SHA)
diff --git a/crypto/sha/sha_dgst.c b/crypto/sha/sha_dgst.c
index 70eb56032..fb63b17ff 100644
--- a/crypto/sha/sha_dgst.c
+++ b/crypto/sha/sha_dgst.c
@@ -56,6 +56,7 @@
* [including the GNU Public Licence.]
*/
+#include <openssl/crypto.h>
#include <openssl/opensslconf.h>
#if !defined(OPENSSL_NO_SHA0) && !defined(OPENSSL_NO_SHA)