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

Use correct OpenSSL libraries for FreeBSD #34897

Closed
jasonpugsley opened this issue Apr 13, 2020 · 2 comments
Closed

Use correct OpenSSL libraries for FreeBSD #34897

jasonpugsley opened this issue Apr 13, 2020 · 2 comments
Labels
area-System.Security os-freebsd FreeBSD OS untriaged New issue has not been triaged by the area owner

Comments

@jasonpugsley
Copy link
Contributor

src/libraries/Native/Unix/System.Security.Cryptography.Native/opensslshim.c

OpenLibrary() doesn't currently find the correct libraries on my FreeBSD 11.3 build box.

The version of OpenSSL included in the base 11.3 install is 1.0.2

[jason@freebsd11 ~/src/runtime]$ /usr/bin/openssl version
OpenSSL 1.0.2s-freebsd  28 May 2019
[jason@freebsd11 ~/src/runtime]$ ldd /usr/bin/openssl
/usr/bin/openssl:
	libssl.so.8 => /usr/lib/libssl.so.8 (0x8008a4000)
	libcrypto.so.8 => /lib/libcrypto.so.8 (0x800c00000)
	libc.so.7 => /lib/libc.so.7 (0x801076000)

OpenSSL 1.1.1 can be installed with the FreeBSD package manager

[jason@freebsd11 ~/src/runtime]$ /usr/local/bin/openssl version
OpenSSL 1.1.1f  31 Mar 2020
[jason@freebsd11 ~/src/runtime]$ ldd /usr/local/bin/openssl
/usr/local/bin/openssl:
	libssl.so.11 => /usr/local/lib/libssl.so.11 (0x8008b7000)
	libcrypto.so.11 => /usr/local/lib/libcrypto.so.11 (0x800c00000)
	libthr.so.3 => /lib/libthr.so.3 (0x8010ef000)
	libc.so.7 => /lib/libc.so.7 (0x801317000)

OpenLibrary() needs to look for libssl.so.11 and libssl.so.8 to support these versions.

@wfurt

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Security untriaged New issue has not been triaged by the area owner labels Apr 13, 2020
@ghost
Copy link

ghost commented Apr 13, 2020

Tagging @bartonjs as an area owner. If you would like to be tagged for a label, please notify danmosemsft.

@jkotas jkotas added the os-freebsd FreeBSD OS label Apr 13, 2020
jasonpugsley added a commit to jasonpugsley/runtime that referenced this issue Apr 15, 2020
The version of OpenSSL installed will depend on the version of FreeBSD and
whether OpenSSL has been updated from the FreeBSD Ports collection.

The order of attempted loading is:
    libssl.so.11
    libssl.so.111
    libssl.so.8

Please see the issue for further detail.

dotnet#34897
@jasonpugsley
Copy link
Contributor Author

What follows is correct to the best of my knowledge. Corrections or updates are welcome.

FreeBSD library version numbering does not directly align to the version of OpenSSL.

Following are the likely library versions to be found on FreeBSD at install-time (Base) and from Ports at this date. Note, FreeBSD 13.0 is still in development.

FreeBSD Version Base Version Ports Version
11.3 libssl.so.8 libssl.so.11
12.1 libssl.so.111 libssl.so.11
13.0 libssl.so.111 libssl.so.11

The version of OpenSSL from Ports will be the same or newer than the version included in the base installation, the preferred search order when attempting to load the library is thus:
libssl.so.11 -> libssl.so.111 -> libssl.so.8

@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Security os-freebsd FreeBSD OS untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

3 participants