Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport: Add API providing basic RSA pubkey encrypt and privkey decrypt (#125) #191

Merged
merged 1 commit into from
Aug 3, 2023

Conversation

Lukasa
Copy link
Collaborator

@Lukasa Lukasa commented Aug 3, 2023

This PR backports #125 to a 2.6 branch.

…#125)

* Add basic RSA encrypt/decrypt API.

* Add test vectors and tests for RSA encryption API

* Fix build failures

* Fix soundness issue

* Remove support for RSA encryption using the unsafe PKCS1 v1.5 padding

* Fix deprecation warning about the "pointer" version of Data.withUnsafeMutableBytes() by nudging the compiler to infer the "buffer" version.

* Fix deprecation warning about String.init(bytesNoCopy:length:freeWhenDone:) by using String.init(unsafeInitializedCapacity:initializingWith:) instead.

* Make _RSA.Encryption.[Public|Private]Key their own types

* Remove _RSA.Encryption.RSA[Encrypted|Decrypted]Data and just use Data directly. Don't use intermediate Array in BoringSSL implementations.

* Document the message size limits on RSA encrypt/decrypt operations

* Mark `_RSA` visible to documentation so the new docs can actually be seen (underscored name is assumed private by default)

* Fix generic type parameter shadowing warning (new warning in Swift 5.9)

* Fix pre-5.8 build

* Un-correct switch case indentation to make it wrong

(cherry picked from commit 5ac5632)
@Lukasa Lukasa added the 🔼 needs-minor-version-bump For PRs that when merged cause a bump of the minor version, ie. 1.x.0 -> 1.(x+1).0 label Aug 3, 2023
@Lukasa Lukasa merged commit ac03330 into apple:swift-crypto-2.6.X Aug 3, 2023
@Lukasa Lukasa deleted the cb-backport-125 branch August 3, 2023 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔼 needs-minor-version-bump For PRs that when merged cause a bump of the minor version, ie. 1.x.0 -> 1.(x+1).0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants