@@ -134,22 +134,30 @@ compat_banner(struct ssh *ssh, const char *version)
134134 /* Check to see if the remote side is OpenSSH and not HPN */
135135 /* TODO: See if we can work this into the new method for bug checks */
136136 if (strstr (version , "OpenSSH" ) != NULL ) {
137- if (strstr (version , "hpn" ) == NULL ) {
138- ssh -> compat |= SSH_BUG_LARGEWINDOW ;
139- debug ("Remote is NOT HPN enabled" );
140- } else {
141- /* this checks to see if the remote
142- * version string indicates that we
143- * have access to hpn prefixed binaries
144- * You'll need to change this to include
145- * new major version numbers. Which is
146- * why we should figure out how to make
147- * the match pattern list work
148- */
149- if ((strstr (version , "hpn16" ) != NULL ) ||
150- (strstr (version , "hpn17" ) != NULL ))
151- ssh -> compat |= SSH_HPNSSH ;
152- debug ("Remote is HPN Enabled" );
137+ if (strstr (version , "hpn" )) {
138+ ssh -> compat |= SSH_HPNSSH ;
139+ debug ("Remote is HPN enabled" );
140+ }
141+ /* this checks to see if the remote
142+ * version string indicates that we
143+ * have access to hpn prefixed binaries
144+ * You'll need to change this to include
145+ * new major version numbers. Which is
146+ * why we should figure out how to make
147+ * the match pattern list work
148+ */
149+ if ((strstr (version , "hpn16" ) != NULL ) ||
150+ (strstr (version , "hpn17" ) != NULL ) ||
151+ (strstr (version , "hpn18" ) != NULL )) {
152+ ssh -> compat |= SSH_HPNSSH_PREFIX ;
153+ debug ("Remote uses HPNSSH prefixes." );
154+ break ;
155+ }
156+ /* if it's openssh and not hpn */
157+ if ((strstr (version , "OpenSSH_8.9" ) != NULL ) ||
158+ (strstr (version , "OpenSSH_9" ) != NULL )) {
159+ ssh -> compat |= SSH_RESTRICT_WINDOW ;
160+ debug ("Restricting adverstised window size." );
153161 }
154162 }
155163 debug ("ssh->compat is %u" , ssh -> compat );
0 commit comments