Class 'Base32\Base32' not found - switch library to paragonie/constant_time_encoding

Created on 9 November 2017, about 7 years ago
Updated 6 January 2025, 2 days ago

This relates to multiple issues already in various project queues:

#2880601: Class Base32\Base32 not found: caused by deprecated Base32 library usage β†’
#2866841: Add base32 dependency to composer.json? β†’

Not sure of the desired approach to the Base32 class issue, but this patch is in support of the patch available on #2880601 - which is a switch to the paragonie/constant_time_encoding library.

Feedback appreciated and welcome.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States daggerhart

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • We were experiencing the following error on our D10.3.10 site with TFA on 8.x-1.9 (full stack trace to follow in image at bottom):

    Error: Class "ParagonIE\ConstantTime\Encoding" not found in Drupal\tfa\Plugin\TfaValidation\TfaTotpValidation->validate() (line 316 of modules/contrib/tfa/src/Plugin/TfaValidation/TfaTotpValidation.php).

    We fixed it by requiring 'paragonie/constant_time_encoding' on the whole project, but really it seems to me from reading through this issue and the other related issues sprouting from/to it (principally TFA issue #2866841 β†’ and Google Authenticator issue #2880601 β†’ ) that said dependency should be brought into the codebase just by TFA itself. Hence, I added it to the composer.json and raised this merge request. I've tested it locally and it works, though I accept there may be some reason it was excluded or some other better solution - please do let me know if so.

    Finally, I did and still do wonder why nobody else has reported the problem we had, that I could find anyway, especially seeing as this closed issue is so many years old now. My only guess so far is that all other projects in similar circumstances already have something else in their codebase pulling in the dependency. Any other ideas? Apologies if I've missed something glaringly obvious and many thanks in advance for any assistance or further info.

    Full error:

  • πŸ‡ΊπŸ‡ΈUnited States cmlara

    @seeduardo:

    I suggest opening a new issue as this one was closed as fixed years ago.

  • Many thanks @cmlara, I actually have already created issue #3498141 πŸ› ParagonIE\ConstantTime\Encoding dependency not installed from TFA Needs review - I thought that by raising the merge request here, it would reopen the issue, but then realized only module maintainers can do that, and didn't have the time to create the new issue until now. Thanks anyway for your comment and I don't suppose you have any input on the matter, particularly whether the change is correct or why the issue appears to have gone undetected (if even worthy of note now) for 7+ years?

    I guess now that the link to the new issue is in this comment and the link to this issue is in the description of the new one, I will stop posting here - apologies if I've created any unnecessary noise for anyone up till now.

Production build 0.71.5 2024