Change X509CertificateLoader to wrap unsupported algorithms with a CryptographicException #104040
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before the X509CertificateLoader was merged, the
ReadECDsaPrivateKey_BrainpoolP160r1_Pfxtest on Android was passing, but for the wrong reason. The test is asserting that the platform throws a CryptographicException for brainpool curves. On Android it was throwing a CryptographicException because the PFX is protected with RC2, which is unavailable on Android.This PR changes the PBE decryption to wrap the PlatformNotSupportedException with a CryptographicException with the same message, restoring the previous behavior.
We should probably investigate fixing the brainpool test to use an algorithm other than RC2 so we can confirm the Android tests fail for the right reason, but this unblocks CI.
Before loader merge:
After this pull request:
Fixes #104030