提交 5e68f8ce 编写于 作者: R Richard Levitte

Apply three patches from Assar Westerlund <assar@kth.se>:

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.
上级 b9a3ef4c
......@@ -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)
{
......
......@@ -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)\
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册