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

Add support for multiple minor versions of libsodium? #54

Closed
wegel opened this issue Jan 23, 2021 · 2 comments
Closed

Add support for multiple minor versions of libsodium? #54

wegel opened this issue Jan 23, 2021 · 2 comments
Labels

Comments

@wegel
Copy link

wegel commented Jan 23, 2021

Currently, the libsodium version used is hardcoded here and checked here.

This works most of the times because of the dependency on the libsodium nuget package. However, that package doesn't include the libsodium for all potential platforms, and it would be impractical, if at all possible, to do so. For example, here are the bundled versions currently:

./bin/Debug/net5.0/runtimes/win-x86/native/libsodium.dll
./bin/Debug/net5.0/runtimes/linux-x64/native/libsodium.so
./bin/Debug/net5.0/runtimes/win-x64/native/libsodium.dll
./bin/Debug/net5.0/runtimes/osx-x64/native/libsodium.dylib
./bin/Debug/net5.0/runtimes/linux-musl-x64/native/libsodium.so

There's isn't any bundled library for linux on aarch64, so we have to install the library manually somehow. When installing it on linux+aarch64 inside microsoft's docker runtime:5.0 image using apt-get, you get libsodium 1.0.17 instead of 1.0.18.

In my local branch I removed the SODIUM_LIBRARY_VERSION_MINOR check so it works when using the same major version. Maybe you could allow for overriding the hardcoded version and/or allow to disable the check altogether when an environment variable is set?

Thanks.

@ektrah
Copy link
Owner

ektrah commented Mar 18, 2021

The differences between minor versions of libsodium are in practice actually not that minor. So, supporting multiple versions in NSec would require a lot more testing, conditionally compiled code, and polyfills.

I think the solution here is to include the pre-compiled binary for aarch64 in the package. Unfortunately, I don't have access to an aarch64 machine that runs .NET and don't know if/how it's possible to build and test a pre-compiled binary for aarch64 with GitHub Actions. The GitHub Actions workflow is here. If you want to create a pull request adding aarch64 support, I think that would be very welcome.

@ektrah
Copy link
Owner

ektrah commented Sep 9, 2021

Support for linux-arm64 and linux-arm has been added in the libsodium 1.0.18.1 nuget package. We're still working out some minor issues, so that likely the next NSec release with have support as well.

@ektrah ektrah closed this as completed Sep 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants