Comments (15)
WordPress ticket: https://core.trac.wordpress.org/ticket/53274
from sodium_compat.
Great! v1.16.1
is out. We'll follow up with the WordPress dev team to get sodium_compat updated.
from sodium_compat.
Same problem with 1.16.0 and fresh installed composer package.
\Sodium\CRYPTO_PWHASH_SCRIPTSALSA208SHA256_OPSLIMIT_INTERACTIVE undefined constant.
from sodium_compat.
Is there a list of functions not available in the polyfill but available in libsodium? Just for the future. At the moment we rely on other functions which are completely available in your polyfill implementation.
Outside the pwhash API, if a function is not covered by the polyfill, we consider that a bug to be fixed.
from sodium_compat.
If you update to the latest version of sodium_compat, does this error persist?
from sodium_compat.
Hi, I got similar error
PHP Fatal error: Uncaught Error: Undefined class constant 'CRYPTO_CORE_RISTRETTO255_BYTES' in C:\aether\vendor\paragonie\sodium_compat\lib\ristretto255.php:6
from sodium_compat.
I think those errors are on purpose. Because the encryption or hashing methods are not performant in the sodium_compat package and should only be used with the PHP internal libsodium library. Those errors seam to be a little confusing. Could it be possible to maybe throw an more meaningful exception instead of removing those constants entirely?
from sodium_compat.
I think those errors are on purpose. Because the encryption or hashing methods are not performant in the sodium_compat package and should only be used with the PHP internal libsodium library. Those errors seam to be a little confusing. Could it be possible to maybe throw an more meaningful exception instead of removing those constants entirely?
No, the point of this library is to be a polyfill.
from sodium_compat.
Hi, I got similar error
PHP Fatal error: Uncaught Error: Undefined class constant 'CRYPTO_CORE_RISTRETTO255_BYTES' in C:\aether\vendor\paragonie\sodium_compat\lib\ristretto255.php:6
This is bizarre. It definitely exists.
I wonder if triggering the autoloader would sidestep this.
Can you add this line to vendor/paragonie/sodium_compat/autoload.php
directly above line 44?
if (!class_exists('ParagonIE_Sodium_Compat')) {
var_dump('class does not exist');
}
...and then tell me if this affects these errors?
from sodium_compat.
A patch with an alternative proposed fix is in #132. If you can confirm that it addresses the observed behavior, I can merge it and tag v1.6.1
with the fix.
from sodium_compat.
I think those errors are on purpose. Because the encryption or hashing methods are not performant in the sodium_compat package and should only be used with the PHP internal libsodium library. Those errors seam to be a little confusing. Could it be possible to maybe throw an more meaningful exception instead of removing those constants entirely?
No, the point of this library is to be a polyfill.
Okay. That's fine. Took me some hours to understand, that behavior. Just thought it could be a little easier. But I totally understand that point as well. Is there a list of functions not available in the polyfill but available in libsodium? Just for the future. At the moment we rely on other functions which are completely available in your polyfill implementation.
from sodium_compat.
@paragonie-security
Hi, I got similar error
PHP Fatal error: Uncaught Error: Undefined class constant 'CRYPTO_CORE_RISTRETTO255_BYTES' in C:\aether\vendor\paragonie\sodium_compat\lib\ristretto255.php:6
This is bizarre. It definitely exists.
I wonder if triggering the autoloader would sidestep this.
Can you add this line to
vendor/paragonie/sodium_compat/autoload.php
directly above line 44?if (!class_exists('ParagonIE_Sodium_Compat')) { var_dump('class does not exist'); }
...and then tell me if this affects these errors?
var_dump(class_exists('ParagonIE_Sodium_Compat'));exit;
output: bool(true)
from sodium_compat.
A patch with an alternative proposed fix is in #132. If you can confirm that it addresses the observed behavior, I can merge it and tag
v1.6.1
with the fix.
I found the issue happened on WordPress, because WordPress embed this package too.
https://github.com/WordPress/WordPress/tree/master/wp-includes/sodium_compat
$rc = new \ReflectionClass('ParagonIE_Sodium_Compat');
var_dump($rc->getFileName());exit;
output: C:\laragon\www\wordpress\wp-includes\sodium_compat\src\Compat.php
from sodium_compat.
If this is a WordPress issue, try this:
- Backup
wp-includes\sodium_compat
- Replace its contents with the branch in #122
- Report back and tell us if the problem is fixed.
If so, the solution is simple: Release 1.6.1 and then tell the WordPress team to update their dependency in their next release. We've done this before.
from sodium_compat.
If this is a WordPress issue, try this:
1. Backup `wp-includes\sodium_compat` 2. Replace its contents with the branch in #122 3. Report back and tell us if the problem is fixed.
If so, the solution is simple: Release 1.6.1 and then tell the WordPress team to update their dependency in their next release. We've done this before.
I can confirm its work by following this guidance
from sodium_compat.
Related Issues (20)
- Constants such as SODIUM_CRYPTO_PWHASH_ALG_DEFAULT
- Issue in crypto_box_open function HOT 2
- sodium_crypto_aead_xchacha20poly1305_ietf_encrypt doesn't take null as Argument 2 HOT 5
- suggests ext-sodium HOT 2
- Argument 1 must be at least CRYPTO_SIGN_BYTES long HOT 5
- What would a hypothetical sodium_compat v2 look like? HOT 1
- PHP 8.1 x86 deprecation: Implicit conversion from float 4294967295 to int loses precision HOT 11
- Uncaught Error: Class 'ParagonIE_Sodium_Core32_Curve25519' not found HOT 4
- 'include guards' in src/Compat.php (among others) do nothing HOT 3
- Class not found due to autoload-fast.php not including directory HOT 2
- php newb seeing memory exhaustion composer-requiring into snipe-it HOT 2
- Build of sodium-compat.phar fails
- box.json omits autoload-php7.php HOT 2
- HKDF HOT 2
- AEAD - AEGIS-128L and AEGIS-256 HOT 1
- Missing file using composer install HOT 3
- Appveyor is failing (PHP 5.6 on Windows) HOT 1
- PHP 8.4 Compatibility
- [Internal] Modernize Code Style
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sodium_compat.