mirror of
https://github.com/jtesta/ssh-audit.git
synced 2025-06-23 11:04:31 +02:00
The color of all notes will be printed in green when the related algorithm is rated good.
This commit is contained in:
@ -195,6 +195,7 @@ def output_algorithm(out: OutputBuffer, alg_db: Dict[str, Dict[str, List[List[Op
|
||||
|
||||
alg_name = alg_name_with_size if alg_name_with_size is not None else alg_name
|
||||
first = True
|
||||
use_good_for_all = False
|
||||
for level, text in texts:
|
||||
if level == 'fail':
|
||||
program_retval = exitcodes.FAILURE
|
||||
@ -203,9 +204,13 @@ def output_algorithm(out: OutputBuffer, alg_db: Dict[str, Dict[str, List[List[Op
|
||||
|
||||
f = getattr(out, level)
|
||||
comment = (padding + ' -- [' + level + '] ' + text) if text != '' else ''
|
||||
|
||||
# If the first algorithm's comment is an 'info', this implies that it is rated good. Hence, the out.good() function should be used to write all subsequent notes for this algorithm as well.
|
||||
if (first and level == 'info') or use_good_for_all:
|
||||
f = out.good
|
||||
use_good_for_all = True
|
||||
|
||||
if first:
|
||||
if first and level == 'info':
|
||||
f = out.good
|
||||
f(prefix + alg_name + comment)
|
||||
first = False
|
||||
else: # pylint: disable=else-if-used
|
||||
|
Reference in New Issue
Block a user