? ? Success

User tests: Successful: Unsuccessful:

avatar zero-24
zero-24
16 Aug 2017

Summary of Changes

Give this exection: RuntimeException: Sodium_compat produces incorrect results on systems that do not support 64-bit integers. Please upgrade to PHP 7 or newer for Windows x64 support.

https://ci.appveyor.com/project/joomla/joomla-cms/build/1.0.8484/job/vlv1htg6ro5b6aue

I have marked the test as skipped.

Testing Instructions

Lets see that appveyor runs

Expected result

tests passes

Actual result

tests fail with the RuntimeException above.

Documentation Changes Required

Maybe some note that Sodium_compat does not work on that systems? cc: @mbabker

avatar joomla-cms-bot joomla-cms-bot - change - 16 Aug 2017
Category Unit Tests
avatar zero-24 zero-24 - open - 16 Aug 2017
avatar zero-24 zero-24 - change - 16 Aug 2017
Status New Pending
avatar zero-24 zero-24 - change - 16 Aug 2017
Labels Added: ? ?
7b77d7c 16 Aug 2017 avatar zero-24 typo
avatar mbabker
mbabker - comment - 16 Aug 2017

It's not even PHP 5.x that's the issue in general, it's the lack of 64 bit support. See paragonie/sodium_compat#38 for context. Also, it seems non-Windows builds can be affected.

So the best check is going to be for PHP_INT_SIZE === 4 it seems.

avatar mbabker
mbabker - comment - 16 Aug 2017

OK, one more thing now. As is, the check will run regardless of the environment. Do the C extensions (either the PECL version or what's merged to PHP core) have this same limitation? If not, we'll need to expand our checks.

// If neither the `libsodium` (PECL 1.x) or `sodium` (PHP 7.2+ or PECL 2.x) extensions are available and this PHP build does not support 64-bit integers, we cannot run these tests
if (!extension_loaded('libsodium') && !extension_loaded('sodium') && PHP_INT_SIZE === 4) {
    $this->markTestSkipped('Cannot run tests on this environment due to not having the sodium PHP extension and not running a x64 PHP build');
}
avatar zero-24
zero-24 - comment - 16 Aug 2017

hmm i can't test this myself but given that:

This test works fine while using the libsodium extension, but fails with your awesome compat library.

paragonie/sodium_compat#37

I guess it is working using the libsodium extension?

avatar mbabker
mbabker - comment - 16 Aug 2017

I guess it is working using the libsodium extension?

That's what it sounded like to me too.

avatar zero-24 zero-24 - change - 16 Aug 2017
Title
Skip the JCryptCipherSodiumTest on windows
Skip the JCryptCipherSodiumTest on PHP_INT_SIZE === 4
avatar zero-24 zero-24 - edited - 16 Aug 2017
avatar zero-24
zero-24 - comment - 16 Aug 2017

Looks like appveyor is happy now with me ?

avatar zero-24
zero-24 - comment - 17 Aug 2017

Ah sorry @mbabker for my ignorance got it now. Thanks for patching this in the PR. IMO can be merged now as appveyor is happy now?

avatar mbabker mbabker - change - 17 Aug 2017
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2017-08-17 20:36:04
Closed_By mbabker
avatar mbabker mbabker - close - 17 Aug 2017
avatar mbabker mbabker - merge - 17 Aug 2017
avatar zero-24
zero-24 - comment - 17 Aug 2017

Thanks.

avatar paragonie-scott
paragonie-scott - comment - 23 Aug 2017

Just so everyone is aware, sodium_compat 1.2 will not have this limitation. 32-bit support is actively being worked on: paragonie/sodium_compat#47

avatar zero-24
zero-24 - comment - 23 Aug 2017

Thanks for the update. I think we can revert that PR when 1.2 is merge into the core.

avatar paragonie-scott
paragonie-scott - comment - 1 Sep 2017

sodium_compat 1.2 is now available

avatar zero-24
zero-24 - comment - 1 Sep 2017

Thanks. Looks like @mbabker and @wilsonge already done that including reverting this PR plese see: #17813

Add a Comment

Login with GitHub to post a comment