Make server send SSH_MSG_EXT_INFO

Ensure that only valid hostkey algorithms are sent in the first kex guess
This commit is contained in:
Matt Johnston
2020-05-21 23:00:22 +08:00
parent 2a81289ed3
commit 331d4a714f
6 changed files with 75 additions and 29 deletions

6
algo.h
View File

@@ -47,7 +47,7 @@ typedef struct Algo_Type algo_type;
/* lists mapping ssh types of algorithms to internal values */
extern algo_type sshkex[];
extern algo_type sshhostkey[];
extern algo_type sigalgs[];
extern algo_type sshciphers[];
extern algo_type sshhashes[];
extern algo_type ssh_compress[];
@@ -112,11 +112,15 @@ struct dropbear_kex {
const struct ltc_hash_descriptor *hash_desc;
};
/* Includes all algorithms is useall is set */
void buf_put_algolist_all(buffer * buf, const algo_type localalgos[], int useall);
/* Includes "usable" algorithms */
void buf_put_algolist(buffer * buf, const algo_type localalgos[]);
#define KEXGUESS2_ALGO_NAME "kexguess2@matt.ucc.asn.au"
int buf_has_algo(buffer *buf, const char *algo);
algo_type * first_usable_algo(algo_type algos[]);
algo_type * buf_match_algo(buffer* buf, algo_type localalgos[],
int kexguess2, int *goodguess);