Skip to content

Add standard implementation for ASAR Integrity info #410

Closed as not planned

Description

@erickzhao

From @nmggithub:

Something I came across as I was working on my @electron/asar PR: it seems the ASAR Integrity feature is implemented across multiple different projects.

@electron/fuses just seems to flip the fuse, not actually add the integrity information
@electron/packager includes an implementation of getting the integrity information (https://github.com/electron/packager/blob/v19.0.5/src/platform.ts#L364-L372)
@electron/universal has its own implementation of getting the integrity information (https://github.com/electron/universal/blob/v3.0.2/src/asar-utils.ts#L54-L62)
electron itself has an implementation as well (https://github.com/electron/electron/blob/v41.0.0/script/gn-asar-hash.js)
electron itself also seems to have a spec file that tests the common implementation (https://github.com/electron/electron/blob/v41.0.0/spec/asar-integrity-spec.ts#L114)

I'm wondering what makes sense for features like this. Keeping @electron/fuses scoped to just flipping the fuses is nice and simple, but when a fuse requires side-effects (like actually adding the integrity information) that does seem to force the implementation of those side-effects to live elsewhere. I think it might make more sense for @electron/asar to hold the "single source of truth" for the implementation of ASAR Integrity, but that would be expanding its scope a bit since its designed, first and foremost, to manipulate .asar files, not the apps that contain them. My PR did push it a bit into the latter direction, though.

Activity

  1. nmggithub commented on Mar 18, 2026

    @nmggithub
    Contributor

    I am participating with a comment so that I can be assigned to this!

  2. erickzhao commented on Apr 1, 2026

    @erickzhao
    MemberAuthor

    After additional discussion, we're keeping the package more focused and leaving impl to each other ecosystem package that needs it.

  3. xgiovio commented on Apr 30, 2026

    @xgiovio

    @erickzhao so right now the integrity-digest can't be called on asar and not implemented yet on electron packer. What is the solution? using the asar 4.1.2?

  4. erickzhao commented on Apr 30, 2026

    @erickzhao
    MemberAuthor

    Hi @xgiovio, sorry about the delay. Been busy with other work and this slipped through the cracks.

    I'll need some additional reviews on electron/packager#1890 and to get that merged, and then it'd all be in a useable state.

  5. xgiovio commented on Apr 30, 2026

    @xgiovio

    @erickzhao thanks for the update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions