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

Newly added functions lack version checks #83

Closed
jvarho opened this issue Jan 13, 2018 · 6 comments · Fixed by #84
Closed

Newly added functions lack version checks #83

jvarho opened this issue Jan 13, 2018 · 6 comments · Fixed by #84

Comments

@jvarho
Copy link
Contributor

jvarho commented Jan 13, 2018

Some of the constants/functions added in bca3999 do not exist in earlier versions of libsodium, like the one I have from Ubuntu 16.04, which is version 1.0.8. I get an error like:

  File "pysodium/__init__.py", line 144, in <module>
    crypto_pwhash_scryptsalsa208sha256_BYTES_MIN = sodium.crypto_pwhash_scryptsalsa208sha256_bytes_min()
  File "/usr/lib/python2.7/ctypes/__init__.py", line 375, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 380, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/lib/x86_64-linux-gnu/libsodium.so.18: undefined symbol: crypto_pwhash_scryptsalsa208sha256_bytes_min

I don't have time to figure out each of them at the moment or I would have tried to make a PR.

@stef
Copy link
Owner

stef commented Jan 13, 2018

damn. sorry. fixing it right now.

@stef
Copy link
Owner

stef commented Jan 13, 2018

hmmmm. looks like there are some constants that have been only added in 1.0.12 but the crypto_pwhash_scryptsalsa208sha256 interface existed previously already since at least 1.0.8. dunno what the best course is, remove the sanity checks entirely for that interface, or enable them only if libsodium is >=1.0.12, and let the previous versions fly blindly?

@stef
Copy link
Owner

stef commented Jan 13, 2018

please confirm the fix of this bug by b38db7d by closing this issue.

@jvarho
Copy link
Contributor Author

jvarho commented Jan 14, 2018

I found one more instance, see #84 .

looks like there are some constants that have been only added in 1.0.12 but the crypto_pwhash_scryptsalsa208sha256 interface existed previously already since at least 1.0.8. dunno what the best course is, remove the sanity checks entirely for that interface, or enable them only if libsodium is >=1.0.12, and let the previous versions fly blindly?

Another option would be to hardcode the values of those constants in 1.0.8...<1.0.12.

@stef
Copy link
Owner

stef commented Jan 14, 2018

ah, the hardcoding thing seems like the right solution to this problem, i'll do that! thanks for the insight! keep this ticket open until i commit that fix.

stef added a commit that referenced this issue Jan 14, 2018
…on_checks, and some reordering of the consts
@stef
Copy link
Owner

stef commented Jan 14, 2018

i hardcoded the missing values in case they do not exist, also i removed the sodium_version_checks which are made obsolete by this (and i reordered some of the constants to make them more human friendly) in 1d00f0c.

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

Successfully merging a pull request may close this issue.

2 participants