git.iko.soy/typeable/nixpkgs
on master help sign in
openssh: Enable DSA host/client keys

This applies a patch from Fedora to make HostKeyAlgorithms do the right thing, fixing the issue described in 401782cb678d2e28c0f7f2d40c6421624f410148.

commita7b7ac8bfb948f05c8956f8de23d806fb7686438 authorEelco Dolstra <eelco.dolstra@logicblox.com> dateMon 1 Feb 2016, 16:27 (11 years ago) parenta7f09e9
3 files changed+25−2
nixos/modules/programs/ssh.nix+3 nixos/modules/services/networking/ssh/sshd.nix+12−1 pkgs/tools/networking/openssh/default.nix+10−1
nixos/modules/programs/ssh.nix+3
@@ -186,6 +186,9 @@ in
186186
187187 ForwardX11 ${if cfg.forwardX11 then "yes" else "no"}
188188
189+ # Allow DSA keys for now. (These were deprecated in OpenSSH 7.0.)
190+ PubkeyAcceptedKeyTypes +ssh-dss
191+
189192 ${cfg.extraConfig}
190193 '';
191194
nixos/modules/services/networking/ssh/sshd.nix+12−1
@@ -52,6 +52,8 @@ let
5252 ));
5353 in listToAttrs (map mkAuthKeyFile usersWithKeys);
5454
55+ supportOldHostKeys = !versionAtLeast config.system.stateVersion "15.07";
56+
5557in
5658
5759{
@@ -177,7 +179,7 @@ in
177179 default =
178180 [ { type = "rsa"; bits = 4096; path = "/etc/ssh/ssh_host_rsa_key"; }
179181 { type = "ed25519"; path = "/etc/ssh/ssh_host_ed25519_key"; }
180− ] ++ optionals (!versionAtLeast config.system.stateVersion "15.07")
182+ ] ++ optionals supportOldHostKeys
181183 [ { type = "dsa"; path = "/etc/ssh/ssh_host_dsa_key"; }
182184 { type = "ecdsa"; bits = 521; path = "/etc/ssh/ssh_host_ecdsa_key"; }
183185 ];
@@ -347,6 +349,15 @@ in
347349 ${flip concatMapStrings cfg.hostKeys (k: ''
348350 HostKey ${k.path}
349351 '')}
352+
353+ # Allow DSA client keys for now. (These were deprecated
354+ # in OpenSSH 7.0.)
355+ PubkeyAcceptedKeyTypes +ssh-dss
356+
357+ # Re-enable DSA host keys for now.
358+ ${optionalString supportOldHostKeys ''
359+ HostKeyAlgorithms +ssh-dss
360+ ''}
350361 '';
351362
352363 assertions = [{ assertion = if cfg.forwardX11 then cfgc.setXAuthLocation else true;
pkgs/tools/networking/openssh/default.nix+10−1
@@ -36,7 +36,16 @@ stdenv.mkDerivation rec {
3636 export NIX_LDFLAGS="$NIX_LDFLAGS -lgcc_s"
3737 '';
3838
39− patches = [ ./locale_archive.patch ]
39+ patches =
40+ [ ./locale_archive.patch
41+
42+ # Fix "HostKeyAlgoritms +...", which we need to enable DSA
43+ # host key support.
44+ (fetchurl {
45+ url = "https://pkgs.fedoraproject.org/cgit/rpms/openssh.git/plain/openssh-7.1p1-hostkeyalgorithms.patch?id=c98f5597250d6f9a8e8d96960beb6306d150ef0f";
46+ sha256 = "029lzp9qv1af8wdm0wwj7qwjj1nimgsjj214jqm3amwz0857qgvp";
47+ })
48+ ]
4049 ++ optional withGssapiPatches gssapiSrc;
4150
4251 buildInputs = [ zlib openssl libedit pkgconfig pam ]