-
Notifications
You must be signed in to change notification settings - Fork 283
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
pam_unix: should not treat CRYPT_SALT_METHOD_LEGACY hash as expired #367
Comments
|
I have to say that I was disappointed by the libxcrypt change as well. IMO this was not well managed there. In the end it would be much better if this was handled somehow in coordination with Linux PAM project. We could drop the crypt_checksalt() call completely in pam_unix check_shadow_expiry(). It was probably not a right thing there. |
|
On Thu, Jun 10, 2021 at 07:02:58AM -0700, Tomáš Mráz wrote:
I have to say that I was disappointed by the libxcrypt change as well. IMO this was not well managed there. In the end it would be much better if this was handled somehow in coordination with Linux PAM project.
The libxcrypt change itself was OK, but ...
We could drop the crypt_checksalt() call completely in pam_unix check_shadow_expiry(). It was probably not a right thing there.
... pam_unix check_shadow_expiry() is not correct in treating
CRYPT_SALT_METHOD_LEGACY hash as expired.
|
|
libxcrypt author here. The intended meaning of CRYPT_SALT_LEGACY is " |
|
I suppose reverting commit 4da9feb would fix this issue. |
|
@ldv-alt For a quick fix, yeah. Long term I think it would be a good idea to make CRYPT_SALT_METHOD_LEGACY trigger a silent re-hash of the existing password with a stronger method, but I have no idea how to do that and also, given what happened here, I don't think that should be added without a way to turn it off (at runtime, not by recompiling PAM). This should not be done for CRYPT_SALT_TOO_CHEAP because right now there's no way to know what cost parameters would qualify as "not too cheap". Note also that checking for CRYPT_SALT_METHOD_DISABLED and CRYPT_SALT_INVALID is pointless here; hashes in those categories will be rejected by crypt(). |
|
@zackw "I don't think that should be added without a way to turn it off" I would expect that the only people who want to turn it off are those who already have configured a different hash via the options, such as: Simply honoring these settings, if present, will be sufficient. I think that anyone who does not have them can be presumed to not care what the password hash is. |
|
We decided to revert this completely. So CRYPT_SALT_METHOD_LEGACY and CRYPT_SALT_TOO_CHEAP won't cause the expiration of a password. |
|
Could you cut a 1.5.2 release with the revert included? That way distribution can easily pick it up? |
libxcrypt 4.4.22 has deprecated multiple hashes, including SHA-256, resulting in login failures for many people. The failures are uninformative:
The messages do not indicate what the real problem is and the only way I was able to figure it out was by reading the news board on my distribution's home page (Arch). The token can not be made valid if pam configuration explicitly sets the hash, as the documentation previously recommended. Until the configuration changes, logins will continue to fail. If the root partition is mounted read-only, the system will be completely unbootable.
A more informative error message is needed to tell people to change the hash setting (or, in my case, downgrade libxcrypt and blacklist its upgrades until they get over their God complex) instead of helplessly banging their heads on the keyboard.
The text was updated successfully, but these errors were encountered: