Suppress recommendation of token host key types.

This commit is contained in:
Joe Testa
2020-05-31 11:42:06 -04:00
parent 4b314a55ef
commit edc363db60
2 changed files with 3 additions and 1 deletions

View File

@ -1837,7 +1837,8 @@ class SSH(object): # pylint: disable=too-few-public-methods
if fc > 0:
faults += pow(10, 2 - i) * fc
if n not in alg_list:
if faults > 0 or (alg_type == 'key' and '-cert-' in n) or empty_version:
# Don't recommend certificate or token types; these will only appear in the server's list if they are fully configured & functional on the server.
if faults > 0 or (alg_type == 'key' and (('-cert-' in n) or (n.startswith('sk-')))) or empty_version:
continue
rec[sshv][alg_type]['add'][n] = 0
else: