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

Add support for signing mach-O binaries #597

Open
isuruf opened this issue Jul 24, 2021 · 4 comments
Open

Add support for signing mach-O binaries #597

isuruf opened this issue Jul 24, 2021 · 4 comments

Comments

@isuruf
Copy link

isuruf commented Jul 24, 2021

Is your feature request related to a problem? Please describe.

With macOS-arm64, binaries need to be signed when running. The signature can be ad-hoc which means it is signed without any proof. When changing a binary, this signature becomes invalidated and therefore the binary becomes not executable.

LIEF already has a method to get the code signature, but not to re-sign. It'd be great to have a way to sign.

Describe the solution you'd like
LIEF provides a feature to sign a mach-O binary

Describe alternatives you've considered

I've looked at ldid which is AGPL and zsign which doesn't have a license. I'd like to use a library which is not licensed GPL.

Additional context
Add any other context or screenshots about the feature request here.

@romainthomas
Copy link
Member

Hi @isuruf
I agree that it would be a nice feature but to be honest, I will not have time to handle it at mi-term.

@farzonl
Copy link

farzonl commented Aug 13, 2021

As a workaround Is there a reason codesign can't be used as a post process action?

https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html

@cocos543
Copy link

+1

@palmerc
Copy link

palmerc commented Nov 8, 2024

Typically when I remove the signature, then just call out to

codesign -s - -f binary_path

Then the binary will run in the same way a clang produced file will

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

No branches or pull requests

5 participants