diff options
-rw-r--r-- | modules/pam_unix/support.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/pam_unix/support.c b/modules/pam_unix/support.c index 043273d2..7bed0a56 100644 --- a/modules/pam_unix/support.c +++ b/modules/pam_unix/support.c @@ -189,11 +189,15 @@ unsigned long long _set_ctrl(pam_handle_t *pamh, int flags, int *remember, if (on(UNIX_ALGO_ROUNDS, ctrl)) { if (on(UNIX_GOST_YESCRYPT_PASS, ctrl) || on(UNIX_YESCRYPT_PASS, ctrl)) { - if (*rounds < 3 || *rounds > 11) - *rounds = 5; + if (*rounds < 3) + *rounds = 3; + else if (*rounds > 11) + *rounds = 11; } else if (on(UNIX_BLOWFISH_PASS, ctrl)) { - if (*rounds < 4 || *rounds > 31) - *rounds = 5; + if (*rounds < 4) + *rounds = 4; + else if (*rounds > 31) + *rounds = 31; } else if (on(UNIX_SHA256_PASS, ctrl) || on(UNIX_SHA512_PASS, ctrl)) { if ((*rounds < 1000) || (*rounds == INT_MAX)) { /* don't care about bogus values */ |