]> git.ipfire.org Git - pbs.git/commitdiff
uploads: Log any incorrect digests
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 20 Oct 2023 09:23:40 +0000 (09:23 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 20 Oct 2023 09:23:40 +0000 (09:23 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/uploads.py

index e5b9c9a7433713881e84e8f7200f3da9eecd4c60..56f8c1584bd0a5a8ef7c2cf6df7eb5b7d1bcdc54 100644 (file)
@@ -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