comparison common-algo.c @ 715:cd3d3c63d189

Make hmac-sha2-256 and hmac-sha2-512 work
author Matt Johnston <matt@ucc.asn.au>
date Thu, 21 Mar 2013 22:55:12 +0800
parents 983a817f8e41
children 3062da90dab8 b07eb3dc23ec
comparison
equal deleted inserted replaced
714:84157e435c52 715:cd3d3c63d189
43 return CRYPT_OK; 43 return CRYPT_OK;
44 } 44 }
45 45
46 /* Mappings for ciphers, parameters are 46 /* Mappings for ciphers, parameters are
47 {&cipher_desc, keysize, blocksize} */ 47 {&cipher_desc, keysize, blocksize} */
48 /* NOTE: if keysize > 2*SHA1_HASH_SIZE, code such as hashkeys() 48
49 needs revisiting */ 49 /* Remember to add new ciphers/hashes to regciphers/reghashes too */
50 50
51 #ifdef DROPBEAR_AES256 51 #ifdef DROPBEAR_AES256
52 static const struct dropbear_cipher dropbear_aes256 = 52 static const struct dropbear_cipher dropbear_aes256 =
53 {&aes_desc, 32, 16}; 53 {&aes_desc, 32, 16};
54 #endif 54 #endif
166 {NULL, 0, NULL, 0, NULL} 166 {NULL, 0, NULL, 0, NULL}
167 }; 167 };
168 168
169 algo_type sshhashes[] = { 169 algo_type sshhashes[] = {
170 #ifdef DROPBEAR_SHA2_256_HMAC 170 #ifdef DROPBEAR_SHA2_256_HMAC
171 // {"hmac-sha2-256", 0, &dropbear_sha2_256, 1, NULL}, 171 {"hmac-sha2-256", 0, &dropbear_sha2_256, 1, NULL},
172 #endif 172 #endif
173 #ifdef DROPBEAR_SHA2_512_HMAC 173 #ifdef DROPBEAR_SHA2_512_HMAC
174 // {"hmac-sha2-512", 0, &dropbear_sha2_512, 1, NULL}, 174 {"hmac-sha2-512", 0, &dropbear_sha2_512, 1, NULL},
175 #endif 175 #endif
176 #ifdef DROPBEAR_SHA1_96_HMAC 176 #ifdef DROPBEAR_SHA1_96_HMAC
177 {"hmac-sha1-96", 0, &dropbear_sha1_96, 1, NULL}, 177 {"hmac-sha1-96", 0, &dropbear_sha1_96, 1, NULL},
178 #endif 178 #endif
179 #ifdef DROPBEAR_SHA1_HMAC 179 #ifdef DROPBEAR_SHA1_HMAC
242 const struct ltc_hash_descriptor *reghashes[] = { 242 const struct ltc_hash_descriptor *reghashes[] = {
243 /* we need sha1 for hostkey stuff regardless */ 243 /* we need sha1 for hostkey stuff regardless */
244 &sha1_desc, 244 &sha1_desc,
245 #ifdef DROPBEAR_MD5_HMAC 245 #ifdef DROPBEAR_MD5_HMAC
246 &md5_desc, 246 &md5_desc,
247 #endif
248 #ifdef DROPBEAR_SHA2_256_HMAC
249 &sha256_desc,
250 #endif
251 #ifdef DROPBEAR_SHA2_512_HMAC
252 &sha512_desc,
247 #endif 253 #endif
248 NULL 254 NULL
249 }; 255 };
250 int i; 256 int i;
251 257