Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch Openssh for Roundup #15 #21500

Merged
merged 4 commits into from
Dec 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions nixos/modules/services/networking/ssh/sshd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,7 @@ in
StandardInput = "socket";
} else {
Restart = "always";
Type = "forking";
PIDFile = "/run/sshd.pid";
Type = "simple";
});
};

Expand Down Expand Up @@ -322,8 +321,6 @@ in

services.openssh.extraConfig = mkOrder 0
''
PidFile /run/sshd.pid

Protocol 2

UsePAM yes
Expand Down
23 changes: 23 additions & 0 deletions nixos/tests/openssh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ in {
];
};

server_lazy =
{ config, pkgs, ... }:

{
services.openssh = { enable = true; startWhenNeeded = true; };
security.pam.services.sshd.limits =
[ { domain = "*"; item = "memlock"; type = "-"; value = 1024; } ];
users.extraUsers.root.openssh.authorizedKeys.keys = [
snakeOilPublicKey
];
};

client =
{ config, pkgs, ... }: { };

Expand All @@ -50,6 +62,8 @@ in {
subtest "manual-authkey", sub {
$server->succeed("mkdir -m 700 /root/.ssh");
$server->copyFileFromHost("key.pub", "/root/.ssh/authorized_keys");
$server_lazy->succeed("mkdir -m 700 /root/.ssh");
$server_lazy->copyFileFromHost("key.pub", "/root/.ssh/authorized_keys");

$client->succeed("mkdir -m 700 /root/.ssh");
$client->copyFileFromHost("key", "/root/.ssh/id_ed25519");
Expand All @@ -58,6 +72,10 @@ in {
$client->waitForUnit("network.target");
$client->succeed("ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no server 'echo hello world' >&2");
$client->succeed("ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no server 'ulimit -l' | grep 1024");

$client->succeed("ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no server_lazy 'echo hello world' >&2");
$client->succeed("ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no server_lazy 'ulimit -l' | grep 1024");

};

subtest "configured-authkey", sub {
Expand All @@ -66,6 +84,11 @@ in {
$client->succeed("ssh -o UserKnownHostsFile=/dev/null" .
" -o StrictHostKeyChecking=no -i privkey.snakeoil" .
" server true");

$client->succeed("ssh -o UserKnownHostsFile=/dev/null" .
" -o StrictHostKeyChecking=no -i privkey.snakeoil" .
" server_lazy true");

};
'';
})

This file was deleted.

12 changes: 6 additions & 6 deletions pkgs/tools/networking/openssh/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ let

# **please** update this patch when you update to a new openssh release.
gssapiSrc = fetchpatch {
url = "https://anonscm.debian.org/cgit/pkg-ssh/openssh.git/plain/debian/patches/gssapi.patch?id=477bb7636238c106f8cd7c868a8c0c5eabcfb3db";
sha256 = "1kcx2rw6z7y591vr60ww2m2civ0cx6f6awdpi66p1sric9b65si3";
name = "openssh-gssapi.patch";
url = "https://anonscm.debian.org/cgit/pkg-ssh/openssh.git/plain/debian"
+ "/patches/gssapi.patch?id=255b8554a50b5c75fca63f76b1ac837c0d4fb7aa";
sha256 = "0yg9iq7vb2fkvy36ar0jxk29pkw0h3dhv5vn8qncc3pgwx3617n2";
};

in
Expand All @@ -29,11 +31,11 @@ stdenv.mkDerivation rec {
# Please ensure that openssh_with_kerberos still builds when
# bumping the version here!
name = "openssh-${version}";
version = "7.3p1";
version = "7.4p1";

src = fetchurl {
url = "mirror://openbsd/OpenSSH/portable/${name}.tar.gz";
sha256 = "1k5y1wi29d47cgizbryxrhc1fbjsba2x8l5mqfa9b9nadnd9iyrz";
sha256 = "1l8r3x4fr2kb6xm95s7kjdif1wp6f94d4kljh4qjj9109shw87qv";
};

prePatch = optionalString hpnSupport
Expand All @@ -44,13 +46,11 @@ stdenv.mkDerivation rec {

patches =
[
./RH-1380296-NEWKEYS-null-pointer-deref.patch
./locale_archive.patch
./fix-host-key-algorithms-plus.patch

# See discussion in https://github.com/NixOS/nixpkgs/pull/16966
./dont_create_privsep_path.patch
./fix-CVE-2016-8858.patch
]
++ optional withGssapiPatches gssapiSrc;

Expand Down
11 changes: 0 additions & 11 deletions pkgs/tools/networking/openssh/fix-CVE-2016-8858.patch

This file was deleted.