Fix #6987 - Strongname signature size #10108
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #6987
The issue is that the desktop compiler uses The deprecated mscoree api: ICLRStrongName to do strongname signing. There is a permissions issue with
C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys
that shows up from time to time. Once it does signing with a non admin user stops working.Here is a page describing how to fix the permissions: https://docs.microsoft.com/en-us/troubleshoot/windows-server/windows-security/default-permissions-machinekeys-folders
The section on Permissions for the everyone group is the relevant section.
This PR fixes the issue, by using the signing code we wrote for the coreclr on the desktop as well. We retain the use of ICoreClrStrongName, only on the desktop compiler for the key container scenario.
Whilst doing this I also took the opportunity to refactor the code into ilsign.fsi/ilsign.fs, so now the signing code is in one place.
Enjoy
Kevin