Code Monkey home page Code Monkey logo

Comments (15)

paragonie-security avatar paragonie-security commented on June 20, 2024 3

WordPress ticket: https://core.trac.wordpress.org/ticket/53274

from sodium_compat.

paragonie-security avatar paragonie-security commented on June 20, 2024 2

Great! v1.16.1 is out. We'll follow up with the WordPress dev team to get sodium_compat updated.

from sodium_compat.

lululujojo123 avatar lululujojo123 commented on June 20, 2024 1

Same problem with 1.16.0 and fresh installed composer package.

\Sodium\CRYPTO_PWHASH_SCRIPTSALSA208SHA256_OPSLIMIT_INTERACTIVE undefined constant.

from sodium_compat.

paragonie-security avatar paragonie-security commented on June 20, 2024 1

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.

paragonie-security avatar paragonie-security commented on June 20, 2024

If you update to the latest version of sodium_compat, does this error persist?

from sodium_compat.

ancient-spirit avatar ancient-spirit commented on June 20, 2024

@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

from sodium_compat.

lululujojo123 avatar lululujojo123 commented on June 20, 2024

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.

paragonie-security avatar paragonie-security commented on June 20, 2024

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.

paragonie-security avatar paragonie-security commented on June 20, 2024

@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?

from sodium_compat.

paragonie-security avatar paragonie-security commented on June 20, 2024

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.

lululujojo123 avatar lululujojo123 commented on June 20, 2024

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.

ancient-spirit avatar ancient-spirit commented on June 20, 2024

@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.

ancient-spirit avatar ancient-spirit commented on June 20, 2024

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.

paragonie-security avatar paragonie-security commented on June 20, 2024

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.

from sodium_compat.

ancient-spirit avatar ancient-spirit commented on June 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.