alphazframework / framework

Core files of AlphaZ Framework
https://alphazframework.github.io/
MIT License
16 stars 17 forks source link

SodiumException: key size should be SODIUM_CRYPTO_SECRETBOX_KEYBYTES bytes #273

Closed peter279k closed 4 years ago

peter279k commented 4 years ago

Describe the bug As title.

Requirements

  1. Zest Framework Version: 3.0.
  2. PHP Version: 7.3.9.
  3. Apache version: N/A.
  4. PlatForm version and name: Travis CI build environment.
  5. ErrorLog. The failed Travis CI build log is available here.

Additional context The failed error message is as follows during Travis CI build:

1) Framework\Tests\EncryptionTest::testSodiumEncrypt
SodiumException: key size should be SODIUM_CRYPTO_SECRETBOX_KEYBYTES bytes
/home/travis/build/zestframework/Zest_Framework/src/Encryption/Adapter/SodiumEncryption.php:84
/home/travis/build/zestframework/Zest_Framework/Tests/Encryption/EncryptionTest.php:26

It seems that the we should use the SODIUM_CRYPTO_SECRETBOX_KEYBYTES const to generate the cipher text and nonce.

The problematic code is on this line.

2mt-heuser commented 4 years ago

Is this still an issue? I can't seem to reproduce it locally with php7.3.9 + sodium 2.0.22. All tests work.

peter279k commented 4 years ago

I'm not sure that the test is failed during Travis CI build.

Maybe I will try reproducing issue and create related PR on that.

peter279k commented 4 years ago

After looking at these codes, this issue has been resolved on latest commit.

Closed.