Change RSA.LegalKeySizes for Apple platforms to return 8192#110591
Merged
vcsjones merged 5 commits intodotnet:mainfrom Jan 3, 2025
Merged
Change RSA.LegalKeySizes for Apple platforms to return 8192#110591vcsjones merged 5 commits intodotnet:mainfrom
vcsjones merged 5 commits intodotnet:mainfrom
Conversation
Contributor
|
Should we add a test that keys with the max size can be created? |
Member
Author
We do here But it's (effectively) a manual-only because it takes about ~30 seconds for macOS to generate an RSA 8K key. It can take several minutes for platforms that support 16K keys. Even for Outerloop that's too long, in my opinion. This manual-only test fails without the fix, which is what prompted me to make the change. |
Contributor
|
Makes sense, thanks. |
This was referenced Dec 11, 2024
Open
3 tasks
krwq
reviewed
Dec 18, 2024
src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.cs
Show resolved
Hide resolved
krwq
reviewed
Dec 18, 2024
src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.cs
Show resolved
Hide resolved
krwq
reviewed
Dec 18, 2024
src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.cs
Show resolved
Hide resolved
bartonjs
reviewed
Jan 2, 2025
src/libraries/Common/src/System/Security/Cryptography/RSASecurityTransforms.cs
Show resolved
Hide resolved
bartonjs
approved these changes
Jan 2, 2025
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This changes RSA.LegalKeySizes to return a maximum of 8192 on Apple platforms, as opposed to 16384. At least on macOS Sequoia and Sonoma, the limit is 8192-bit.
While we are here, memoize the
KeySizesinstance. They are immutable. The returned array is not - so we only memoize the interiorKeySizesinstance, not the returned array.Closes #110588.