Line 0
Link Here
|
|
|
1 |
--- panel/common/passencrypt.cpp.orig 2007-11-24 13:03:32 UTC |
2 |
+++ panel/common/passencrypt.cpp |
3 |
@@ -64,9 +64,9 @@ char PasswdCrypt::HexValue(char c) |
4 |
void PasswdCrypt::DesECBEncode(const string& sKeyHex, const string& sDecode, string& sEncode) |
5 |
{ |
6 |
#ifdef __LINM_SFTP_USE__ |
7 |
- des_key_schedule tKeySchedule; |
8 |
+ DES_key_schedule tKeySchedule; |
9 |
|
10 |
- des_cblock tHexBlock, tSrcBlock, tDecBlock; |
11 |
+ DES_cblock tHexBlock, tSrcBlock, tDecBlock; |
12 |
char cHexa[] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; |
13 |
unsigned char cMask[2] = {0xF0, 0x0F}; |
14 |
char cEncode[17]; |
15 |
@@ -93,8 +93,8 @@ void PasswdCrypt::DesECBEncode(const str |
16 |
tSrcBlock[i] = (unsigned char)' '; |
17 |
} |
18 |
|
19 |
- des_set_key((const_des_cblock*)&tHexBlock, tKeySchedule); |
20 |
- des_ecb_encrypt((const_des_cblock*)&tSrcBlock, &tDecBlock, tKeySchedule, DES_ENCRYPT); |
21 |
+ DES_set_key((const_DES_cblock*)&tHexBlock, &tKeySchedule); |
22 |
+ DES_ecb_encrypt((const_DES_cblock*)&tSrcBlock, &tDecBlock, &tKeySchedule, DES_ENCRYPT); |
23 |
|
24 |
for(i=0; i<8; i++) |
25 |
{ |
26 |
@@ -110,9 +110,9 @@ void PasswdCrypt::DesECBEncode(const str |
27 |
void PasswdCrypt::DesECBDecode(const string& sKeyHex, const string& sEncode, string& sDecode) |
28 |
{ |
29 |
#ifdef __LINM_SFTP_USE__ |
30 |
- des_key_schedule tKeySchedule; |
31 |
+ DES_key_schedule tKeySchedule; |
32 |
|
33 |
- des_cblock tKeyBlock, tEncBlock, tDecBlock; |
34 |
+ DES_cblock tKeyBlock, tEncBlock, tDecBlock; |
35 |
char cKeyHex[16]; |
36 |
char cEncode[16]; |
37 |
int i; |
38 |
@@ -133,8 +133,8 @@ void PasswdCrypt::DesECBDecode(const str |
39 |
HEX2BYTE(*(tEncBlock+i), cEncode+i*2); |
40 |
} |
41 |
|
42 |
- des_set_key((const_des_cblock*)&tKeyBlock, tKeySchedule); |
43 |
- des_ecb_encrypt((const_des_cblock*)&tEncBlock, &tDecBlock, tKeySchedule, DES_DECRYPT); |
44 |
+ DES_set_key((const_DES_cblock*)&tKeyBlock, &tKeySchedule); |
45 |
+ DES_ecb_encrypt((const_DES_cblock*)&tEncBlock, &tDecBlock, &tKeySchedule, DES_DECRYPT); |
46 |
|
47 |
sDecode = ""; |
48 |
for(i=0; i<8; i++) |