Skip to content
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: Support reading YESCRYPT_COST_FACTOR from /etc/login.defs #607

Closed
dvzrv opened this issue Sep 18, 2023 · 0 comments · Fixed by #642
Closed

pam_unix: Support reading YESCRYPT_COST_FACTOR from /etc/login.defs #607

dvzrv opened this issue Sep 18, 2023 · 0 comments · Fixed by #642

Comments

@dvzrv
Copy link

dvzrv commented Sep 18, 2023

Hi! I package PAM integration and shadow for Arch Linux.

We are currently discussing the move to yescrypt and want to rely on PAM.
As integration with shadow's /etc/login.defs will remain though, we would love to see the possibility to also retrieve rounds from YESCRYPT_COST_FACTOR in /etc/login.defs.

Currently it appears that the rounds= parameter is supported for yescrypt:

/* Enforce sane "rounds" values */
if (on(UNIX_ALGO_ROUNDS, ctrl)) {
if (on(UNIX_GOST_YESCRYPT_PASS, ctrl) ||
on(UNIX_YESCRYPT_PASS, ctrl)) {
if (*rounds < 3)
*rounds = 3;
else if (*rounds > 11)
*rounds = 11;

Seeing how an integration with /etc/login.defs is supported for SHA256 and SHA512

/* read number of rounds for crypt algo */
if (rounds && (on(UNIX_SHA256_PASS, ctrl) || on(UNIX_SHA512_PASS, ctrl))) {
val = pam_modutil_search_key(pamh, LOGIN_DEFS, "SHA_CRYPT_MAX_ROUNDS");
if (val) {
*rounds = strtol(val, NULL, 10);
set(UNIX_ALGO_ROUNDS, ctrl);
free (val);
}
}
}

it would be amazing to also be able to use the same kind of integration for yescrypt!

@ldv-alt ldv-alt changed the title Support reading YESCRYPT_COST_FACTOR from /etc/login.defs pam_unix: Support reading YESCRYPT_COST_FACTOR from /etc/login.defs Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants