comparison common-algo.c @ 228:5e4110bb753a

- Fixed twofish algorithm naming so it actually works. - Added support for aes256, twofish256 and sha1-96 - Fixed some debugging statements
author Matt Johnston <matt@ucc.asn.au>
date Tue, 30 Aug 2005 16:58:57 +0000
parents ad1b24e39bf3
children 1c03b27e1ceb
comparison
equal deleted inserted replaced
227:ad1b24e39bf3 228:5e4110bb753a
30 * decide which ciphers/hashes/compression/signing to use during key exchange*/ 30 * decide which ciphers/hashes/compression/signing to use during key exchange*/
31 31
32 /* Mappings for ciphers, parameters are 32 /* Mappings for ciphers, parameters are
33 {&cipher_desc, keysize, blocksize} */ 33 {&cipher_desc, keysize, blocksize} */
34 34
35 #ifdef DROPBEAR_AES256_CBC
36 static const struct dropbear_cipher dropbear_aes256 =
37 {&aes_desc, 32, 16};
38 #endif
35 #ifdef DROPBEAR_AES128_CBC 39 #ifdef DROPBEAR_AES128_CBC
36 static const struct dropbear_cipher dropbear_aes128 = 40 static const struct dropbear_cipher dropbear_aes128 =
37 {&aes_desc, 16, 16}; 41 {&aes_desc, 16, 16};
38 #endif 42 #endif
39 #ifdef DROPBEAR_BLOWFISH_CBC 43 #ifdef DROPBEAR_BLOWFISH_CBC
40 static const struct dropbear_cipher dropbear_blowfish = 44 static const struct dropbear_cipher dropbear_blowfish =
41 {&blowfish_desc, 16, 8}; 45 {&blowfish_desc, 16, 8};
42 #endif 46 #endif
47 #ifdef DROPBEAR_TWOFISH256_CBC
48 static const struct dropbear_cipher dropbear_twofish256 =
49 {&twofish_desc, 32, 16};
50 #endif
43 #ifdef DROPBEAR_TWOFISH128_CBC 51 #ifdef DROPBEAR_TWOFISH128_CBC
44 static const struct dropbear_cipher dropbear_twofish128 = 52 static const struct dropbear_cipher dropbear_twofish128 =
45 {&twofish_desc, 16, 16}; 53 {&twofish_desc, 16, 16};
46 #endif 54 #endif
47 #ifdef DROPBEAR_3DES_CBC 55 #ifdef DROPBEAR_3DES_CBC
58 66
59 #ifdef DROPBEAR_SHA1_HMAC 67 #ifdef DROPBEAR_SHA1_HMAC
60 static const struct dropbear_hash dropbear_sha1 = 68 static const struct dropbear_hash dropbear_sha1 =
61 {&sha1_desc, 20, 20}; 69 {&sha1_desc, 20, 20};
62 #endif 70 #endif
71 #ifdef DROPBEAR_SHA1_96_HMAC
72 static const struct dropbear_hash dropbear_sha1_96 =
73 {&sha1_desc, 20, 12};
74 #endif
63 #ifdef DROPBEAR_MD5_HMAC 75 #ifdef DROPBEAR_MD5_HMAC
64 static const struct dropbear_hash dropbear_md5 = 76 static const struct dropbear_hash dropbear_md5 =
65 {&md5_desc, 16, 16}; 77 {&md5_desc, 16, 16};
66 #endif 78 #endif
67 79
73 85
74 algo_type sshciphers[] = { 86 algo_type sshciphers[] = {
75 #ifdef DROPBEAR_AES128_CBC 87 #ifdef DROPBEAR_AES128_CBC
76 {"aes128-cbc", 0, (void*)&dropbear_aes128, 1}, 88 {"aes128-cbc", 0, (void*)&dropbear_aes128, 1},
77 #endif 89 #endif
90 #ifdef DROPBEAR_3DES_CBC
91 {"3des-cbc", 0, (void*)&dropbear_3des, 1},
92 #endif
93 #ifdef DROPBEAR_AES256_CBC
94 {"aes256-cbc", 0, (void*)&dropbear_aes256, 1},
95 #endif
78 #ifdef DROPBEAR_BLOWFISH_CBC 96 #ifdef DROPBEAR_BLOWFISH_CBC
79 {"blowfish-cbc", 0, (void*)&dropbear_blowfish, 1}, 97 {"blowfish-cbc", 0, (void*)&dropbear_blowfish, 1},
80 #endif 98 #endif
99 #ifdef DROPBEAR_TWOFISH256_CBC
100 {"twofish256-cbc", 0, (void*)&dropbear_twofish256, 1},
101 #endif
81 #ifdef DROPBEAR_TWOFISH128_CBC 102 #ifdef DROPBEAR_TWOFISH128_CBC
82 {"twofish-cbc", 0, (void*)&dropbear_twofish128, 1}, 103 {"twofish128-cbc", 0, (void*)&dropbear_twofish128, 1},
83 #endif
84 #ifdef DROPBEAR_3DES_CBC
85 {"3des-cbc", 0, (void*)&dropbear_3des, 1},
86 #endif 104 #endif
87 {NULL, 0, NULL, 0} 105 {NULL, 0, NULL, 0}
88 }; 106 };
89 107
90 algo_type sshhashes[] = { 108 algo_type sshhashes[] = {
109 #ifdef DROPBEAR_SHA1_96_HMAC
110 {"hmac-sha1-96", 0, (void*)&dropbear_sha1_96, 1},
111 #endif
91 #ifdef DROPBEAR_SHA1_HMAC 112 #ifdef DROPBEAR_SHA1_HMAC
92 {"hmac-sha1", 0, (void*)&dropbear_sha1, 1}, 113 {"hmac-sha1", 0, (void*)&dropbear_sha1, 1},
93 #endif 114 #endif
94 #ifdef DROPBEAR_MD5_HMAC 115 #ifdef DROPBEAR_MD5_HMAC
95 {"hmac-md5", 0, (void*)&dropbear_md5, 1}, 116 {"hmac-md5", 0, (void*)&dropbear_md5, 1},