comparison common-algo.c @ 1225:6a7938ba004a

add dh group15 and group16, disabled by default
author Matt Johnston <matt@ucc.asn.au>
date Fri, 15 Jan 2016 00:19:11 +0800
parents 82e2037d34ea
children 739b3909c499
comparison
equal deleted inserted replaced
1224:82e2037d34ea 1225:6a7938ba004a
249 }; 249 };
250 250
251 static const struct dropbear_kex kex_dh_group1 = {DROPBEAR_KEX_NORMAL_DH, dh_p_1, DH_P_1_LEN, NULL, &sha1_desc }; 251 static const struct dropbear_kex kex_dh_group1 = {DROPBEAR_KEX_NORMAL_DH, dh_p_1, DH_P_1_LEN, NULL, &sha1_desc };
252 static const struct dropbear_kex kex_dh_group14_sha1 = {DROPBEAR_KEX_NORMAL_DH, dh_p_14, DH_P_14_LEN, NULL, &sha1_desc }; 252 static const struct dropbear_kex kex_dh_group14_sha1 = {DROPBEAR_KEX_NORMAL_DH, dh_p_14, DH_P_14_LEN, NULL, &sha1_desc };
253 static const struct dropbear_kex kex_dh_group14_sha256 = {DROPBEAR_KEX_NORMAL_DH, dh_p_14, DH_P_14_LEN, NULL, &sha256_desc }; 253 static const struct dropbear_kex kex_dh_group14_sha256 = {DROPBEAR_KEX_NORMAL_DH, dh_p_14, DH_P_14_LEN, NULL, &sha256_desc };
254 #ifdef DROPBEAR_DH_GROUP15
255 static const struct dropbear_kex kex_dh_group15_sha256 = {DROPBEAR_KEX_NORMAL_DH, dh_p_15, DH_P_15_LEN, NULL, &sha256_desc };
256 #endif
257 #ifdef DROPBEAR_DH_GROUP16
258 static const struct dropbear_kex kex_dh_group16_sha256 = {DROPBEAR_KEX_NORMAL_DH, dh_p_16, DH_P_16_LEN, NULL, &sha256_desc };
259 #endif
254 260
255 /* These can't be const since dropbear_ecc_fill_dp() fills out 261 /* These can't be const since dropbear_ecc_fill_dp() fills out
256 ecc_curve at runtime */ 262 ecc_curve at runtime */
257 #ifdef DROPBEAR_ECDH 263 #ifdef DROPBEAR_ECDH
258 #ifdef DROPBEAR_ECC_256 264 #ifdef DROPBEAR_ECC_256
287 #endif 293 #endif
288 #endif 294 #endif
289 {"diffie-hellman-group14-sha256", 0, &kex_dh_group14_sha256, 1, NULL}, 295 {"diffie-hellman-group14-sha256", 0, &kex_dh_group14_sha256, 1, NULL},
290 {"diffie-hellman-group14-sha1", 0, &kex_dh_group14_sha1, 1, NULL}, 296 {"diffie-hellman-group14-sha1", 0, &kex_dh_group14_sha1, 1, NULL},
291 {"diffie-hellman-group1-sha1", 0, &kex_dh_group1, 1, NULL}, 297 {"diffie-hellman-group1-sha1", 0, &kex_dh_group1, 1, NULL},
298 #ifdef DROPBEAR_DH_GROUP15
299 {"diffie-hellman-group15-sha256", 0, &kex_dh_group15_sha256, 1, NULL},
300 #endif
301 #ifdef DROPBEAR_DH_GROUP16
302 {"diffie-hellman-group16-sha256", 0, &kex_dh_group16_sha256, 1, NULL},
303 #endif
292 #ifdef USE_KEXGUESS2 304 #ifdef USE_KEXGUESS2
293 {KEXGUESS2_ALGO_NAME, KEXGUESS2_ALGO_ID, NULL, 1, NULL}, 305 {KEXGUESS2_ALGO_NAME, KEXGUESS2_ALGO_ID, NULL, 1, NULL},
294 #endif 306 #endif
295 {NULL, 0, NULL, 0, NULL} 307 {NULL, 0, NULL, 0, NULL}
296 }; 308 };
318 330
319 unsigned int i, len; 331 unsigned int i, len;
320 unsigned int donefirst = 0; 332 unsigned int donefirst = 0;
321 buffer *algolist = NULL; 333 buffer *algolist = NULL;
322 334
323 algolist = buf_new(200); 335 algolist = buf_new(300);
324 for (i = 0; localalgos[i].name != NULL; i++) { 336 for (i = 0; localalgos[i].name != NULL; i++) {
325 if (localalgos[i].usable) { 337 if (localalgos[i].usable) {
326 if (donefirst) 338 if (donefirst)
327 buf_putbyte(algolist, ','); 339 buf_putbyte(algolist, ',');
328 donefirst = 1; 340 donefirst = 1;