ElektraInitiative / libelektra

Elektra serves as a universal and secure framework to access configuration settings in a global, hierarchical key database.
https://www.libelektra.org
BSD 3-Clause "New" or "Revised" License
208 stars 123 forks source link

Fcrypt: Plugin Tests Fail on macOS 10.11 #1460

Closed sanssecours closed 7 years ago

sanssecours commented 7 years ago

Problem Description

It looks like testmod_fcrypt fails on macOS 10.11 (but not on macOS 10.10 or macOS 10.12).

As far as I can tell the problem here is, that the Travis build setup under macOS 10.11 does not include any of the supported crypto libraries:

-- Exclude Plugin crypto_openssl because OpenSSL development files not found
-- Exclude Plugin crypto_gcrypt because libgcrypt development files not found
-- Exclude Plugin crypto_botan because botan development files not found

. On macOS 10.10 at least openSSL seems to work:

-- Exclude Plugin crypto_gcrypt because libgcrypt development files not found
-- Exclude Plugin crypto_botan because botan development files not found
-- Include Plugin crypto_openssl

, while the Travis setup of macOS 10.12 includes libgcrypt

-- Exclude Plugin crypto_openssl because OpenSSL development files not found
-- Found libgcrypt: -L/usr/local/opt/libgcrypt/lib -lgcrypt -L/usr/local/opt/libgpg-error/lib -lgpg-error
-- Exclude Plugin crypto_botan because botan development files not found
-- Include Plugin crypto_gcrypt

.

Update

The test also fails on macOS 10.11 if libgcrypt is available.

System Information

markus2330 commented 7 years ago

Thanks for reporting!

Did you notice the macOS part of src/plugins/crypto/README.md? You need to set a symlink on MacOSX. The symlink made the cmake files a lot easier to maintain. See also #1384

As far as I can tell the fcrypt plugin requires a working version of the crypto plugin. Does it not?

I do not think so. There is some code reuse between them, but only in the gpg parts.

@petermax2 Please correct me if I am wrong.

petermax2 commented 7 years ago

I do not think so. There is some code reuse between them, but only in the gpg parts.

Correct. Fcrypt re-uses the module that interacts with the gpg process.

sanssecours commented 7 years ago

Did you notice the macOS part of src/plugins/crypto/README.md?

Yes, I read this section of the ReadMe recently, when I reviewed issue #1384.

You need to set a symlink on MacOSX.

I think we need this symlink only if we want to use OpenSSL:

brew install openssl botan libgcrypt pkg-config cmake
# The next step is required for pkg-config to find the include files of OpenSSL
ln -s /usr/local/opt/openssl/include/openssl/ /usr/local/include/openssl

. Otherwise the two other Travis instances would fail too, as far as I can tell.

I do not think so. There is some code reuse between them, but only in the gpg parts.

Correct. Fcrypt re-uses the module that interacts with the gpg process.

Thank you for the information. Anyway, the proposed solution was just a guess from my side. I take any fix that solves the problem 😊.

markus2330 commented 7 years ago

Sorry for interrupting the discussion. It seems like only @petermax2 can help.

petermax2 commented 7 years ago

I think we need this symlink only if we want to use OpenSSL:

Correct!

Sorry to say but I can not reproduce the error on macOS Sierra 10.12.4. Build + tests work out-of-the-box with 4675bb175a5783dfa6a42f9cec3dd06411f33828 .

Peters-iMac:build pnirschl$ ./bin/testmod_fcrypt 
FCRYPT       TESTS
==================

fcrypt RESULTS: 27 test(s) done. 0 error(s).
Peters-iMac:build pnirschl$ ./bin/testmod_crypto_gcrypt 
CYPTO        TESTS
==================

crypto_gcrypt RESULTS: 66 test(s) done. 0 error(s).

It may be an issue with Travis, which I am not familiar with.

sanssecours commented 7 years ago

Sorry to say but I can not reproduce the error on macOS Sierra 10.12.4. Build + tests work out-of-the-box with 4675bb1 .

Thank you for taking a look! Unfortunately I also use the latest version of macOS, so I can not reproduce this problem either. For now I just disabled all crypto plugins under macOS 10.11 in Travis.

petermax2 commented 7 years ago

@sanssecours Do you want to further investigate this issue or should we close it?

sanssecours commented 7 years ago

Do you want to further investigate…

Nope 🙂.

…or should we close it?

If you want to close it, that is fine with me.