comparison common-algo.c @ 1294:56aba7dedbea

options for disabling "normal" DH
author Matt Johnston <matt@ucc.asn.au>
date Mon, 02 May 2016 23:48:16 +0200
parents 139935236c72
children 750ec4ec4cbe
comparison
equal deleted inserted replaced
1293:dc8f7997f10f 1294:56aba7dedbea
249 }; 249 };
250 250
251 #if DROPBEAR_DH_GROUP1 251 #if DROPBEAR_DH_GROUP1
252 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_group1 = {DROPBEAR_KEX_NORMAL_DH, dh_p_1, DH_P_1_LEN, NULL, &sha1_desc };
253 #endif 253 #endif
254 #if DROPBEAR_DH_GROUP14 254 #if DROPBEAR_DH_GROUP14_SHA1
255 static const struct dropbear_kex kex_dh_group14_sha1 = {DROPBEAR_KEX_NORMAL_DH, dh_p_14, DH_P_14_LEN, NULL, &sha1_desc }; 255 static const struct dropbear_kex kex_dh_group14_sha1 = {DROPBEAR_KEX_NORMAL_DH, dh_p_14, DH_P_14_LEN, NULL, &sha1_desc };
256 #if DROPBEAR_DH_GROUP14_256 256 #endif
257 #if DROPBEAR_DH_GROUP14_SHA256
257 static const struct dropbear_kex kex_dh_group14_sha256 = {DROPBEAR_KEX_NORMAL_DH, dh_p_14, DH_P_14_LEN, NULL, &sha256_desc }; 258 static const struct dropbear_kex kex_dh_group14_sha256 = {DROPBEAR_KEX_NORMAL_DH, dh_p_14, DH_P_14_LEN, NULL, &sha256_desc };
258 #endif
259 #endif 259 #endif
260 #if DROPBEAR_DH_GROUP16 260 #if DROPBEAR_DH_GROUP16
261 static const struct dropbear_kex kex_dh_group16_sha512 = {DROPBEAR_KEX_NORMAL_DH, dh_p_16, DH_P_16_LEN, NULL, &sha512_desc }; 261 static const struct dropbear_kex kex_dh_group16_sha512 = {DROPBEAR_KEX_NORMAL_DH, dh_p_16, DH_P_16_LEN, NULL, &sha512_desc };
262 #endif 262 #endif
263 263
293 #endif 293 #endif
294 #ifdef DROPBEAR_ECC_256 294 #ifdef DROPBEAR_ECC_256
295 {"ecdh-sha2-nistp256", 0, &kex_ecdh_nistp256, 1, NULL}, 295 {"ecdh-sha2-nistp256", 0, &kex_ecdh_nistp256, 1, NULL},
296 #endif 296 #endif
297 #endif 297 #endif
298 #if DROPBEAR_DH_GROUP14 298 #if DROPBEAR_DH_GROUP14_SHA1
299 #if DROPBEAR_DH_GROUP14_256 299 {"diffie-hellman-group14-sha1", 0, &kex_dh_group14_sha1, 1, NULL},
300 #endif
301 #if DROPBEAR_DH_GROUP14_SHA256
300 {"diffie-hellman-group14-sha256", 0, &kex_dh_group14_sha256, 1, NULL}, 302 {"diffie-hellman-group14-sha256", 0, &kex_dh_group14_sha256, 1, NULL},
301 #endif
302 {"diffie-hellman-group14-sha1", 0, &kex_dh_group14_sha1, 1, NULL},
303 #endif 303 #endif
304 #if DROPBEAR_DH_GROUP1 304 #if DROPBEAR_DH_GROUP1
305 {"diffie-hellman-group1-sha1", 0, &kex_dh_group1, 1, NULL}, 305 {"diffie-hellman-group1-sha1", 0, &kex_dh_group1, 1, NULL},
306 #endif 306 #endif
307 #if DROPBEAR_DH_GROUP16 307 #if DROPBEAR_DH_GROUP16
347 len = strlen(localalgos[i].name); 347 len = strlen(localalgos[i].name);
348 buf_putbytes(algolist, (const unsigned char *) localalgos[i].name, len); 348 buf_putbytes(algolist, (const unsigned char *) localalgos[i].name, len);
349 } 349 }
350 } 350 }
351 buf_putstring(buf, (const char*)algolist->data, algolist->len); 351 buf_putstring(buf, (const char*)algolist->data, algolist->len);
352 TRACE(("algolist add '%*s'", algolist->len, algolist->data))
352 buf_free(algolist); 353 buf_free(algolist);
353 } 354 }
354 355
355 /* match the first algorithm in the comma-separated list in buf which is 356 /* match the first algorithm in the comma-separated list in buf which is
356 * also in localalgos[], or return NULL on failure. 357 * also in localalgos[], or return NULL on failure.