summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2020-10-23 20:53:58 +0800
committerMatt Johnston <matt@ucc.asn.au>2020-10-23 20:53:58 +0800
commit1a208c460b412113704c4d5f98585017ee0a6ccf (patch)
tree22e19ddd5ba47fb41131e8e937035cd1b37a24d0
parent34f24b18415200f053a7c78ecec2b7b11a7f8135 (diff)
Increase MAX_PROPOSED_ALGO to 50, warn if exceeded
-rw-r--r--common-algo.c6
-rw-r--r--sysoptions.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/common-algo.c b/common-algo.c
index 8b39892..7d015a8 100644
--- a/common-algo.c
+++ b/common-algo.c
@@ -381,7 +381,7 @@ static void get_algolist(char* algolist, unsigned int algolist_len,
}
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 @@ static void get_algolist(char* algolist, unsigned int algolist_len,
/* 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 --git a/sysoptions.h b/sysoptions.h
index 23ba268..22bc18c 100644
--- a/sysoptions.h
+++ b/sysoptions.h
@@ -176,7 +176,7 @@ If you test it please contact the Dropbear author */
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 */