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
There was a problem hiding this comment.
#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
|
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: |
rnhmjoj
left a comment
There was a problem hiding this comment.
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
fpletz
left a comment
There was a problem hiding this comment.
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 = trueset 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/)