mirror of
https://github.com/clearml/dropbear
synced 2025-02-11 23:23:30 +00:00
Increase MAX_PROPOSED_ALGO to 50, warn if exceeded
This commit is contained in:
parent
34f24b1841
commit
1a208c460b
@ -381,7 +381,7 @@ static void get_algolist(char* algolist, unsigned int algolist_len,
|
|||||||
}
|
}
|
||||||
if (algolist_len > MAX_PROPOSED_ALGO*(MAX_NAME_LEN+1)) {
|
if (algolist_len > MAX_PROPOSED_ALGO*(MAX_NAME_LEN+1)) {
|
||||||
*ret_count = 0;
|
*ret_count = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ret_list will contain a list of the strings parsed out.
|
/* ret_list will contain a list of the strings parsed out.
|
||||||
We will have at least one string (even if it's just "") */
|
We will have at least one string (even if it's just "") */
|
||||||
@ -392,11 +392,11 @@ static void get_algolist(char* algolist, unsigned int algolist_len,
|
|||||||
/* someone is trying something strange */
|
/* someone is trying something strange */
|
||||||
*ret_count = 0;
|
*ret_count = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (algolist[i] == ',') {
|
if (algolist[i] == ',') {
|
||||||
if (*ret_count >= max_count) {
|
if (*ret_count >= max_count) {
|
||||||
/* Too many */
|
dropbear_log(LOG_WARNING, "Too many remote algorithms");
|
||||||
*ret_count = 0;
|
*ret_count = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ If you test it please contact the Dropbear author */
|
|||||||
explicitly specified for all protocols (just
|
explicitly specified for all protocols (just
|
||||||
for algos) but seems valid */
|
for algos) but seems valid */
|
||||||
|
|
||||||
#define MAX_PROPOSED_ALGO 20
|
#define MAX_PROPOSED_ALGO 50
|
||||||
|
|
||||||
/* size/count limits */
|
/* size/count limits */
|
||||||
/* From transport rfc */
|
/* From transport rfc */
|
||||||
|
Loading…
Reference in New Issue
Block a user