From 7d96ec2c1208841efdc0bbc8622b39d6ee7099b9 Mon Sep 17 00:00:00 2001 From: jsing Date: Sat, 24 May 2014 13:11:01 +0000 Subject: [PATCH] Expand the OPENSSL_.*GLOBAL.* macros and stop including e_os2.h. ok miod@ beck@ --- lib/libcrypto/des/des.h | 11 +++++------ lib/libcrypto/des/enc_read.c | 2 +- lib/libcrypto/des/set_key.c | 2 +- lib/libssl/src/crypto/des/des.h | 11 +++++------ lib/libssl/src/crypto/des/enc_read.c | 2 +- lib/libssl/src/crypto/des/set_key.c | 2 +- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/lib/libcrypto/des/des.h b/lib/libcrypto/des/des.h index 19a9918766d..de99c73f435 100644 --- a/lib/libcrypto/des/des.h +++ b/lib/libcrypto/des/des.h @@ -61,8 +61,6 @@ #include -#include /* OPENSSL_DECLARE_GLOBAL, OPENSSL_GLOBAL_REF */ - #ifdef OPENSSL_NO_DES #error DES is disabled. #endif @@ -109,10 +107,11 @@ typedef struct DES_ks #define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) -OPENSSL_DECLARE_GLOBAL(int,DES_check_key); /* defaults to false */ -#define DES_check_key OPENSSL_GLOBAL_REF(DES_check_key) -OPENSSL_DECLARE_GLOBAL(int,DES_rw_mode); /* defaults to DES_PCBC_MODE */ -#define DES_rw_mode OPENSSL_GLOBAL_REF(DES_rw_mode) +extern int _shadow_DES_check_key; /* defaults to false */ +#define DES_check_key _shadow_DES_check_key + +extern int _shadow_DES_rw_mode; /* defaults to DES_PCBC_MODE */ +#define DES_rw_mode _shadow_DES_rw_mode const char *DES_options(void); void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output, diff --git a/lib/libcrypto/des/enc_read.c b/lib/libcrypto/des/enc_read.c index e1ac04c5b39..8e1ff8e3eb3 100644 --- a/lib/libcrypto/des/enc_read.c +++ b/lib/libcrypto/des/enc_read.c @@ -63,7 +63,7 @@ /* This has some uglies in it but it works - even over sockets. */ /*extern int errno;*/ -OPENSSL_IMPLEMENT_GLOBAL(int,DES_rw_mode,DES_PCBC_MODE) +int _shadow_DES_rw_mode = DES_PCBC_MODE; /* diff --git a/lib/libcrypto/des/set_key.c b/lib/libcrypto/des/set_key.c index e8dea50b962..85a0d2bfc1c 100644 --- a/lib/libcrypto/des/set_key.c +++ b/lib/libcrypto/des/set_key.c @@ -66,7 +66,7 @@ #include #include "des_locl.h" -OPENSSL_IMPLEMENT_GLOBAL(int,DES_check_key,0) /* defaults to false */ +int _shadow_DES_check_key = 0; /* defaults to false */ static const unsigned char odd_parity[256]={ 1, 1, 2, 2, 4, 4, 7, 7, 8, 8, 11, 11, 13, 13, 14, 14, diff --git a/lib/libssl/src/crypto/des/des.h b/lib/libssl/src/crypto/des/des.h index 19a9918766d..de99c73f435 100644 --- a/lib/libssl/src/crypto/des/des.h +++ b/lib/libssl/src/crypto/des/des.h @@ -61,8 +61,6 @@ #include -#include /* OPENSSL_DECLARE_GLOBAL, OPENSSL_GLOBAL_REF */ - #ifdef OPENSSL_NO_DES #error DES is disabled. #endif @@ -109,10 +107,11 @@ typedef struct DES_ks #define DES_ede2_ofb64_encrypt(i,o,l,k1,k2,iv,n) \ DES_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k1),(iv),(n)) -OPENSSL_DECLARE_GLOBAL(int,DES_check_key); /* defaults to false */ -#define DES_check_key OPENSSL_GLOBAL_REF(DES_check_key) -OPENSSL_DECLARE_GLOBAL(int,DES_rw_mode); /* defaults to DES_PCBC_MODE */ -#define DES_rw_mode OPENSSL_GLOBAL_REF(DES_rw_mode) +extern int _shadow_DES_check_key; /* defaults to false */ +#define DES_check_key _shadow_DES_check_key + +extern int _shadow_DES_rw_mode; /* defaults to DES_PCBC_MODE */ +#define DES_rw_mode _shadow_DES_rw_mode const char *DES_options(void); void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output, diff --git a/lib/libssl/src/crypto/des/enc_read.c b/lib/libssl/src/crypto/des/enc_read.c index e1ac04c5b39..8e1ff8e3eb3 100644 --- a/lib/libssl/src/crypto/des/enc_read.c +++ b/lib/libssl/src/crypto/des/enc_read.c @@ -63,7 +63,7 @@ /* This has some uglies in it but it works - even over sockets. */ /*extern int errno;*/ -OPENSSL_IMPLEMENT_GLOBAL(int,DES_rw_mode,DES_PCBC_MODE) +int _shadow_DES_rw_mode = DES_PCBC_MODE; /* diff --git a/lib/libssl/src/crypto/des/set_key.c b/lib/libssl/src/crypto/des/set_key.c index e8dea50b962..85a0d2bfc1c 100644 --- a/lib/libssl/src/crypto/des/set_key.c +++ b/lib/libssl/src/crypto/des/set_key.c @@ -66,7 +66,7 @@ #include #include "des_locl.h" -OPENSSL_IMPLEMENT_GLOBAL(int,DES_check_key,0) /* defaults to false */ +int _shadow_DES_check_key = 0; /* defaults to false */ static const unsigned char odd_parity[256]={ 1, 1, 2, 2, 4, 4, 7, 7, 8, 8, 11, 11, 13, 13, 14, 14, -- 2.20.1