aboutsummaryrefslogtreecommitdiff
path: root/modules/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pkgs')
-rw-r--r--modules/pkgs/nix-serve/nix-serve.psgi10
1 files changed, 4 insertions, 6 deletions
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]];
}