From: jsing Date: Thu, 22 May 2014 17:53:00 +0000 (+0000) Subject: Expand the OPENSSL_{GLOBAL,EXPORT,IMPORT,EXTERN} macros - this rids the X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=1d21c530edfb4524553d1ac24403f503f1d6b314;p=openbsd Expand the OPENSSL_{GLOBAL,EXPORT,IMPORT,EXTERN} macros - this rids the libssl tree from all uses of these defines. ok miod@ --- diff --git a/lib/libcrypto/cast/cast_s.h b/lib/libcrypto/cast/cast_s.h index c483fd5e43e..2a30514a591 100644 --- a/lib/libcrypto/cast/cast_s.h +++ b/lib/libcrypto/cast/cast_s.h @@ -55,7 +55,7 @@ * copied and put under another distribution licence * [including the GNU Public Licence.] */ -OPENSSL_GLOBAL const CAST_LONG CAST_S_table0[256]={ +const CAST_LONG CAST_S_table0[256]={ 0x30fb40d4,0x9fa0ff0b,0x6beccd2f,0x3f258c7a, 0x1e213f2f,0x9c004dd3,0x6003e540,0xcf9fc949, 0xbfd4af27,0x88bbbdb5,0xe2034090,0x98d09675, @@ -121,7 +121,7 @@ OPENSSL_GLOBAL const CAST_LONG CAST_S_table0[256]={ 0x1a69e783,0x02cc4843,0xa2f7c579,0x429ef47d, 0x427b169c,0x5ac9f049,0xdd8f0f00,0x5c8165bf, }; -OPENSSL_GLOBAL const CAST_LONG CAST_S_table1[256]={ +const CAST_LONG CAST_S_table1[256]={ 0x1f201094,0xef0ba75b,0x69e3cf7e,0x393f4380, 0xfe61cf7a,0xeec5207a,0x55889c94,0x72fc0651, 0xada7ef79,0x4e1d7235,0xd55a63ce,0xde0436ba, @@ -187,7 +187,7 @@ OPENSSL_GLOBAL const CAST_LONG CAST_S_table1[256]={ 0x43d79572,0x7e6dd07c,0x06dfdf1e,0x6c6cc4ef, 0x7160a539,0x73bfbe70,0x83877605,0x4523ecf1, }; -OPENSSL_GLOBAL const CAST_LONG CAST_S_table2[256]={ +const CAST_LONG CAST_S_table2[256]={ 0x8defc240,0x25fa5d9f,0xeb903dbf,0xe810c907, 0x47607fff,0x369fe44b,0x8c1fc644,0xaececa90, 0xbeb1f9bf,0xeefbcaea,0xe8cf1950,0x51df07ae, @@ -253,7 +253,7 @@ OPENSSL_GLOBAL const CAST_LONG CAST_S_table2[256]={ 0xf7baefd5,0x4142ed9c,0xa4315c11,0x83323ec5, 0xdfef4636,0xa133c501,0xe9d3531c,0xee353783, }; -OPENSSL_GLOBAL const CAST_LONG CAST_S_table3[256]={ +const CAST_LONG CAST_S_table3[256]={ 0x9db30420,0x1fb6e9de,0xa7be7bef,0xd273a298, 0x4a4f7bdb,0x64ad8c57,0x85510443,0xfa020ed1, 0x7e287aff,0xe60fb663,0x095f35a1,0x79ebf120, @@ -319,7 +319,7 @@ OPENSSL_GLOBAL const CAST_LONG CAST_S_table3[256]={ 0x7ae5290c,0x3cb9536b,0x851e20fe,0x9833557e, 0x13ecf0b0,0xd3ffb372,0x3f85c5c1,0x0aef7ed2, }; -OPENSSL_GLOBAL const CAST_LONG CAST_S_table4[256]={ +const CAST_LONG CAST_S_table4[256]={ 0x7ec90c04,0x2c6e74b9,0x9b0e66df,0xa6337911, 0xb86a7fff,0x1dd358f5,0x44dd9d44,0x1731167f, 0x08fbf1fa,0xe7f511cc,0xd2051b00,0x735aba00, @@ -385,7 +385,7 @@ OPENSSL_GLOBAL const CAST_LONG CAST_S_table4[256]={ 0xe822fe15,0x88570983,0x750e6249,0xda627e55, 0x5e76ffa8,0xb1534546,0x6d47de08,0xefe9e7d4, }; -OPENSSL_GLOBAL const CAST_LONG CAST_S_table5[256]={ +const CAST_LONG CAST_S_table5[256]={ 0xf6fa8f9d,0x2cac6ce1,0x4ca34867,0xe2337f7c, 0x95db08e7,0x016843b4,0xeced5cbc,0x325553ac, 0xbf9f0960,0xdfa1e2ed,0x83f0579d,0x63ed86b9, @@ -451,7 +451,7 @@ OPENSSL_GLOBAL const CAST_LONG CAST_S_table5[256]={ 0xa2d762cf,0x49c92f54,0x38b5f331,0x7128a454, 0x48392905,0xa65b1db8,0x851c97bd,0xd675cf2f, }; -OPENSSL_GLOBAL const CAST_LONG CAST_S_table6[256]={ +const CAST_LONG CAST_S_table6[256]={ 0x85e04019,0x332bf567,0x662dbfff,0xcfc65693, 0x2a8d7f6f,0xab9bc912,0xde6008a1,0x2028da1f, 0x0227bce7,0x4d642916,0x18fac300,0x50f18b82, @@ -517,7 +517,7 @@ OPENSSL_GLOBAL const CAST_LONG CAST_S_table6[256]={ 0x518f36b2,0x84b1d370,0x0fedce83,0x878ddada, 0xf2a279c7,0x94e01be8,0x90716f4b,0x954b8aa3, }; -OPENSSL_GLOBAL const CAST_LONG CAST_S_table7[256]={ +const CAST_LONG CAST_S_table7[256]={ 0xe216300d,0xbbddfffc,0xa7ebdabd,0x35648095, 0x7789f8b7,0xe6c1121b,0x0e241600,0x052ce8b5, 0x11a9cfb0,0xe5952f11,0xece7990a,0x9386d174, diff --git a/lib/libcrypto/des/des_ver.h b/lib/libcrypto/des/des_ver.h index b4a6ffdc39e..bd056ba23bd 100644 --- a/lib/libcrypto/des/des_ver.h +++ b/lib/libcrypto/des/des_ver.h @@ -56,11 +56,9 @@ * [including the GNU Public Licence.] */ -#include - /* The following macros make sure the names are different from libdes names */ #define DES_version OSSL_DES_version #define libdes_version OSSL_libdes_version -OPENSSL_EXTERN const char OSSL_DES_version[]; /* SSLeay version string */ -OPENSSL_EXTERN const char OSSL_libdes_version[]; /* old libdes version string */ +extern const char OSSL_DES_version[]; /* SSLeay version string */ +extern const char OSSL_libdes_version[]; /* old libdes version string */ diff --git a/lib/libcrypto/des/ecb_enc.c b/lib/libcrypto/des/ecb_enc.c index f357333b979..b07916758f3 100644 --- a/lib/libcrypto/des/ecb_enc.c +++ b/lib/libcrypto/des/ecb_enc.c @@ -61,8 +61,8 @@ #include #include -OPENSSL_GLOBAL const char libdes_version[]="libdes" OPENSSL_VERSION_PTEXT; -OPENSSL_GLOBAL const char DES_version[]="DES" OPENSSL_VERSION_PTEXT; +const char libdes_version[]="libdes" OPENSSL_VERSION_PTEXT; +const char DES_version[]="DES" OPENSSL_VERSION_PTEXT; const char *DES_options(void) { diff --git a/lib/libcrypto/des/spr.h b/lib/libcrypto/des/spr.h index b91936a5a53..98ec61eee7e 100644 --- a/lib/libcrypto/des/spr.h +++ b/lib/libcrypto/des/spr.h @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ -OPENSSL_GLOBAL const DES_LONG DES_SPtrans[8][64]={ +const DES_LONG DES_SPtrans[8][64]={ { /* nibble 0 */ 0x02080800L, 0x00080000L, 0x02000002L, 0x02080802L, diff --git a/lib/libcrypto/engine/eng_padlock.c b/lib/libcrypto/engine/eng_padlock.c index 5a80b2b16da..e727067f11c 100644 --- a/lib/libcrypto/engine/eng_padlock.c +++ b/lib/libcrypto/engine/eng_padlock.c @@ -1088,9 +1088,9 @@ static RAND_METHOD padlock_rand = { #else /* !COMPILE_HW_PADLOCK */ #ifndef OPENSSL_NO_DYNAMIC_ENGINE -OPENSSL_EXPORT +extern int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); -OPENSSL_EXPORT +extern int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { return 0; } IMPLEMENT_DYNAMIC_CHECK_FN() #endif diff --git a/lib/libcrypto/engine/engine.h b/lib/libcrypto/engine/engine.h index 096c271b614..5c2f7b05276 100644 --- a/lib/libcrypto/engine/engine.h +++ b/lib/libcrypto/engine/engine.h @@ -654,8 +654,8 @@ typedef struct st_dynamic_fns { * can be fully instantiated with IMPLEMENT_DYNAMIC_CHECK_FN(). */ typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version); #define IMPLEMENT_DYNAMIC_CHECK_FN() \ - OPENSSL_EXPORT unsigned long v_check(unsigned long v); \ - OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \ + extern unsigned long v_check(unsigned long v); \ + extern unsigned long v_check(unsigned long v) { \ if(v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \ return 0; } @@ -677,9 +677,9 @@ typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version); typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id, const dynamic_fns *fns); #define IMPLEMENT_DYNAMIC_BIND_FN(fn) \ - OPENSSL_EXPORT \ + extern \ int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \ - OPENSSL_EXPORT \ + extern \ int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \ if(ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \ if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \ diff --git a/lib/libcrypto/krb5/krb5_asn.h b/lib/libcrypto/krb5/krb5_asn.h index 41725d0dc44..1591c135400 100644 --- a/lib/libcrypto/krb5/krb5_asn.h +++ b/lib/libcrypto/krb5/krb5_asn.h @@ -227,7 +227,7 @@ DECLARE_STACK_OF(KRB5_AUTHENTBODY) ** DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) = ** type *d2i_##name(type **a, const unsigned char **in, long len); ** int i2d_##name(type *a, unsigned char **out); -** DECLARE_ASN1_ITEM(itname) = OPENSSL_EXTERN const ASN1_ITEM itname##_it +** DECLARE_ASN1_ITEM(itname) = extern const ASN1_ITEM itname##_it */ DECLARE_ASN1_FUNCTIONS(KRB5_ENCDATA) diff --git a/lib/libssl/src/crypto/cast/cast_s.h b/lib/libssl/src/crypto/cast/cast_s.h index c483fd5e43e..2a30514a591 100644 --- a/lib/libssl/src/crypto/cast/cast_s.h +++ b/lib/libssl/src/crypto/cast/cast_s.h @@ -55,7 +55,7 @@ * copied and put under another distribution licence * [including the GNU Public Licence.] */ -OPENSSL_GLOBAL const CAST_LONG CAST_S_table0[256]={ +const CAST_LONG CAST_S_table0[256]={ 0x30fb40d4,0x9fa0ff0b,0x6beccd2f,0x3f258c7a, 0x1e213f2f,0x9c004dd3,0x6003e540,0xcf9fc949, 0xbfd4af27,0x88bbbdb5,0xe2034090,0x98d09675, @@ -121,7 +121,7 @@ OPENSSL_GLOBAL const CAST_LONG CAST_S_table0[256]={ 0x1a69e783,0x02cc4843,0xa2f7c579,0x429ef47d, 0x427b169c,0x5ac9f049,0xdd8f0f00,0x5c8165bf, }; -OPENSSL_GLOBAL const CAST_LONG CAST_S_table1[256]={ +const CAST_LONG CAST_S_table1[256]={ 0x1f201094,0xef0ba75b,0x69e3cf7e,0x393f4380, 0xfe61cf7a,0xeec5207a,0x55889c94,0x72fc0651, 0xada7ef79,0x4e1d7235,0xd55a63ce,0xde0436ba, @@ -187,7 +187,7 @@ OPENSSL_GLOBAL const CAST_LONG CAST_S_table1[256]={ 0x43d79572,0x7e6dd07c,0x06dfdf1e,0x6c6cc4ef, 0x7160a539,0x73bfbe70,0x83877605,0x4523ecf1, }; -OPENSSL_GLOBAL const CAST_LONG CAST_S_table2[256]={ +const CAST_LONG CAST_S_table2[256]={ 0x8defc240,0x25fa5d9f,0xeb903dbf,0xe810c907, 0x47607fff,0x369fe44b,0x8c1fc644,0xaececa90, 0xbeb1f9bf,0xeefbcaea,0xe8cf1950,0x51df07ae, @@ -253,7 +253,7 @@ OPENSSL_GLOBAL const CAST_LONG CAST_S_table2[256]={ 0xf7baefd5,0x4142ed9c,0xa4315c11,0x83323ec5, 0xdfef4636,0xa133c501,0xe9d3531c,0xee353783, }; -OPENSSL_GLOBAL const CAST_LONG CAST_S_table3[256]={ +const CAST_LONG CAST_S_table3[256]={ 0x9db30420,0x1fb6e9de,0xa7be7bef,0xd273a298, 0x4a4f7bdb,0x64ad8c57,0x85510443,0xfa020ed1, 0x7e287aff,0xe60fb663,0x095f35a1,0x79ebf120, @@ -319,7 +319,7 @@ OPENSSL_GLOBAL const CAST_LONG CAST_S_table3[256]={ 0x7ae5290c,0x3cb9536b,0x851e20fe,0x9833557e, 0x13ecf0b0,0xd3ffb372,0x3f85c5c1,0x0aef7ed2, }; -OPENSSL_GLOBAL const CAST_LONG CAST_S_table4[256]={ +const CAST_LONG CAST_S_table4[256]={ 0x7ec90c04,0x2c6e74b9,0x9b0e66df,0xa6337911, 0xb86a7fff,0x1dd358f5,0x44dd9d44,0x1731167f, 0x08fbf1fa,0xe7f511cc,0xd2051b00,0x735aba00, @@ -385,7 +385,7 @@ OPENSSL_GLOBAL const CAST_LONG CAST_S_table4[256]={ 0xe822fe15,0x88570983,0x750e6249,0xda627e55, 0x5e76ffa8,0xb1534546,0x6d47de08,0xefe9e7d4, }; -OPENSSL_GLOBAL const CAST_LONG CAST_S_table5[256]={ +const CAST_LONG CAST_S_table5[256]={ 0xf6fa8f9d,0x2cac6ce1,0x4ca34867,0xe2337f7c, 0x95db08e7,0x016843b4,0xeced5cbc,0x325553ac, 0xbf9f0960,0xdfa1e2ed,0x83f0579d,0x63ed86b9, @@ -451,7 +451,7 @@ OPENSSL_GLOBAL const CAST_LONG CAST_S_table5[256]={ 0xa2d762cf,0x49c92f54,0x38b5f331,0x7128a454, 0x48392905,0xa65b1db8,0x851c97bd,0xd675cf2f, }; -OPENSSL_GLOBAL const CAST_LONG CAST_S_table6[256]={ +const CAST_LONG CAST_S_table6[256]={ 0x85e04019,0x332bf567,0x662dbfff,0xcfc65693, 0x2a8d7f6f,0xab9bc912,0xde6008a1,0x2028da1f, 0x0227bce7,0x4d642916,0x18fac300,0x50f18b82, @@ -517,7 +517,7 @@ OPENSSL_GLOBAL const CAST_LONG CAST_S_table6[256]={ 0x518f36b2,0x84b1d370,0x0fedce83,0x878ddada, 0xf2a279c7,0x94e01be8,0x90716f4b,0x954b8aa3, }; -OPENSSL_GLOBAL const CAST_LONG CAST_S_table7[256]={ +const CAST_LONG CAST_S_table7[256]={ 0xe216300d,0xbbddfffc,0xa7ebdabd,0x35648095, 0x7789f8b7,0xe6c1121b,0x0e241600,0x052ce8b5, 0x11a9cfb0,0xe5952f11,0xece7990a,0x9386d174, diff --git a/lib/libssl/src/crypto/des/des_ver.h b/lib/libssl/src/crypto/des/des_ver.h index b4a6ffdc39e..bd056ba23bd 100644 --- a/lib/libssl/src/crypto/des/des_ver.h +++ b/lib/libssl/src/crypto/des/des_ver.h @@ -56,11 +56,9 @@ * [including the GNU Public Licence.] */ -#include - /* The following macros make sure the names are different from libdes names */ #define DES_version OSSL_DES_version #define libdes_version OSSL_libdes_version -OPENSSL_EXTERN const char OSSL_DES_version[]; /* SSLeay version string */ -OPENSSL_EXTERN const char OSSL_libdes_version[]; /* old libdes version string */ +extern const char OSSL_DES_version[]; /* SSLeay version string */ +extern const char OSSL_libdes_version[]; /* old libdes version string */ diff --git a/lib/libssl/src/crypto/des/ecb_enc.c b/lib/libssl/src/crypto/des/ecb_enc.c index f357333b979..b07916758f3 100644 --- a/lib/libssl/src/crypto/des/ecb_enc.c +++ b/lib/libssl/src/crypto/des/ecb_enc.c @@ -61,8 +61,8 @@ #include #include -OPENSSL_GLOBAL const char libdes_version[]="libdes" OPENSSL_VERSION_PTEXT; -OPENSSL_GLOBAL const char DES_version[]="DES" OPENSSL_VERSION_PTEXT; +const char libdes_version[]="libdes" OPENSSL_VERSION_PTEXT; +const char DES_version[]="DES" OPENSSL_VERSION_PTEXT; const char *DES_options(void) { diff --git a/lib/libssl/src/crypto/des/spr.h b/lib/libssl/src/crypto/des/spr.h index b91936a5a53..98ec61eee7e 100644 --- a/lib/libssl/src/crypto/des/spr.h +++ b/lib/libssl/src/crypto/des/spr.h @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ -OPENSSL_GLOBAL const DES_LONG DES_SPtrans[8][64]={ +const DES_LONG DES_SPtrans[8][64]={ { /* nibble 0 */ 0x02080800L, 0x00080000L, 0x02000002L, 0x02080802L, diff --git a/lib/libssl/src/crypto/engine/eng_padlock.c b/lib/libssl/src/crypto/engine/eng_padlock.c index 5a80b2b16da..e727067f11c 100644 --- a/lib/libssl/src/crypto/engine/eng_padlock.c +++ b/lib/libssl/src/crypto/engine/eng_padlock.c @@ -1088,9 +1088,9 @@ static RAND_METHOD padlock_rand = { #else /* !COMPILE_HW_PADLOCK */ #ifndef OPENSSL_NO_DYNAMIC_ENGINE -OPENSSL_EXPORT +extern int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); -OPENSSL_EXPORT +extern int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { return 0; } IMPLEMENT_DYNAMIC_CHECK_FN() #endif diff --git a/lib/libssl/src/crypto/engine/engine.h b/lib/libssl/src/crypto/engine/engine.h index 096c271b614..5c2f7b05276 100644 --- a/lib/libssl/src/crypto/engine/engine.h +++ b/lib/libssl/src/crypto/engine/engine.h @@ -654,8 +654,8 @@ typedef struct st_dynamic_fns { * can be fully instantiated with IMPLEMENT_DYNAMIC_CHECK_FN(). */ typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version); #define IMPLEMENT_DYNAMIC_CHECK_FN() \ - OPENSSL_EXPORT unsigned long v_check(unsigned long v); \ - OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \ + extern unsigned long v_check(unsigned long v); \ + extern unsigned long v_check(unsigned long v) { \ if(v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \ return 0; } @@ -677,9 +677,9 @@ typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version); typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id, const dynamic_fns *fns); #define IMPLEMENT_DYNAMIC_BIND_FN(fn) \ - OPENSSL_EXPORT \ + extern \ int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \ - OPENSSL_EXPORT \ + extern \ int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \ if(ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \ if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \ diff --git a/lib/libssl/src/crypto/krb5/krb5_asn.h b/lib/libssl/src/crypto/krb5/krb5_asn.h index 41725d0dc44..1591c135400 100644 --- a/lib/libssl/src/crypto/krb5/krb5_asn.h +++ b/lib/libssl/src/crypto/krb5/krb5_asn.h @@ -227,7 +227,7 @@ DECLARE_STACK_OF(KRB5_AUTHENTBODY) ** DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) = ** type *d2i_##name(type **a, const unsigned char **in, long len); ** int i2d_##name(type *a, unsigned char **out); -** DECLARE_ASN1_ITEM(itname) = OPENSSL_EXTERN const ASN1_ITEM itname##_it +** DECLARE_ASN1_ITEM(itname) = extern const ASN1_ITEM itname##_it */ DECLARE_ASN1_FUNCTIONS(KRB5_ENCDATA)