diff options
Diffstat (limited to 'Master/tlpkg/TeXLive/TLCrypto.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLCrypto.pm | 14 |
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"); } |