From: Michael Tremer Date: Fri, 20 Oct 2023 09:23:40 +0000 (+0000) Subject: uploads: Log any incorrect digests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e599f7ddb2614c62614a05d005e60fa2d0064cbe;p=pbs.git uploads: Log any incorrect digests Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/uploads.py b/src/buildservice/uploads.py index e5b9c9a7..56f8c158 100644 --- a/src/buildservice/uploads.py +++ b/src/buildservice/uploads.py @@ -267,6 +267,10 @@ class Upload(base.DataObject): # Check that the digest matches if not hmac.compare_digest(computed_digest, self.digest): + log.error("Upload %s had an incorrect digest:" % self) + log.error(" Expected: %s" % self.digest.hex()) + log.error(" Got : %s" % computed_digest.hex()) + raise ValueError("Invalid digest") # If there has been any kind of exception, we want to delete the temporary file