Experimental symbol renaming to avoid clashes with regular OpenSSL.
authorDr. Stephen Henson <steve@openssl.org>
Wed, 16 Feb 2011 14:40:06 +0000 (14:40 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 16 Feb 2011 14:40:06 +0000 (14:40 +0000)
Make sure crypto.h is included first in any affected files.

28 files changed:
crypto/aes/aes_cbc.c
crypto/aes/aes_cfb.c
crypto/aes/aes_core.c
crypto/aes/aes_ecb.c
crypto/aes/aes_ofb.c
crypto/aes/aes_x86core.c
crypto/bn/bn_asm.c
crypto/crypto.h
crypto/des/cfb64ede.c
crypto/des/cfb64enc.c
crypto/des/cfb_enc.c
crypto/des/des_enc.c
crypto/des/ecb3_enc.c
crypto/des/ecb_enc.c
crypto/des/fcrypt.c
crypto/des/fcrypt_b.c
crypto/des/ofb64ede.c
crypto/des/set_key.c
crypto/des/str2key.c
crypto/modes/cbc128.c
crypto/modes/cfb128.c
crypto/modes/ctr128.c
crypto/modes/ofb128.c
crypto/rand/md_rand.c
crypto/rand/rand_egd.c
crypto/sha/sha1_one.c
crypto/sha/sha1dgst.c
crypto/sha/sha_dgst.c

index 227f75625dba917eda4823f6533ff6c41abd437b..87545c34dacc9fe3895d138b4b1ac539a38a5cbb 100644 (file)
@@ -49,6 +49,7 @@
  *
  */
 
  *
  */
 
+#include <openssl/crypto.h>
 #include <openssl/aes.h>
 #include <openssl/modes.h>
 
 #include <openssl/aes.h>
 #include <openssl/modes.h>
 
index 0c6d058ce729d975a2037a7f5da839ada8853089..7f19555603c3db3206effc8187bec0fdd74a2e50 100644 (file)
@@ -49,6 +49,7 @@
  *
  */
 
  *
  */
 
+#include <openssl/crypto.h>
 #include <openssl/aes.h>
 #include <openssl/modes.h>
 
 #include <openssl/aes.h>
 #include <openssl/modes.h>
 
index a7ec54f4dade256fd6744e8d84bf0c7ca481119e..ba909528295d648584403991a086fbb2bd519496 100644 (file)
@@ -36,6 +36,7 @@
 #include <assert.h>
 
 #include <stdlib.h>
 #include <assert.h>
 
 #include <stdlib.h>
+#include <openssl/crypto.h>
 #include <openssl/aes.h>
 #include "aes_locl.h"
 
 #include <openssl/aes.h>
 #include "aes_locl.h"
 
index 28aa561c2d89a216c3a5f98693f681da90aaa5bd..f342bbdf876dc0c9a6d4656deabd6846c0b85e9b 100644 (file)
@@ -56,6 +56,7 @@
 #endif
 #include <assert.h>
 
 #endif
 #include <assert.h>
 
+#include <openssl/crypto.h>
 #include <openssl/aes.h>
 #include "aes_locl.h"
 
 #include <openssl/aes.h>
 #include "aes_locl.h"
 
index 50bf0b83250478e8759f523b652cdbb86828abe6..7a87608a6802c075f825719ff48df66fb0156565 100644 (file)
@@ -49,6 +49,7 @@
  *
  */
 
  *
  */
 
+#include <openssl/crypto.h>
 #include <openssl/aes.h>
 #include <openssl/modes.h>
 
 #include <openssl/aes.h>
 #include <openssl/modes.h>
 
index d323e265c05ad8c3ec8030db58f8ef780ba038f6..c1c94d7a3e25d8f9290f8b3bbfcdb575cf593eb1 100644 (file)
@@ -43,6 +43,7 @@
 #include <assert.h>
 
 #include <stdlib.h>
 #include <assert.h>
 
 #include <stdlib.h>
+#include <crypto/aes.h>
 #include <openssl/aes.h>
 #include "aes_locl.h"
 
 #include <openssl/aes.h>
 #include "aes_locl.h"
 
index c43c91cc09f485fa615eddc61ddb81d20e792bf4..7b1280ae61456f7ccd1bdce22d5431a4e24bd840 100644 (file)
@@ -63,6 +63,7 @@
 
 #include <stdio.h>
 #include <assert.h>
 
 #include <stdio.h>
 #include <assert.h>
+#include <openssl/crypto.h>
 #include "cryptlib.h"
 #include "bn_lcl.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)
 
 
 #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
 #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) */
 
 /* 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? */
 #else /* !BN_MUL_COMBA */
 
 /* hmm... is it faster just to do a multiply? */
+#ifndef OPENSSL_FIPSCANISTER
 #undef bn_sqr_comba4
 #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);
        }
 
 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];
 void bn_sqr_comba8(BN_ULONG *r, const BN_ULONG *a)
        {
        BN_ULONG t[16];
index 938c2bc1442ad2e68f74f0783ed0ed5887b5392a..443486d70e3adfccf596a8e1a89d9f4499609b7f 100644 (file)
    one way or another */
 #include <openssl/symhacks.h>
 
    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
 #ifdef  __cplusplus
 extern "C" {
 #endif
index de34ecceb96de793fe0273cb95fdce7b6b092a29..40da95888c25e1ce87cb6c6a1a18cc7558781be2 100644 (file)
@@ -56,6 +56,7 @@
  * [including the GNU Public Licence.]
  */
 
  * [including the GNU Public Licence.]
  */
 
+#include <openssl/crypto.h>
 #include "des_locl.h"
 #include "e_os.h"
 
 #include "des_locl.h"
 #include "e_os.h"
 
index 5ec8683e402b5fafe9118b828a4ebc73d8750fde..45fa5189369e4cb49c5e983051a12eb7d43934fb 100644 (file)
@@ -56,6 +56,7 @@
  * [including the GNU Public Licence.]
  */
 
  * [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
 #include "des_locl.h"
 
 /* The input and output encrypted as though 64bit cfb mode is being
index 720f29a28e625a3b11623099e3405828d1dbc4e9..d8c195e1d6bfd5b6ec8185dde7d00f2a7e1de833 100644 (file)
@@ -57,6 +57,7 @@
  */
 
 #include "e_os.h"
  */
 
 #include "e_os.h"
+#include <openssl/crypto.h>
 #include "des_locl.h"
 #include <assert.h>
 
 #include "des_locl.h"
 #include <assert.h>
 
index 828feba208af3ff066173f4b42919eccc29e4618..efe35aa3c589070ffc02db2798505fb220710edd 100644 (file)
@@ -56,6 +56,7 @@
  * [including the GNU Public Licence.]
  */
 
  * [including the GNU Public Licence.]
  */
 
+#include <openssl/crypto.h>
 #include "des_locl.h"
 #include "spr.h"
 
 #include "des_locl.h"
 #include "spr.h"
 
index c3437bc60621e12888079e505127e19adac7f050..420c5d13f4db92f32b4b8deea7860cec1e070087 100644 (file)
@@ -56,6 +56,7 @@
  * [including the GNU Public Licence.]
  */
 
  * [including the GNU Public Licence.]
  */
 
+#include <openssl/crypto.h>
 #include "des_locl.h"
 
 void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
 #include "des_locl.h"
 
 void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output,
index 0684e769b3e0892db41e1e8b716861721e296e6c..de4ede1a7b9c43a068a8373dae2c645f42173abf 100644 (file)
@@ -56,6 +56,7 @@
  * [including the GNU Public Licence.]
  */
 
  * [including the GNU Public Licence.]
  */
 
+#include <openssl/crypto.h>
 #include "des_locl.h"
 #include "des_ver.h"
 #include <openssl/opensslv.h>
 #include "des_locl.h"
 #include "des_ver.h"
 #include <openssl/opensslv.h>
index ccbdff250f70eba8ed06ea453f0114d8f5232388..04f95fa5b0350cee451be290af71b04b93dbd078 100644 (file)
@@ -9,6 +9,8 @@
 #include <openssl/ebcdic.h>
 #endif
 
 #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)
 /* This version of crypt has been developed from my MIT compatible
  * DES library.
  * Eric Young (eay@cryptsoft.com)
index 8822816938ddddfc2cdf6f2f341959f0e55978c8..18d7ffc18c25c289083f853bc150a41e22dc2130 100644 (file)
@@ -57,6 +57,7 @@
  */
 
 #include <stdio.h>
  */
 
 #include <stdio.h>
+#include <openssl/crypto.h>
 
 /* This version of crypt has been developed from my MIT compatible
  * DES library.
 
 /* This version of crypt has been developed from my MIT compatible
  * DES library.
index 26bbf9a6a73343622c1407a65a4e8d09e25e3dd1..089407b69fc07a9a45d9f43a5f0552a257fe10de 100644 (file)
@@ -56,6 +56,7 @@
  * [including the GNU Public Licence.]
  */
 
  * [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
 #include "des_locl.h"
 
 /* The input and output encrypted as though 64bit ofb mode is being
index 3004cc3ab3cf3eb602a9da69b7966b68563b0786..ce4faf232217c9b9d4fdfdd28aaa7cdfa46a3941 100644 (file)
@@ -63,6 +63,7 @@
  * 1.1 added norm_expand_bits
  * 1.0 First working version
  */
  * 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 */
 #include "des_locl.h"
 
 OPENSSL_IMPLEMENT_GLOBAL(int,DES_check_key,0)  /* defaults to false */
index 9c2054bda6b9da92351d3d1a37dac671dcf0c25b..1077f99d1b27d51eb5693f40b94fae169f650e1b 100644 (file)
@@ -56,8 +56,8 @@
  * [including the GNU Public Licence.]
  */
 
  * [including the GNU Public Licence.]
  */
 
-#include "des_locl.h"
 #include <openssl/crypto.h>
 #include <openssl/crypto.h>
+#include "des_locl.h"
 
 void DES_string_to_key(const char *str, DES_cblock *key)
        {
 
 void DES_string_to_key(const char *str, DES_cblock *key)
        {
index dbf5b45a21c7a9ca88f1b36498990a7cd13c682d..3d3782cbe1181b3ac7f9559208f0e4bb48d9eadf 100644 (file)
@@ -48,6 +48,7 @@
  *
  */
 
  *
  */
 
+#include <openssl/crypto.h>
 #include "modes_lcl.h"
 #include <string.h>
 
 #include "modes_lcl.h"
 #include <string.h>
 
index b76514b9b5a6a2dbf336129174c5ebf08a8d373e..4e6f5d35e13ba2925f9556983f618a9d0e57a620 100644 (file)
@@ -48,6 +48,7 @@
  *
  */
 
  *
  */
 
+#include <openssl/crypto.h>
 #include "modes_lcl.h"
 #include <string.h>
 
 #include "modes_lcl.h"
 #include <string.h>
 
index 087b1b686630ed4860dc2cee93c5bcfb967107f4..ee642c5863cd38fe21ddef6b4727c2e3047656d3 100644 (file)
@@ -48,6 +48,7 @@
  *
  */
 
  *
  */
 
+#include <openssl/crypto.h>
 #include "modes_lcl.h"
 #include <string.h>
 
 #include "modes_lcl.h"
 #include <string.h>
 
index 4b5b4ec64856bb5a01325d5dcbda9c029833132f..01c01702c4f963175ef7db7a4096df29787067c9 100644 (file)
@@ -48,6 +48,7 @@
  *
  */
 
  *
  */
 
+#include <openssl/crypto.h>
 #include "modes_lcl.h"
 #include <string.h>
 
 #include "modes_lcl.h"
 #include <string.h>
 
index b17ad5203d80f994baa060dbff85de8d9c090a10..f9583324e9bdd8da8e063acfbef6ec8f29ebf979 100644 (file)
 
 #include "e_os.h"
 
 
 #include "e_os.h"
 
+#include <openssl/crypto.h>
 #include <openssl/rand.h>
 #include "rand_lcl.h"
 
 #include <openssl/rand.h>
 #include "rand_lcl.h"
 
-#include <openssl/crypto.h>
 #include <openssl/err.h>
 
 #ifdef OPENSSL_FIPS
 #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);
 
 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,
        ssleay_rand_seed,
        ssleay_rand_nopseudo_bytes,
        ssleay_rand_cleanup,
index d53b916ebee87c7ae77700c2fb5464920ae12cc1..9674219769e1f1c7228adc92acfce1fc491d776f 100644 (file)
@@ -54,6 +54,7 @@
  *
  */
 
  *
  */
 
+#include <openssl/crypto.h>
 #include <openssl/e_os2.h>
 #include <openssl/rand.h>
 #include <openssl/buffer.h>
 #include <openssl/e_os2.h>
 #include <openssl/rand.h>
 #include <openssl/buffer.h>
index 7c65b60276cdb85115fa7447dbb00ce28cda90cf..c56ec94020e180600f534e68c3402839ca330a79 100644 (file)
@@ -58,8 +58,8 @@
 
 #include <stdio.h>
 #include <string.h>
 
 #include <stdio.h>
 #include <string.h>
-#include <openssl/sha.h>
 #include <openssl/crypto.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)
 
 #ifndef OPENSSL_NO_SHA1
 unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md)
index 50d1925cdeb261887d2926140e53fe9cbf4387bd..a98690225fdc1081d3a369b34c8ffadefa83cc96 100644 (file)
@@ -56,6 +56,7 @@
  * [including the GNU Public Licence.]
  */
 
  * [including the GNU Public Licence.]
  */
 
+#include <openssl/crypto.h>
 #include <openssl/opensslconf.h>
 #if !defined(OPENSSL_NO_SHA1) && !defined(OPENSSL_NO_SHA)
 
 #include <openssl/opensslconf.h>
 #if !defined(OPENSSL_NO_SHA1) && !defined(OPENSSL_NO_SHA)
 
index 70eb56032c38a4b4c3b792ab504413d14d546a55..fb63b17ff2c3baddd9637814b5a62825f2fff495 100644 (file)
@@ -56,6 +56,7 @@
  * [including the GNU Public Licence.]
  */
 
  * [including the GNU Public Licence.]
  */
 
+#include <openssl/crypto.h>
 #include <openssl/opensslconf.h>
 #if !defined(OPENSSL_NO_SHA0) && !defined(OPENSSL_NO_SHA)
 
 #include <openssl/opensslconf.h>
 #if !defined(OPENSSL_NO_SHA0) && !defined(OPENSSL_NO_SHA)