This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Yet another twist.
[perl5.git] / win32 / des_fcrypt.patch
1 You need the GNU `patch' utility to apply this patch.  Get:
2
3     ftp://fractal.mta.ca/pub/crypto/SSLeay/DES/libdes-3.06.tar.gz
4
5 Uncompress it somewhere, and use the command line:
6
7     patch -p1 -N < this_file
8
9 to apply the patch.  Move the fcrypt.c file to the win32 subdirectory
10 of the Perl source distribution.
11
12 --- libdes-3.06/fcrypt.c.dist   Tue Aug  4 18:41:49 1998
13 +++ libdes-3.06/fcrypt.c        Tue Aug  4 18:42:03 1998
14 @@ -325,12 +325,15 @@
15  
16  static char shifts2[16]={0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0};
17  
18 -static int body();
19 -static int des_set_key();
20 +static int body(
21 +       unsigned long *out0,
22 +       unsigned long *out1,
23 +       des_key_schedule ks,
24 +       unsigned long Eswap0,
25 +       unsigned long Eswap1);
26  
27 -static int des_set_key(key,schedule)
28 -des_cblock *key;
29 -des_key_schedule schedule;
30 +static int
31 +des_set_key(des_cblock *key, des_key_schedule schedule)
32         {
33         register unsigned long c,d,t,s;
34         register unsigned char *in;
35 @@ -460,16 +463,14 @@
36  0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A
37  };
38  
39 -char *crypt(buf,salt)
40 -char *buf;
41 -char *salt;
42 +char *
43 +des_fcrypt(const char *buf, const char *salt, char *buff)
44         {
45         unsigned int i,j,x,y;
46         unsigned long Eswap0=0,Eswap1=0;
47         unsigned long out[2],ll;
48         des_cblock key;
49         des_key_schedule ks;
50 -       static unsigned char buff[20];
51         unsigned char bb[9];
52         unsigned char *b=bb;
53         unsigned char c,u;
54 @@ -521,13 +522,15 @@
55                 buff[i]=cov_2char[c];
56                 }
57         buff[13]='\0';
58 -       return((char *)buff);
59 +       return buff;
60         }
61  
62 -static int body(out0,out1,ks,Eswap0,Eswap1)
63 -unsigned long *out0,*out1;
64 -des_key_schedule *ks;
65 -unsigned long Eswap0,Eswap1;
66 +static int 
67 +body(  unsigned long *out0,
68 +       unsigned long *out1,
69 +       des_key_schedule ks,
70 +       unsigned long Eswap0,
71 +       unsigned long Eswap1)
72         {
73         register unsigned long l,r,t,u,v;
74  #ifdef ALT_ECB
75 End of Patch.