-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
PASSWORD_ARGON2ID is a conditional constant #73
Comments
Oh, dang, forgot about that. I think uses the ints instead of the constant would solve it:
|
You're right. I understood it came by default with php 7.2. Lonnie, not quite. If it's not compiled with ARGON2I support, it won't matter If you use ints or the constant name. I just won't work as it will not know the algorithm to use. Will check the condition to load ARGON2i if it has support, and maybe default to BCRYPT or DEFAULT if it doesn't. |
BTW, Argon2i comes as of PHP 7.2 and Argon2iD as of PHP 7.3 |
I'm on 7.2.19 and got the error. I think a fresh install might include it by default but upgrades from previous PHP versions not compiled with the support won't add it. Just a guess though |
Yes, I meant the possibility of having it :) |
Oh! Sorry, misunderstood. It does appear to be compiled by default at some point, best as I can tell. Pretty new library so not a lot of clear info on it. |
What do you think about defaulting to BCRYPT instead of DEFAULT? |
What is the issue with defaulting to DEFAULT? I believe in most (all?) versions of PHP that's Bcrypt anyway. If the system has a different one set (or a new PHP version is installed that defaults to a different algo) then Myth:Auth upgrades the passwords for them. |
Something like: in Auth config and in User Entity |
True Lonnie, I got carried away :) |
You can’t even use the constant |
Exactly, in which case |
Yes but the config file will fail to load if you have this: |
Ok, so maybe it's better to ship it with DEFAULT as default value, but keep the User Entity changes in case it has support and admin choses to set it in config |
Nope, true problem is we cannot use a conditional in a class definition (Auth) so there's no way to check if there's support for these constants. |
I think this would work:
But I think it would also be a fine solution to ship with |
Not sure, it may become complex if you take into account ARGON2ID as well. One too many if's |
Would look like this
|
Won't work. |
Found the issue. Will pr in a minute |
Corrected in fix #74 |
Confirmed working! Thanks for the quick PR |
#68 introduced alternate hashing algorithms, but the constant PASSWORD_ARGON2ID is only available if PHP has been compiled with Argon2 support, not a current requirement for Myth:Auth or CodeIgniter4. This causes syntax errors when trying to load the config file or using the User entity or LocalAuthenticator.
Either backing out the changes for Argon2 or adding some conditional constant definition?
The text was updated successfully, but these errors were encountered: