summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-09-20 10:51:40 +0200
committerChristian Breunig <christian@breunig.cc>2025-09-20 10:51:40 +0200
commit7aa35eff59611cb90f2409831650ac39506163aa (patch)
treef451c2989245f019125118b3984fca5b0c64f7ce /src
parent91afb698a063499f81bc967e57f07e6ea5823eb0 (diff)
downloadvyos-1x-7aa35eff59611cb90f2409831650ac39506163aa.tar.gz
vyos-1x-7aa35eff59611cb90f2409831650ac39506163aa.zip
ssh: T7839: fix warning on deprecated algorithms during commit
The list calculation of in-use but deprecated SSH hostkey algorithms was wrong. This was implemented in commit 6deda171e ("ssh: T7839: add deprecation warning for DSA hostkey-algorithm usage"). It always returned the content of the list of deprecated algorithms, but not the list of deprecated algorithms actually - in use - by the configuration. This has been corrected. Before: DEPRECATION WARNING: Support for SSH-DSA keys is deprecated and will be removed in VyOS 1.6. Please update affected keys to a supported algorithm (e.g., RSA, ECDSA or ED25519) to avoid authentication failures after the upgrade. The following hostkey-algorithms are in use: ssh-dss, ssh-dss-cert-v01@openssh.com After: DEPRECATION WARNING: Support for SSH-DSA keys is deprecated and will be removed in VyOS 1.6. Please update affected keys to a supported algorithm (e.g., RSA, ECDSA or ED25519) to avoid authentication failures after the upgrade. The following hostkey-algorithms are in use: ssh-dss The generation of the MOTD was not affected!
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/service_ssh.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/conf_mode/service_ssh.py b/src/conf_mode/service_ssh.py
index ca0e66207..dca021d02 100755
--- a/src/conf_mode/service_ssh.py
+++ b/src/conf_mode/service_ssh.py
@@ -111,10 +111,8 @@ def verify(ssh):
verify_pki_openssh_key(ssh, ssh['trusted_user_ca'])
if 'hostkey_algorithm' in ssh:
- tmp = any(item in deprecated_algos for item in ssh['hostkey_algorithm'])
- if deprecated_algos:
- tmp = ', '.join(deprecated_algos)
- DeprecationWarning(f'{SSH_DSA_DEPRECATION_WARNING} {tmp}')
+ tmp = [algo for algo in ssh['hostkey_algorithm'] if algo in deprecated_algos]
+ if tmp: DeprecationWarning(f'{SSH_DSA_DEPRECATION_WARNING} {", ".join(tmp)}')
verify_vrf(ssh)
return None