Be more robust wrt broken .narinfo files
This commit is contained in:
parent
f0f30f594c
commit
a64da5915d
1 changed files with 10 additions and 3 deletions
|
@ -462,9 +462,16 @@ sub parseNARInfo {
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $fingerprint = fingerprintPath(
|
my $fingerprint;
|
||||||
|
eval {
|
||||||
|
$fingerprint = fingerprintPath(
|
||||||
$storePath, $narHash, $narSize,
|
$storePath, $narHash, $narSize,
|
||||||
[ map { "$Nix::Config::storeDir/$_" } @refs ]);
|
[ map { "$Nix::Config::storeDir/$_" } @refs ]);
|
||||||
|
};
|
||||||
|
if ($@) {
|
||||||
|
warn "cannot compute fingerprint of ‘$location’; ignoring\n";
|
||||||
|
return undef;
|
||||||
|
}
|
||||||
|
|
||||||
if (!checkSignature($publicKey, decode_base64($sig64), $fingerprint)) {
|
if (!checkSignature($publicKey, decode_base64($sig64), $fingerprint)) {
|
||||||
warn "NAR info file ‘$location’ has an incorrect signature; ignoring\n";
|
warn "NAR info file ‘$location’ has an incorrect signature; ignoring\n";
|
||||||
|
|
Loading…
Reference in a new issue