Skip to content

Conversation

@mschrag
Copy link
Contributor

@mschrag mschrag commented Nov 11, 2025

Add RSA PKCSv1.5 padding support for legacy compat

Checklist

  • I've run tests to see all new and existing tests pass
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

If you've made changes to gyb files

  • [n/a] I've run ./scripts/generate_boilerplate_files_with_gyb.sh and included updated generated files in a commit of this pull request

Motivation:

I have a scenario that requires me to be able to encrypt and decrypt values that use RSA PKCSv1.5 padding. This is known to be a weak algorithm, so we explicitly want to discourage its use, but there are scenarios where you need the algorithm for legacy compatibility, so we want to provide the capability, even if we strongly discourage its use.

Modifications:

Added a new enum + constant + passthrough to allow users to specify RSA PKCSv1.5. From the internal review, we thought it would be best to explicitly name the constants in a way that discouraged use without very intentional needs, hence the "weak" and "insecure" references in all of the naming.

Result:

You can now specify PKCSv1.5 padding for use in encryption and decryption. This is only adding constants, and the enums are not public, so there should not be any impact on compatibility (source or binary).

Add RSA PKCSv1.5 padding support for legacy compat

### Checklist
- [X] I've run tests to see all new and existing tests pass
- [X] I've followed the code style of the rest of the project
- [X] I've read the [Contribution Guidelines](CONTRIBUTING.md)
- [X] I've updated the documentation if necessary

#### If you've made changes to `gyb` files
- [n/a] I've run `./scripts/generate_boilerplate_files_with_gyb.sh` and
included updated generated files in a commit of this pull request

### Motivation:
I have a scenario that requires me to be able to encrypt and decrypt
values that use RSA PKCSv1.5 padding. This is known to be a weak
algorithm, so we explicitly want to discourage its use, but there are
scenarios where you need the algorithm for legacy compatibility, so we
want to provide the capability, even if we strongly discourage its use.

### Modifications:
Added a new enum + constant + passthrough to allow users to specify
RSA PKCSv1.5. From the internal review, we thought it would be best to
explicitly name the constants in a way that discouraged use without very
intentional needs, hence the "weak" and "insecure" references in all of
the naming.

### Result:
You can now specify PKCSv1.5 padding for use in encryption and
decryption. This is only adding constants, and the enums are not public,
so there should not be any impact on compatibility (source or binary).
@Lukasa Lukasa added the 🆕 semver/minor Adds new public API. label Nov 19, 2025
@Lukasa Lukasa merged commit 6f70fa9 into apple:main Nov 19, 2025
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants