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

Improve text for OpenSsl primitives when OpenSSL is not available #89046

Merged
merged 2 commits into from
Jul 18, 2023

Conversation

vcsjones
Copy link
Member

When using any of the *OpenSsl primitives on macOS, the current exception text is somewhat confusing. Before, it would be

Algorithm 'ECDiffieHellmanOpenSsl' is not supported on this platform.

After this change, it will be:

Algorithm 'ECDiffieHellmanOpenSsl' requires OpenSSL however OpenSSL could not be found or loaded.

This only affects using the *OpenSsl primitives on macOS since it is the only platform where we "support" OpenSSL but don't outright require it. Windows, Android etc. will continue to use the OpenSsl.NotSupported.cs in their complication targets:

public ECDiffieHellmanOpenSsl()
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_CryptographyOpenSSL);
}

So those platforms will continue to receive the former exception message.

cc @mvoss84

Contributes to #89006

@ghost
Copy link

ghost commented Jul 17, 2023

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

Issue Details

When using any of the *OpenSsl primitives on macOS, the current exception text is somewhat confusing. Before, it would be

Algorithm 'ECDiffieHellmanOpenSsl' is not supported on this platform.

After this change, it will be:

Algorithm 'ECDiffieHellmanOpenSsl' requires OpenSSL however OpenSSL could not be found or loaded.

This only affects using the *OpenSsl primitives on macOS since it is the only platform where we "support" OpenSSL but don't outright require it. Windows, Android etc. will continue to use the OpenSsl.NotSupported.cs in their complication targets:

public ECDiffieHellmanOpenSsl()
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_CryptographyOpenSSL);
}

So those platforms will continue to receive the former exception message.

cc @mvoss84

Contributes to #89006

Author: vcsjones
Assignees: vcsjones
Labels:

area-System.Security

Milestone: -

@krwq krwq merged commit f55247d into dotnet:main Jul 18, 2023
100 of 103 checks passed
@vcsjones vcsjones deleted the exception-text-no-openssl branch July 18, 2023 13:00
@ghost ghost locked as resolved and limited conversation to collaborators Aug 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants