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

Ristretto255 API is available in libsodium 1.0.18+ only #70

Closed
eploko opened this issue Sep 11, 2020 · 3 comments
Closed

Ristretto255 API is available in libsodium 1.0.18+ only #70

eploko opened this issue Sep 11, 2020 · 3 comments

Comments

@eploko
Copy link
Contributor

eploko commented Sep 11, 2020

While trying to fix linter errors on CI in #69 I happened to come upon the following in the CI logs:

== Linting caesium.crypto.core.ristretto255 ==
Exception thrown during phase :analyze+eval of linting namespace caesium.crypto.core.ristretto255
...
Caused by:
UnsatisfiedLinkError unknown
	jnr.ffi.provider.jffi.AsmRuntime.newUnsatisifiedLinkError (AsmRuntime.java:40)
	caesium.binding.Sodium$jnr$ffi$0.crypto_core_ristretto255_bytes (:-1)

Source: https://travis-ci.com/github/eploko/caesium/jobs/383426457

The API was just recently added to libsodium and thus is not present in the 1.0.16 version that is being targeted by the CI builds. What can/should we do about it?

An obvious solution would be to bump the target version on CI, but I'm not sure it's along the way this project was heading before the change. There are build steps for older versions of libsodium as well, which stumble on the unsatisfied linking issue too. What are your thoughts on a proper way to approach it all?

@eploko eploko mentioned this issue Sep 11, 2020
4 tasks
@eploko
Copy link
Contributor Author

eploko commented Sep 11, 2020

Thinking about this a little further, I guess the main question is whether we strive to provide any kind of backward compatibility to older versions of libsodium or... maybe we could just outline what version of caesium corresponds to what version of libsodium in the docs... and that would be enough?

@lvh
Copy link
Owner

lvh commented Sep 11, 2020

There was a relatedish ticket about supporting multiple libsodium versions. I'm fine with the idea of just supporting only whatever features we support right now, and so forcing people to upgrade their libsodiums.

My solution to that in the past has been to ship libsodium debs for folks, but I haven't really kept up with it (because mostly OSes started shipping reasonable, recent libsodiums).

Another solution is to vendor libsodium, but I don't know offhand how to properly do that with jnr-ffi without some pretty extensive hacks. JavaCPP is better at that.

@eploko
Copy link
Contributor Author

eploko commented Sep 12, 2020

Skimming through the previous issues only reveals #34 that talks about running tests on both 1.0.14 and 1.0.15.

Theoretically one could use an older version of libsodium with the current version of caesium as long as: a) one doesn't use any of the new APIs and b) the types of return values and/or arguments of the APIs one uses haven't changed between the old and the currently targeted libsodium versions.

The tests wouldn't run on old versions per se, though. It'll require some elaborate fiddling with the test suite to let only the corresponding tests to run against an older version. Which I frankly don't see any benefit in.

As for vendoring a crypto library, it seems strange from the security standpoint: say, I'd rather link to something I control the origin of and not some non-officially distributed binary. Add to that the fact jnr-ffi doesn't currently support bundling of native libraries (jnr/jnr-ffi#93 via #23), and we may cross this option out as well, I guess.

So, if it's alright with you, what I'll try to do as a part of #69 will be this:

  1. Get rid of the build matrix that targets old versions of libsodium on CI.
  2. Make CI run tests against 1.0.18 (the current libsodium version) only.
  3. Add a note to README re: the minimum required libsodium version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants