swift-crypto
swift-crypto copied to clipboard
Fix RSA.Encryption.PublicKey unsafePEMRepresentation incorrect keySizeInBits
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.
Just added.
@swift-server-bot test this please