-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
libxcrypt: Build only with strong hashes #220557
Conversation
It does not validate the used scheme value so far, and I don't have the energy to make it do that. |
Updated the validation for |
5ea8726
to
dcbe1a8
Compare
# must match the labels of hashes enabled in libxcrypt | ||
id = "(y|gy|7|2b|2y|2a|6)"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#name h_prefix nrbytes flags
yescrypt $y$ 16 STRONG,DEFAULT,ALT,DEBIAN,FEDORA
gost_yescrypt $gy$ 16 STRONG,ALT
scrypt $7$ 16 STRONG
bcrypt $2b$ 16 STRONG,DEFAULT,ALT,FREEBSD,NETBSD,OPENBSD,OWL,SOLARIS,SUSE
bcrypt_y $2y$ 16 STRONG,ALT,OWL,SUSE
bcrypt_a $2a$ 16 STRONG,ALT,FREEBSD,NETBSD,OPENBSD,OWL,SOLARIS,SUSE
sha512crypt $6$ 15 STRONG,DEFAULT,GLIBC,FREEBSD,SOLARIS
https://github.com/besser82/libxcrypt/blob/v4.4.33/lib/hashes.conf#L41
Tested with a sha256-crypt hash, and it does complain alright. Migated to yescrypt and the warning was gone.
|
06ec4e9
to
a83ea1a
Compare
74ac1c1
to
f22ccb4
Compare
2b15b32
to
aecd1b0
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/breaking-changes-announcement-for-unstable/17574/21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good but I can't properly test this right now.
Anyway, glad to see we're finally using modern hashing schemes.
a74ed2a
to
c49ed58
Compare
Effectively removes support for the following hashing algorithms as announced in the NixOS 22.11 release notes: - bcrypt_x ($2x$) - sha256crypt ($5$) - sha1crypt ($sha1$) - sunmd5 ($md5$) - md5crypt ($1$) - nt ($3$) - bdiscrypt (_) - bigcrypt (:) - descrypt (:) And exposes the crypt scheme ids for enabled algorithms, so they can be reused for validation in the users-groups module.
Updates the warnings message for statefully set up passwords, now that weak algorithms have been removed from our libxcrypt package. Additionall we now add proper validation for hashing schemes used in `hashedPassword`. Neither will prevent a rebuiild, but instead issue a warning, that this requires immediate remediation, or else users will be unable to login. Reuses the crypt scheme ids as provided by the libxcrypt package.
Our PAM configuration now defaults to yescrypt, which requires libxcrypt.
This ensures `passwd` will default to yescrypt for newly generated passwords.
c49ed58
to
4472cf4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not tested yet but the diff looks fine! 👍
|
Generally I can imagine options around updating, fixing or disabling tests and maybe even using This change is part of the current |
I see that |
Nice to avoid these legacy hashes btw. 👍 |
I continue to think this should be configurable, see #208603 |
Effectively removes support for the following hashing algorithms as announced in the NixOS 22.11 release notes:
Passthru tests (login, shadow) built on aarch64-linux and x86_64-linux.
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)