summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLCrypto.pm
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2018-01-24 03:55:35 +0000
committerNorbert Preining <preining@logic.at>2018-01-24 03:55:35 +0000
commit9eaa775cf46f42eee783f48b085b765d08cf3296 (patch)
tree05411d5843f285dcd5416d3872e39cfced4c9b7d /Master/tlpkg/TeXLive/TLCrypto.pm
parenta2e0081ad0b36cecf31817297ce96467110d71d0 (diff)
better debugging and stronger integrity checks
git-svn-id: svn://tug.org/texlive/trunk@46421 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLCrypto.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLCrypto.pm14
1 files changed, 10 insertions, 4 deletions
diff --git a/Master/tlpkg/TeXLive/TLCrypto.pm b/Master/tlpkg/TeXLive/TLCrypto.pm
index ed54df1cc42..2d6a0a1cd5a 100644
--- a/Master/tlpkg/TeXLive/TLCrypto.pm
+++ b/Master/tlpkg/TeXLive/TLCrypto.pm
@@ -180,7 +180,7 @@ sub tlchecksum {
} elsif ($::checksum_method eq "digest::sha") {
$cs = $out;
}
- ddebug("tlchecksum: cs ===$cs===\n");
+ debug("tlchecksum($file): ===$cs===\n");
if (length($cs) != 128) {
tlwarn("unexpected output from $::checksum_method: $out\n");
return "";
@@ -247,23 +247,29 @@ sub verify_checksum {
# next step is verification of tlpdb checksum with checksum file
# existenc of checksum_file was checked above
if (!$checksum_file) {
+ debug("verify_checksum: download did not succeed for $checksum_url\n");
return($VS_CONNECTION_ERROR, "download did not succeed: $checksum_url");
}
# check the signature
my ($ret, $msg) = verify_signature($checksum_file, $checksum_url);
- return ($ret, $msg) if ($ret != 0);
+
+ if ($ret != 0) {
+ debug("verify_checksum: returning $ret and $msg\n");
+ return ($ret, $msg)
+ }
# verify local data
open $cs_fh, "<$checksum_file" or die("cannot read file: $!");
if (read ($cs_fh, $remote_digest, $ChecksumLength) != $ChecksumLength) {
close($cs_fh);
+ debug("verify_checksum: incomplete read from\n $checksum_file\nfor\n $file\nand\n $checksum_url\n");
return($VS_CHECKSUM_ERROR, "incomplete read from $checksum_file");
} else {
close($cs_fh);
- ddebug("found remote digest: $remote_digest\n");
+ debug("verify_checksum: found remote digest\n $remote_digest\nfrom\n $checksum_file\nfor\n $file\nand\n $checksum_url\n");
}
$local_digest = tlchecksum($file);
- ddebug("local_digest = $local_digest\n");
+ debug("verify_checksum: local_digest = $local_digest\n");
if ($local_digest ne $remote_digest) {
return($VS_CHECKSUM_ERROR, "digest disagree");
}