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

API to detect the bound version of OpenSSL #27583

Closed
bartonjs opened this issue Oct 9, 2018 · 4 comments
Closed

API to detect the bound version of OpenSSL #27583

bartonjs opened this issue Oct 9, 2018 · 4 comments
Labels
api-approved API was approved in API review, it can be implemented area-System.Security
Milestone

Comments

@bartonjs
Copy link
Member

bartonjs commented Oct 9, 2018

Since SafeEvpPKeyHandle exists to allow interop with OpenSSL, it would be good for callers to be able to determine if they are using the same library/version of OpenSSL that we are.

    public sealed partial class SafeEvpPKeyHandle
    {
        // The result of SSLeay() (OpenSSL 1.0.2) or OpenSSL_version() (OpenSSL 1.1.x)
        public static int OpenSslVersion { get; }
    }

Discussion points:

  • The native API is Unix C-long, so 32-bit on 32-bit, 64-bit on 64-bit.
  • So, int, uint, long, or ulong?
  • The version number contains detail we can't expose via System.Version
  • Callers are only expected to do ==
@bartonjs bartonjs self-assigned this Oct 9, 2018
@stephentoub
Copy link
Member

SafeEvpPKeyHandle

Seems like a strange place to put it. Could we put it on another type with OpenSSL in the name, that's not a SafeHandle, etc.? Even if it meant introducing a new type?

The version number contains detail we can't expose via System.Version

But they can be exposed in an int/long?

@vcsjones
Copy link
Member

vcsjones commented Oct 9, 2018

But they can be exposed in an int/long?

They cram a bunch of information in different bits. e.g.:

0x000906023 == 0.9.6b beta 3

@stephentoub
Copy link
Member

They cram a bunch of information in different bits

I see. Thanks.

@terrajobst
Copy link
Contributor

Looks good, but we should make the return type long.

@bartonjs bartonjs removed their assignment Nov 23, 2018
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 3.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-approved API was approved in API review, it can be implemented area-System.Security
Projects
None yet
Development

No branches or pull requests

5 participants