changeset 1753:7c0fcd19e492

Increase MAX_PROPOSED_ALGO to 50, warn if exceeded
author Matt Johnston <matt@ucc.asn.au>
date Fri, 23 Oct 2020 20:53:58 +0800
parents 36e77a51d5e4
children 064f5be2fc45 d5680e12ac33
files common-algo.c sysoptions.h
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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;
 			}
--- 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 */