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

If sodium is installed, then it uses this... #1411

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

If sodium is installed, then it uses this... #1411

wants to merge 2 commits into from

Conversation

cnngimenez
Copy link

... But if not uses the one included.

For some reason, on Fedora, compiling toxcore gives this error:

  CC       ../toxav/libtoxav_la-rtp.lo
../toxencryptsave/toxencryptsave.c:40:2: error: #error TOX_PASS_SALT_LENGTH is assumed to be equal to crypto_pwhash_scryptsalsa208sha256_SALTBYTES
 #error TOX_PASS_SALT_LENGTH is assumed to be equal to crypto_pwhash_scryptsalsa208sha256_SALTBYTES
  ^
../toxencryptsave/toxencryptsave.c:48:2: error: #error TOX_PASS_ENCRYPTION_EXTRA_LENGTH is assumed to be equal to (crypto_box_MACBYTES + crypto_box_NONCEBYTES + crypto_pwhash_scryptsalsa208sha256_SALTBYTES + TOX_ENC_SAVE_MAGIC_LENGTH)
 #error TOX_PASS_ENCRYPTION_EXTRA_LENGTH is assumed to be equal to (crypto_box_MACBYTES + crypto_box_NONCEBYTES + crypto_pwhash_scryptsalsa208sha256_SALTBYTES + TOX_ENC_SAVE_MAGIC_LENGT
  ^
../toxencryptsave/toxencryptsave.c: In function 'tox_get_salt':
../toxencryptsave/toxencryptsave.c:70:24: error: 'crypto_pwhash_scryptsalsa208sha256_SALTBYTES' undeclared (first use in this function)
     memcpy(salt, data, crypto_pwhash_scryptsalsa208sha256_SALTBYTES);
                        ^
../toxencryptsave/toxencryptsave.c:70:24: note: each undeclared identifier is reported only once for each function it appears in
../toxencryptsave/toxencryptsave.c: In function 'tox_derive_key_from_pass':
../toxencryptsave/toxencryptsave.c:88:18: error: 'crypto_pwhash_scryptsalsa208sha256_SALTBYTES' undeclared (first use in this function)
     uint8_t salt[crypto_pwhash_scryptsalsa208sha256_SALTBYTES];

This means that sodium's definitions are not included, so I added these lines and it worked fine.

@linux-modder
Copy link
Contributor

check the path libsodium builds fine as does toxcore on my Fedora 22

@cnngimenez
Copy link
Author

I didn't build sodium from sources, I have it already from my repos(version 1.0.3)... But the precompiler doesn't add it anywhere: there's no #include <sodium.h>.

I understand that the VANILLA_NACL macro is defined when you don't have sodium installed at the ./configure step so the precompiler adds the one you downloaded and compiled by yourself (as says at the INSTALL.md here ).

But what happen when ./configure locate your system sodium and saves this undefined? the code says: just nothing... so I added the #else ... #include. I don't know if this is fine... but did the job.

If there's something I missed from the INSTALL.md, please tell me.

Maybe I should change the title: "If sodium is installed on your repos, just add it."

@GrayHatter
Copy link
Collaborator

@cnngimenez if you're still having this build issue, let me know and I'll track down the issue and decide what to do with this.

@cnngimenez
Copy link
Author

@GrayHatter still having this issue. I have clonned the latest master b9ef248 and have the same error messages.

DNF says that libsodium is installed and:

Nombre      : libsodium
Arquitectur : x86_64
Epoch       : 0
Versión     : 1.0.5
Lanzamiento : 1.fc22

@linux-modder what did you do for compiling succesfully? I did this:

git clone --depth 1 https://github.com/irungentoo/toxcore.git toxcore2
cd toxcore2/
autoreconf -i
./configure 
make -j2

I tried even with make -j2 -I /usr/local/include/ (where sodium include files are) and the same error appear.

@GrayHatter GrayHatter added this to the stale milestone Feb 15, 2016
@GrayHatter GrayHatter removed their assignment Jul 9, 2016
@iphydf
Copy link
Contributor

iphydf commented Sep 22, 2016

Is this PR correct? Why is it only required on Fedora?

@iphydf
Copy link
Contributor

iphydf commented Sep 29, 2016

@cnngimenez is this PR still required?

@dennisnez
Copy link

I was getting the same error message when trying to compile tox 0.1.10 here in Gentoo land. Adding those three #include lines fixed things for me. (I have libsodium 1.0.16 installed.)

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

Successfully merging this pull request may close these issues.

None yet

5 participants