Closed Bug 1773186 Opened 3 years ago Closed 3 years ago

Add file hashing to IOUtils with Digest

Categories

(Toolkit Graveyard :: OS.File, enhancement, P3)

enhancement

Tracking

(firefox104 fixed)

RESOLVED FIXED
104 Branch
Tracking Status
firefox104 --- fixed

People

(Reporter: beth, Assigned: beth)

References

Details

Attachments

(1 file)

ProductAddonChecker.jsm does a streaming file hash with OS.File and nsICryptoHash. (note: only the file IO is async, the hash computation is done on main thread).

There is no easy way to do this with IOUtils presently as we return all the file data at once. However, it would be easy to add a method on IOUtils to do the streaming hashing on the background thread with nsICryptoHash::UpdateFromStream

Depends on: 1773182

Depends on D148965

We don't want to use nsICryptoHash for new code but want to use Digest instead

No longer depends on: 1773182
Summary: Add file hashing to IOUtils with nsICryptoHash → Add file hashing to IOUtils with Digest
Attachment #9280782 - Attachment description: Bug 1773186 - Add IOUtils::HashFile r?nika → Bug 1773186 - Add IOUtils::ComputeHexDigest r?nika
Pushed by brennie@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8ec51be873d4 Add IOUtils::ComputeHexDigest r=nika,keeler

Backed out 2 changesets (bug 1773186, bug 1772742) for causing mochitest failures in dom/system/tests/ioutils/test_ioutils_hashfile.html

Backout link: https://hg.mozilla.org/integration/autoland/rev/dd7b5b6df782dc47bd55a5516433424e05e9d147

Push with failures

Failure log

INFO - TEST-UNEXPECTED-FAIL | dom/system/tests/ioutils/test_ioutils_hashfile.html | TypeError: IOUtils.hashFile is not a function - Should not throw any errors
Flags: needinfo?(brennie)
Flags: needinfo?(brennie)
Pushed by brennie@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b10faac4d933 Add IOUtils::ComputeHexDigest r=nika,keeler

Backed out changeset b10faac4d933 (Bug 1773186) for causing bustages on chrome.ini (test_ioutils_hashfile.html).
Backout link
Push with failures
Failure Log

Flags: needinfo?(brennie)
Flags: needinfo?(brennie)
Pushed by brennie@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f7d7af6a5401 Add IOUtils::ComputeHexDigest r=nika,keeler
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: