@@ -124,36 +124,44 @@ compat_banner(struct ssh *ssh, const char *version)
124124 { NULL , 0 }
125125 };
126126
127+ debug ("------------------------ VERSION IS %s" , version );
127128 /* process table, return first match */
128129 ssh -> compat = 0 ;
129130 for (i = 0 ; check [i ].pat ; i ++ ) {
131+ debug_f ("PATTERN IS %d for %s\n" , i , check [i ].pat );
130132 if (match_pattern_list (version , check [i ].pat , 0 ) == 1 ) {
131133 debug_f ("match: %s pat %s compat 0x%08x" ,
132134 version , check [i ].pat , check [i ].bugs );
133135 ssh -> compat = check [i ].bugs ;
134136 /* Check to see if the remote side is OpenSSH and not HPN */
135137 /* TODO: See if we can work this into the new method for bug checks */
136138 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" );
139+ if (strstr (version , "hpn" )) {
140+ ssh -> compat |= SSH_HPNSSH ;
141+ debug ("Remote is HPN enabled" );
142+ }
143+ /* this checks to see if the remote
144+ * version string indicates that we
145+ * have access to hpn prefixed binaries
146+ * You'll need to change this to include
147+ * new major version numbers. Which is
148+ * why we should figure out how to make
149+ * the match pattern list work
150+ */
151+ if ((strstr (version , "hpn16" ) != NULL ) ||
152+ (strstr (version , "hpn17" ) != NULL ) ||
153+ (strstr (version , "hpn18" ) != NULL )) {
154+ ssh -> compat |= SSH_HPNSSH_PREFIX ;
155+ debug ("Remote uses HPNSSH prefixes." );
156+ break ;
157+ }
158+ if ((strstr (version , "OpenSSH_8.9" ) != NULL ) ||
159+ (strstr (version , "OpenSSH_9" ) != NULL )) {
160+ ssh -> compat |= SSH_RESTRICT_WINDOW ;
161+ debug ("Restricting adverstised window size." );
153162 }
154163 }
155164 debug ("ssh->compat is %u" , ssh -> compat );
156- return ;
157165 }
158166 }
159167 debug_f ("no match: %s" , version );
0 commit comments