Skip to content

chore: sign the vsix package, not the manifest #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 13, 2024

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented Dec 13, 2024

I misread the nodejs implementation, see this line: filepath.Join(filepath.Dir(fp), vsixPath+".vsix")

Should be signing the vsix file.

Regardless, signatures are still not being checked 🤷‍♂️. Unsure why VSCode just accepts bad signatures 🤔.

Also adds a command line flag to save the signatures to disk. Really nice for debugging.

@Emyrk Emyrk requested a review from code-asher December 13, 2024 17:29
Comment on lines +159 to +160
// If this file is missing, it means the extension was added before
// signatures were handled by the marketplace.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this opens the .vsix, which should always exist (if not installing will also fail). Or I could be misreading this 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait no, the manifest is expected to be there. Now that we are signing the vsix though, I might change this later to not require the file to be there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment refers to loading the vsix though, not the manifest, and the vsix must always exist. Possibly it was supposed to go in the block above where we read the manifest?

Copy link
Member

@code-asher code-asher Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah probably, the todo and error below also says manifest instead of vsix :D

}

// TODO: Fetch the VSIX payload from the storage
signed, err := s.SigZip(ctx, vsixData, manifestData)
if err != nil {
return nil, xerrors.Errorf("sign and zip manifest: %w", err)
Copy link
Member

@code-asher code-asher Dec 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops meant to say before submitting, really big nit, but looks like this error would end up saying sign and zip manifest: sign and zip manifest: whatever the error is with the first part twice which could look weird

@Emyrk Emyrk merged commit 0971b71 into main Dec 13, 2024
5 checks passed
@Emyrk Emyrk deleted the stevenmasley/save_signatures branch December 13, 2024 17:48
@github-actions github-actions bot locked and limited conversation to collaborators Dec 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants