From 46716ae53b90f8c6c4c523bf2f65b783adb69003 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Wed, 11 Jul 2018 15:15:48 +0300 Subject: Update nix-serve for Nix 2.0 --- modules/pkgs/nix-serve/nix-serve.psgi | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'modules/pkgs') diff --git a/modules/pkgs/nix-serve/nix-serve.psgi b/modules/pkgs/nix-serve/nix-serve.psgi index 696f752..e368531 100644 --- a/modules/pkgs/nix-serve/nix-serve.psgi +++ b/modules/pkgs/nix-serve/nix-serve.psgi @@ -44,13 +44,11 @@ my $app = sub { $res .= "Deriver: " . stripPath($deriver) . "\n" if defined $deriver; my $secretKeyFile = $ENV{'NIX_SECRET_KEY_FILE'}; if (defined $secretKeyFile) { - my $s = readFile $secretKeyFile; - chomp $s; - my ($keyName, $secretKey) = split ":", $s; - die "invalid secret key file ‘$secretKeyFile’\n" unless defined $keyName && defined $secretKey; + my $secretKey = readFile $secretKeyFile; + chomp $secretKey; my $fingerprint = fingerprintPath($storePath, $narHash, $narSize, $refs); - my $sig = encode_base64(signString(decode_base64($secretKey), $fingerprint), ""); - $res .= "Sig: $keyName:$sig\n"; + my $sig = signString($secretKey, $fingerprint); + $res .= "Sig: $sig\n"; } return [200, ['Content-Type' => 'text/x-nix-narinfo'], [$res]]; } -- cgit v1.2.3