MCPcopy
hub / github.com/jtesta/ssh-audit / output_compatibility

Function output_compatibility

src/ssh_audit/ssh_audit.py:245–272  ·  view source on GitHub ↗
(out: OutputBuffer, algs: Algorithms, client_audit: bool, for_server: bool = True)

Source from the content-addressed store, hash-verified

243
244
245def output_compatibility(out: OutputBuffer, algs: Algorithms, client_audit: bool, for_server: bool = True) -> None:
246
247 # Don't output any compatibility info if we're doing a client audit.
248 if client_audit:
249 return
250
251 ssh_timeframe = algs.get_ssh_timeframe(for_server)
252 comp_text = []
253 for ssh_prod in [Product.OpenSSH, Product.DropbearSSH]:
254 if ssh_prod not in ssh_timeframe:
255 continue
256 v_from = ssh_timeframe.get_from(ssh_prod, for_server)
257 v_till = ssh_timeframe.get_till(ssh_prod, for_server)
258 if v_from is None:
259 continue
260 if v_till is None:
261 comp_text.append('{} {}+'.format(ssh_prod, v_from))
262 elif v_from == v_till:
263 comp_text.append('{} {}'.format(ssh_prod, v_from))
264 else:
265 software = Software(None, ssh_prod, v_from, None, None)
266 if software.compare_version(v_till) > 0:
267 tfmt = '{0} {1}+ (some functionality from {2})'
268 else:
269 tfmt = '{0} {1}-{2}'
270 comp_text.append(tfmt.format(ssh_prod, v_from, v_till))
271 if len(comp_text) > 0:
272 out.good('(gen) compatibility: ' + ', '.join(comp_text))
273
274
275def output_security(out: OutputBuffer, banner: Optional[Banner], padlen: int, is_json_output: bool) -> None:

Callers 1

outputFunction · 0.85

Calls 6

compare_versionMethod · 0.95
SoftwareClass · 0.90
get_ssh_timeframeMethod · 0.80
get_fromMethod · 0.80
get_tillMethod · 0.80
goodMethod · 0.80

Tested by

no test coverage detected