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

Change iOS PEM searcher to use PemEncoding.TryFindUtf8 #109564

Merged
merged 3 commits into from
Nov 7, 2024

Conversation

vcsjones
Copy link
Member

@vcsjones vcsjones commented Nov 5, 2024

AppleCertificatePal.TryDecodePem can use the UTF-8 decoder. This extends out PemEnumerator to work on UTF-8 inputs.

internal delegate bool DerCallback(ReadOnlySpan<byte> derData, X509ContentType contentType);

internal static bool TryDecodePem(ReadOnlySpan<byte> rawData, DerCallback derCallback)
internal static void TryDecodePem(ReadOnlySpan<byte> rawData, Func<ReadOnlySpan<byte>, X509ContentType, bool> derCallback)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return value from this method was always ignored and seemed to have no purpose any more. So it became void.


namespace System.Security.Cryptography.X509Certificates
{
internal sealed partial class AppleCertificatePal : ICertificatePal
{
internal delegate bool DerCallback(ReadOnlySpan<byte> derData, X509ContentType contentType);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need a dedicated delegate anymore with allows ref struct on Func now, so use Func.

@vcsjones
Copy link
Member Author

vcsjones commented Nov 5, 2024

/azp run runtime-extra-platforms

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@bartonjs
Copy link
Member

bartonjs commented Nov 6, 2024

Since it's marked as Draft I just skimmed, but it looks good, conceptually.

@vcsjones vcsjones marked this pull request as ready for review November 6, 2024 02:59
@vcsjones
Copy link
Member Author

vcsjones commented Nov 6, 2024

Marked as draft while I waited for CI in case I needed to make changes since I don't have iOS tests working locally.

Failures from runtime-extra-platforms appear unrelated, so marked ready for review.

@bartonjs bartonjs merged commit f697b53 into dotnet:main Nov 7, 2024
83 checks passed
@vcsjones vcsjones deleted the ios-apple-pem branch November 7, 2024 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants