swift-crypto icon indicating copy to clipboard operation
swift-crypto copied to clipboard

Fix RSA.Encryption.PublicKey unsafePEMRepresentation incorrect keySizeInBits

Open anotheren opened this issue 1 year ago • 2 comments

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.

anotheren avatar May 26 '24 07:05 anotheren

Just added.

anotheren avatar May 29 '24 05:05 anotheren

@swift-server-bot test this please

Lukasa avatar May 29 '24 12:05 Lukasa