# HG changeset patch # User Matt Johnston # Date 1603457638 -28800 # Node ID 7c0fcd19e4926f686ed64a80efbff703e11d4627 # Parent 36e77a51d5e4c600fa70565240890fe0145b68d2 Increase MAX_PROPOSED_ALGO to 50, warn if exceeded diff -r 36e77a51d5e4 -r 7c0fcd19e492 common-algo.c --- a/common-algo.c Wed Oct 21 20:49:22 2020 +0800 +++ b/common-algo.c Fri Oct 23 20:53:58 2020 +0800 @@ -381,7 +381,7 @@ } if (algolist_len > MAX_PROPOSED_ALGO*(MAX_NAME_LEN+1)) { *ret_count = 0; - } + } /* ret_list will contain a list of the strings parsed out. We will have at least one string (even if it's just "") */ @@ -392,11 +392,11 @@ /* someone is trying something strange */ *ret_count = 0; return; - } + } if (algolist[i] == ',') { if (*ret_count >= max_count) { - /* Too many */ + dropbear_log(LOG_WARNING, "Too many remote algorithms"); *ret_count = 0; return; } diff -r 36e77a51d5e4 -r 7c0fcd19e492 sysoptions.h --- a/sysoptions.h Wed Oct 21 20:49:22 2020 +0800 +++ b/sysoptions.h Fri Oct 23 20:53:58 2020 +0800 @@ -176,7 +176,7 @@ explicitly specified for all protocols (just for algos) but seems valid */ -#define MAX_PROPOSED_ALGO 20 +#define MAX_PROPOSED_ALGO 50 /* size/count limits */ /* From transport rfc */