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

FreeBSD: Add suffix numbering for OpenSSL3 #96961

Merged
merged 4 commits into from
Mar 8, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/native/libs/System.Security.Cryptography.Native/opensslshim.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,21 @@ static void OpenLibraryOnce(void)
DlOpen(MAKELIB("10"));
}

// FreeBSD uses a different suffix numbering convention.
// Current supported FreeBSD releases should use the order .11 -> .111
#ifdef __FreeBSD__
bartonjs marked this conversation as resolved.
Show resolved Hide resolved
// The ports version of OpenSSL is used over base where possible
if (libssl == NULL)
{
// OpenSSL 3.0 from ports
DlOpen(MAKELIB("12"));
}

if (libssl == NULL)
{
// OpenSSL 3.0 from base as found in FreeBSD 14.0
DlOpen(MAKELIB("30"));
}

// Fallbacks for OpenSSL 1.1.x
if (libssl == NULL)
{
DlOpen(MAKELIB("11"));
Expand All @@ -127,6 +140,8 @@ static void OpenLibraryOnce(void)
{
DlOpen(MAKELIB("111"));
}
#endif

}

static pthread_once_t g_openLibrary = PTHREAD_ONCE_INIT;
Expand Down
Loading