Skip to content
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

signable single file apps on mac #46558

Merged
merged 2 commits into from
Jan 14, 2021
Merged

signable single file apps on mac #46558

merged 2 commits into from
Jan 14, 2021

Conversation

VSadov
Copy link
Member

@VSadov VSadov commented Jan 5, 2021

Resolves:#3671

After adding bundle data to the singlefile host, we need to patch up the file structure so it would satisfy expectations of codesign.

The approach is basically a copy of @swaroop-sridhar changes in https://github.com/dotnet/core-setup/compare/master...swaroop-sridhar:macsign?expand=1
We are extending the size of string table in __LINKEDIT segment to include bundle data.
This makes the bundle data to appear as a large string in a string table in otherwise compliant Mach-O file.

The approach is similar to what codesign_alocate itself does for the -p option ("page align the code signature data by padding string table and changing its size").

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the area-HostModel Microsoft.NET.HostModel issues label Jan 5, 2021
@ghost
Copy link

ghost commented Jan 5, 2021

Tagging subscribers to this area: @vitek-karas, @agocke
See info in area-owners.md if you want to be subscribed.

Issue Details

After adding bundle data to the singlefile host, we need to patch up the file structure so it would satisfy expectations of codesign.

Current approach is basically a copy of @swaroop-sridhar changes in https://github.com/dotnet/core-setup/compare/master...swaroop-sridhar:macsign?expand=1
We are extending the size of string table in __LINKEDIT segment to include bundle data.
This makes the bundle data to appear as a large string in a string table in otherwise compliant Mach-O file.

Alternatively we could try inserting bundle data as a segment/section before __LINKEDIT. Such insertion would require patching existing offsets that point into __LINKEDIT segment. I am not yet sure if this is a viable approach.

Author: VSadov
Assignees: -
Labels:

area-HostModel

Milestone: -

@dotnet dotnet deleted a comment from azure-pipelines bot Jan 6, 2021
@VSadov VSadov added the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Jan 12, 2021
@VSadov VSadov removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Jan 13, 2021
@VSadov VSadov changed the title [WIP] signable single file apps on mac signable single file apps on mac Jan 13, 2021
@VSadov VSadov marked this pull request as ready for review January 13, 2021 21:36
Copy link
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@VSadov VSadov assigned VSadov and unassigned VSadov Jan 13, 2021
@VSadov
Copy link
Member Author

VSadov commented Jan 14, 2021

Thanks!!

@VSadov VSadov merged commit 038d5ec into dotnet:master Jan 14, 2021
@VSadov VSadov deleted the macSign branch January 14, 2021 00:02
@ghost ghost locked as resolved and limited conversation to collaborators Feb 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-HostModel Microsoft.NET.HostModel issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants