mirror of
https://github.com/clearml/dropbear
synced 2025-04-22 07:05:13 +00:00
Put some #ifdef options around first-follows options in case they
need to be disabled --HG-- branch : kexguess
This commit is contained in:
parent
78fbed8c3e
commit
cbd3d5e3a5
@ -110,11 +110,12 @@ void cli_session(int sock_in, int sock_out) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_KEX_FIRST_FOLLOWS
|
||||||
static void cli_send_kex_first_guess() {
|
static void cli_send_kex_first_guess() {
|
||||||
send_msg_kexdh_init();
|
send_msg_kexdh_init();
|
||||||
dropbear_log(LOG_INFO, "kexdh_init guess sent");
|
dropbear_log(LOG_INFO, "kexdh_init guess sent");
|
||||||
//cli_ses.kex_state = KEXDH_INIT_SENT;
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void cli_session_init() {
|
static void cli_session_init() {
|
||||||
|
|
||||||
@ -155,7 +156,9 @@ static void cli_session_init() {
|
|||||||
|
|
||||||
ses.isserver = 0;
|
ses.isserver = 0;
|
||||||
|
|
||||||
|
#ifdef USE_KEX_FIRST_FOLLOWS
|
||||||
ses.send_kex_first_guess = cli_send_kex_first_guess;
|
ses.send_kex_first_guess = cli_send_kex_first_guess;
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,7 +216,9 @@ algo_type sshhostkey[] = {
|
|||||||
algo_type sshkex[] = {
|
algo_type sshkex[] = {
|
||||||
{"diffie-hellman-group14-sha1", DROPBEAR_KEX_DH_GROUP14, NULL, 1, NULL},
|
{"diffie-hellman-group14-sha1", DROPBEAR_KEX_DH_GROUP14, NULL, 1, NULL},
|
||||||
{"diffie-hellman-group1-sha1", DROPBEAR_KEX_DH_GROUP1, NULL, 1, NULL},
|
{"diffie-hellman-group1-sha1", DROPBEAR_KEX_DH_GROUP1, NULL, 1, NULL},
|
||||||
|
#ifdef USE_KEXGUESS2
|
||||||
{KEXGUESS2_ALGO_NAME, KEXGUESS2_ALGO_ID, NULL, 1, NULL},
|
{KEXGUESS2_ALGO_NAME, KEXGUESS2_ALGO_ID, NULL, 1, NULL},
|
||||||
|
#endif
|
||||||
{NULL, 0, NULL, 0, NULL}
|
{NULL, 0, NULL, 0, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -692,7 +692,11 @@ static void read_kex_algos() {
|
|||||||
|
|
||||||
memset(ses.newkeys, 0x0, sizeof(*ses.newkeys));
|
memset(ses.newkeys, 0x0, sizeof(*ses.newkeys));
|
||||||
|
|
||||||
|
#ifdef USE_KEXGUESS2
|
||||||
enum kexguess2_used kexguess2 = KEXGUESS2_LOOK;
|
enum kexguess2_used kexguess2 = KEXGUESS2_LOOK;
|
||||||
|
#else
|
||||||
|
enum kexguess2_used kexguess2 = KEXGUESS2_NO;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* kex_algorithms */
|
/* kex_algorithms */
|
||||||
algo = buf_match_algo(ses.payload, sshkex, &kexguess2, &goodguess);
|
algo = buf_match_algo(ses.payload, sshkex, &kexguess2, &goodguess);
|
||||||
|
@ -23,6 +23,15 @@
|
|||||||
#define AUTH_TIMEOUT 300 /* we choose 5 minutes */
|
#define AUTH_TIMEOUT 300 /* we choose 5 minutes */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* A client should try and send an initial key exchange packet guessing
|
||||||
|
* the algorithm that will match - saves a round trip connecting, has little
|
||||||
|
* overhead if the guess was "wrong". */
|
||||||
|
#define USE_KEX_FIRST_FOLLOWS
|
||||||
|
/* Use protocol extension to allow "first follows" to succeed more frequently.
|
||||||
|
* This is currently Dropbear-specific but will gracefully fallback when connecting
|
||||||
|
* to other implementations. */
|
||||||
|
#define USE_KEXGUESS2
|
||||||
|
|
||||||
/* Minimum key sizes for DSS and RSA */
|
/* Minimum key sizes for DSS and RSA */
|
||||||
#ifndef MIN_DSS_KEYLEN
|
#ifndef MIN_DSS_KEYLEN
|
||||||
#define MIN_DSS_KEYLEN 512
|
#define MIN_DSS_KEYLEN 512
|
||||||
|
Loading…
Reference in New Issue
Block a user