From 5e68f8ce1535f7d34a8431a332f6343cf637d499 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Tue, 5 Feb 2002 06:02:58 +0000 Subject: [PATCH] Apply three patches from Assar Westerlund : This patch makes the macros in des_old.h actually pretend to be functions. There's no reason not to define _ossl_old_crypt when using PERL5/FreeBSD/darwin/Next, since it makes using crypt and including des.h break. Here's a trivial patch. This patch fixes some of the typos used in macro names in des_old.h and the number of arguments for some of them. --- crypto/des/des_old.c | 2 -- crypto/des/des_old.h | 32 ++++++++++++++++---------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/crypto/des/des_old.c b/crypto/des/des_old.c index a6582a965e..4219662214 100644 --- a/crypto/des/des_old.c +++ b/crypto/des/des_old.c @@ -193,12 +193,10 @@ char *_ossl_old_des_crypt(const char *buf,const char *salt) { return DES_crypt(buf, salt); } -#if !defined(PERL5) && !defined(__FreeBSD__) && !defined(NeXT) && !defined(_DARWIN) char *_ossl_old_crypt(const char *buf,const char *salt) { return DES_crypt(buf, salt); } -#endif void _ossl_old_des_ofb_encrypt(unsigned char *in,unsigned char *out, int numbits,long length,des_key_schedule schedule,des_cblock *ivec) { diff --git a/crypto/des/des_old.h b/crypto/des/des_old.h index eb241fe317..734bfff5cc 100644 --- a/crypto/des/des_old.h +++ b/crypto/des/des_old.h @@ -111,12 +111,12 @@ typedef struct des_ks_struct clashes with libdes */ #define des_ecb3_encrypt(i,o,k1,k2,k3,e)\ _ossl_old_des_ecb3_encrypt((i),(o),(k1),(k2),(k3),(e)) -#define des_ecb3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\ - _ossl_old_des_ecb3_cbc_encrypt((i),(o),(k1),(k2),(k3),(e)) -#define des_ecb3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\ - _ossl_old_des_ecb3_cfb64_encrypt((i),(o),(k1),(k2),(k3),(e)) -#define des_ecb3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\ - _ossl_old_des_ecb3_ofb64_encrypt((i),(o),(k1),(k2),(k3),(e)) +#define des_ede3_cbc_encrypt(i,o,l,k1,k2,k3,iv,e)\ + _ossl_old_des_ede3_cbc_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e)) +#define des_ede3_cfb64_encrypt(i,o,l,k1,k2,k3,iv,n,e)\ + _ossl_old_des_ede3_cfb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(e)) +#define des_ede3_ofb64_encrypt(i,o,l,k1,k2,k3,iv,n)\ + _ossl_old_des_ede3_ofb64_encrypt((i),(o),(l),(k1),(k2),(k3),(iv),(n)) #define des_options()\ _ossl_old_des_options() #define des_cbc_cksum(i,o,l,k,iv)\ @@ -139,8 +139,8 @@ typedef struct des_ks_struct _ossl_old_des_encrypt3((d),(k1),(k2),(k3)) #define des_decrypt3(d,k1,k2,k3)\ _ossl_old_des_decrypt3((d),(k1),(k2),(k3)) -#define des_des_xwhite_in2out(k,i,o)\ - _ossl_old_des_des_xwhite_in2out((k),(i),(o)) +#define des_xwhite_in2out(k,i,o)\ + _ossl_old_des_xwhite_in2out((k),(i),(o)) #define des_enc_read(f,b,l,k,iv)\ _ossl_old_des_enc_read((f),(b),(l),(k),(iv)) #define des_enc_write(f,b,l,k,iv)\ @@ -157,14 +157,14 @@ typedef struct des_ks_struct _ossl_old_des_pcbc_encrypt((i),(o),(l),(k),(iv),(e)) #define des_quad_cksum(i,o,l,c,s)\ _ossl_old_des_quad_cksum((i),(o),(l),(c),(s)) -#define des_random_seed(k);\ - _ossl_old_des_random_seed((k)); -#define des_random_key(r);\ - _ossl_old_des_random_key((r)); -#define des_set_odd_parity(k);\ - _ossl_old_des_set_odd_parity((k)); -#define des_is_weak_key(k);\ - _ossl_old_des_is_weak_key((k)); +#define des_random_seed(k)\ + _ossl_old_des_random_seed((k)) +#define des_random_key(r)\ + _ossl_old_des_random_key((r)) +#define des_set_odd_parity(k)\ + _ossl_old_des_set_odd_parity((k)) +#define des_is_weak_key(k)\ + _ossl_old_des_is_weak_key((k)) #define des_set_key(k,ks)\ _ossl_old_des_set_key((k),(ks)) #define des_key_sched(k,ks)\ -- 2.34.1