Merge pull request #318185 from tomfitzhenry/initrd-ssh-null-alg

nixos/initrd-ssh: set KexAlgorithms/Ciphers/MACs only if non-null
This commit is contained in:
Sandro 2024-06-25 23:21:33 +02:00 committed by GitHub
commit 44b22d8d45
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -150,9 +150,13 @@ in
HostKey ${initrdKeyPath path}
'')}
KexAlgorithms ${concatStringsSep "," sshdCfg.settings.KexAlgorithms}
Ciphers ${concatStringsSep "," sshdCfg.settings.Ciphers}
MACs ${concatStringsSep "," sshdCfg.settings.Macs}
'' + lib.optionalString (sshdCfg.settings.KexAlgorithms != null) ''
KexAlgorithms ${concatStringsSep "," sshdCfg.settings.KexAlgorithms}
'' + lib.optionalString (sshdCfg.settings.Ciphers != null) ''
Ciphers ${concatStringsSep "," sshdCfg.settings.Ciphers}
'' + lib.optionalString (sshdCfg.settings.Macs != null) ''
MACs ${concatStringsSep "," sshdCfg.settings.Macs}
'' + ''
LogLevel ${sshdCfg.settings.LogLevel}