forked from lix-project/hydra
Fix hydra-server signing
This commit is contained in:
parent
9de336de7c
commit
b00bdefa98
|
@ -36,13 +36,10 @@ sub process {
|
||||||
# Optionally, sign the NAR info file we just created.
|
# Optionally, sign the NAR info file we just created.
|
||||||
my $secretKeyFile = $c->config->{binary_cache_secret_key_file};
|
my $secretKeyFile = $c->config->{binary_cache_secret_key_file};
|
||||||
if (defined $secretKeyFile) {
|
if (defined $secretKeyFile) {
|
||||||
my $s = readFile $secretKeyFile;
|
my $secretKey = readFile $secretKeyFile;
|
||||||
chomp $s;
|
|
||||||
my ($keyName, $secretKey) = split ":", $s;
|
|
||||||
die "invalid secret key file\n" unless defined $keyName && defined $secretKey;
|
|
||||||
my $fingerprint = fingerprintPath($storePath, $narHash, $narSize, $refs);
|
my $fingerprint = fingerprintPath($storePath, $narHash, $narSize, $refs);
|
||||||
my $sig = encode_base64(signString(decode_base64($secretKey), $fingerprint), "");
|
my $sig = signString($secretKey, $fingerprint);
|
||||||
$info .= "Sig: $keyName:$sig\n";
|
$info .= "Sig: $sig\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
setCacheHeaders($c, 24 * 60 * 60);
|
setCacheHeaders($c, 24 * 60 * 60);
|
||||||
|
|
Loading…
Reference in a new issue