Skip to content
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

[8.x] Keep backward compatibility with custom ciphers #38556

Merged
merged 1 commit into from
Aug 26, 2021
Merged

[8.x] Keep backward compatibility with custom ciphers #38556

merged 1 commit into from
Aug 26, 2021

Conversation

AdrianPop
Copy link
Contributor

  • Laravel Version: 8.56.0
  • PHP Version: 8.0.0
  • Database Driver & Version:

Description:

Laravel 8.56 was released a few days ago and these changes in the Encryption library break custom ciphers - illuminate/encryption@v8.55.0...v8.56.0#diff-4f830444085dd7aded928d1f4c746b2b2a3ced0c12e2788d4474e777e4b9113dL73

php artisan key:generate doesn't work if the usec cipher is XSalsa20

Steps To Reproduce:

  • change in config/app this line to 'cipher' => 'XSalsa20',
  • run php artisan key:generate
  • (libsodium must be installed)

Fixes #38555

@taylorotwell taylorotwell merged commit 93bacdc into laravel:8.x Aug 26, 2021
@GrahamCampbell GrahamCampbell changed the title Keep backward compatibility with custom ciphers [8.x] Keep backward compatibility with custom ciphers Aug 26, 2021
@Krisell
Copy link
Contributor

Krisell commented Aug 27, 2021

I'm trying to understand exactly what the problem was here @AdrianPop. How are you using the XSalsa20 cipher? Are you extending the Encrypter class to add support for XSalsa20, or using the encryption key in a completely different place?

Using the default Encrypter class throws an unsupported cipher error since XSalsa20 is not in the list of Laravel's supported ciphers, and this change doesn't affect that.

This change hardcodes a key-size of 256 bits if the cipher is unknown. This might be a reasonable default, but it will certainly not be correct in all cases.

victorvilella pushed a commit to cdsistemas/framework that referenced this pull request Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Laravel 8.56.0 - Encryption library doesn't support custom cipher.
3 participants