Skip to content

Commit

Permalink
narinfo: Fix reading of secret key file
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Sep 20, 2024
1 parent 2dad87a commit 919b0c4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/Hydra/View/NARInfo.pm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ sub process {
# Optionally, sign the NAR info file we just created.
my $secretKeyFile = $c->config->{binary_cache_secret_key_file};
if (defined $secretKeyFile) {
my $secretKey = readFile $secretKeyFile;
my $secretKey = "";
open my $fh, '<', $secretKeyFile or die "Could not open file '$secretKeyFile' $!";
while (<$fh>) {
$secretKey .= $_;
}
close $fh;
my $fingerprint = fingerprintPath($storePath, $narHash, $narSize, $refs);
my $sig = signString($secretKey, $fingerprint);
$info .= "Sig: $sig\n";
Expand Down

0 comments on commit 919b0c4

Please sign in to comment.