-
Notifications
You must be signed in to change notification settings - Fork 85
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
Fatal error with Sodium\hex2bin #69
Comments
I did change \Sodium\hex2bin to sodium_hex2bin Now, I get the following error,
When tried replacing, \Sodium\memzero with sodium_memzero, this error got subsided too. an update P.S. will share, if I have any further issues, thank you |
Now, I get the following error,
hope, we should not use values of constants directly from https://paragonie.com/book/pecl-libsodium/read/01-quick-start.md please suggest, thank you |
PECL libsodium as of version 2 no longer uses namespaces but underscore functions. PHP 7.0 is reaching end of life soon, you should upgrade to PHP 7.1 or better PHP 7.2 which has Libsodium build-in (2.0, so remember to use the underscored function names). Secondly, you shoudn't hack into Halite as this may cause problems with interoperability. |
Dear Mr.Sebastiaan thanks for the quick response. Does Halite v3.2.0 support PHP v7.1 Branch? Alternatively, if we have to choose PHP v7.2.0, that is released a week before, only Halite 4 will be the option know? Moreover, we currently, use a Control Panel (CPanel), to manage our dev server. I am looking at all possible options, please share your inputs, thank you |
Our supported versions are in this table on the README: https://github.com/paragonie/halite#installing-halite
No, I'm fairly sure Halite 3 will work on PHP 7.2, but you'll be better served with version 4, which will be supported when support for versions 2 and 3 are dropped. |
Thanks for the confirmation, we will test and share updates |
Our Dev Environment:
I had downloaded Halite v4.01. While I donot use composer, and since, we keep libraries, outside webroot, I did change the $basedir, to reflect the correct path, in the autoload.php code. irrespective of whether, I use manual includes, of all library files or when using the above approach, I am finding a common error, when loading the previously saved Asymmetric Encryption KeyPair:
can someone, share, where I am doing wrong? thanks alot, for the quick response :) |
Use composer. Alternatively, make sure you install this library too, which is listed in the If you're on PHP 7.2, you shouldn't need anything from PECL. |
Thanks a lot Mr.Scott I will do as you suggested, |
Thanks a lot Mr.Scott, the Hex Encoding issue seems to be resolved, I now get the following error,
the following is the code, I see, in the Keyfactory.php page
your help is really appreciated :) |
Uhhhh, what.
|
Result:
I did ask our server admin, to uninstall PECL Libsodium v2.0.10 only. While sodium_memzero is correct, is the following, in the loadKeyFile() function correct?
|
Yes, it's wiping data from memory after it builds it into a key object. |
thank you for the update, seeing this, http://php.net/manual/en/function.sodium-memzero.php am I doing something wrong somewhere? I got the PECL Libsodium v2.0.10 uninstalled, after you confirmed, please share your inputs, thank you |
The manual entry was auto-generated. There is no length argument. If |
the PECL Libsodium v2.0.10 is re-installed now.
results in:
Sample Anonymous Asymmetric Encryption code:
Result:
As the auto loader code, will include this src/HiddenString.php file, do i still try to manually attempt, to include this, or some other error scenario? please share your inputs, thank you |
when I run the following:
Result: |
You need a |
now, it is working, Thanks a lot Mr.Scott and Paragonie-security and Mr.Sebastian as well, everyone, for helping me, with Libsodium issues and in the process of migration to latest version of v4.01, from Halite 1.5 |
Happy to hear it. 👍 |
Our PHP application is working correctly with Halite 1.0 on PHP 5.6 and corresponding Libsodium and PECL Libsodium.
Recently, we started migrating our application to Halite v3.2.0, and we are receiving error, as below,
Fatal error: Uncaught Error: Call to undefined function Sodium\hex2bin() in /home/uatpgsw/app/includes/halite-v320/src/KeyFactory.php:676
Stack trace:
#0 /home/uatpgsw/app/includes/halite-v320/src/KeyFactory.php(587): ParagonIE\Halite\KeyFactory::loadKeyFile('/home/uatpgsw/g...')
#1 /home/uatpgsw/public_html/index.php(267): ParagonIE\Halite\KeyFactory::loadEncryptionKeyPair('/home/uatpgsw/g...')
#2 {main}
thrown in /home/uatpgsw/app/includes/halite-v320/src/KeyFactory.php on line 676
Our dev system has:
When I run the following:
<?php var_dump([ SODIUM_LIBRARY_MAJOR_VERSION, SODIUM_LIBRARY_MINOR_VERSION, SODIUM_LIBRARY_VERSION ]); ?>
the response is as follows:
array(3) { [0]=> int(9) [1]=> int(6) [2]=> string(6) "1.0.14" }
Please share, if I am missing something or do we specifically need to use the older versions like PECL Libsodium 1.0.6 / 2.0.4, along with PHP v7.0 and Libsodium v1.0.9, as documented in https://github.com/paragonie/halite?
thank you
The text was updated successfully, but these errors were encountered: