Skip to content

Conversation

anotheren
Copy link

In version 3.4, the _RSA.Encryption.PublicKey introduced a set of unsafe APIs to handle cases where keySizeInBits is less than 2048. However, in the implementation, the boundary check for keySizeInBits in init(unsafePEMRepresentation:) was incorrectly set as self.keySizeInBits >= 2048. Similar APIs indicate that it should actually be self.keySizeInBits >= 1024. This PR attempts to correct this issue.

Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

Thanks, this is a really good catch. Are you interested in adding a quick unit test to prevent further regression?

@anotheren
Copy link
Author

Just added.

@Lukasa
Copy link
Contributor

Lukasa commented May 29, 2024

@swift-server-bot test this please

@Lukasa Lukasa added the 🔨 semver/patch No public API change. label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants