-
Notifications
You must be signed in to change notification settings - Fork 103
Issue 6516 - Allow to configure the password scheme not updated on bind #6517
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
Conversation
| @@ -132,6 +146,159 @@ def test_password_modify_non_utf8(topology_st, pbkdf2_sha512_scheme): | |||
|
|
|||
| log.info('test_password_modify_non_utf8: PASSED') | |||
|
|
|||
| def test_pwd_scheme_not_upgraded_on_bind(topology_st, crypt_scheme, request): | |||
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.
FYI: since test_pwd_scheme_not_upgraded_on_bind and test_pwd_scheme_crypt_upgraded_on_bind are very similar, I think you should rather have a single parametrized test
each parameter values being a tuple (no_upgrade_hash_value, expected_hash_after_bind)
ldap/servers/slapd/pw.c
Outdated
| /* values are comma separated list. Add heading/ending commas | ||
| * to retrieve the exact current hash in that list | ||
| */ | ||
| no_upgrade_hashes = slapi_ch_smprintf(",%s,", slapdFrontendConfig->scheme_list_no_upgrade_hash); |
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.
Nice trick. FYI you could also keep the configuration parameter as is and use strtok_r to parse it:
char *saveptr = NULL;
no_upgrade_hashes = slapi_ch_strdup(slapdFrontendConfig->scheme_list_no_upgrade_hash);
for (char *hash = strtok_r(no_upgrade_hashes, ", \t\n", &saveptr);
hash;
hash = strtok_r(NULL, ", \t\n", &saveptr)) {
if strcasecmp(hash, curpwsp->pws_name) == )) {
ignore_upgrade = 1;
break;
}
}
slapi_ch_free_string(&no_upgrade_hashes);
Bug description: The configuration option 'nsslapd-enable-upgrade-hash: on' allows to update, during a user bind, the password storage hash of the user password. The update sets the password storage hash to the one defined in the password policy (passwordStorageScheme) If the current user password hash is 'CRYPT' or 'CLEAR' then the password storage hash is not updated. This is hardcoded. Fix description: Introduce a new configuration parameter that list the hashes that are *not* upgraded during a bind. 'nsslapd-scheme-list-no-upgrade-hash' fixes: 389ds#6516 Reviewed by: Pierre Rogier
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.
LGTM
…nd (#6517) Bug description: The configuration option 'nsslapd-enable-upgrade-hash: on' allows to update, during a user bind, the password storage hash of the user password. The update sets the password storage hash to the one defined in the password policy (passwordStorageScheme) If the current user password hash is 'CRYPT' or 'CLEAR' then the password storage hash is not updated. This is hardcoded. Fix description: Introduce a new configuration parameter that list the hashes that are *not* upgraded during a bind. 'nsslapd-scheme-list-no-upgrade-hash' fixes: #6516 Reviewed by: Pierre Rogier
…nd (#6517) Bug description: The configuration option 'nsslapd-enable-upgrade-hash: on' allows to update, during a user bind, the password storage hash of the user password. The update sets the password storage hash to the one defined in the password policy (passwordStorageScheme) If the current user password hash is 'CRYPT' or 'CLEAR' then the password storage hash is not updated. This is hardcoded. Fix description: Introduce a new configuration parameter that list the hashes that are *not* upgraded during a bind. 'nsslapd-scheme-list-no-upgrade-hash' fixes: #6516 Reviewed by: Pierre Rogier
Bug description:
The configuration option 'nsslapd-enable-upgrade-hash: on' allows
to update, during a user bind, the password storage hash of the
user password.
The update sets the password storage hash to the one defined in the
password policy (passwordStorageScheme)
Fix description:
Introduce a new configuration parameter that list the hashes
that are not upgraded during a bind.
'nsslapd-scheme-list-no-upgrade-hash'
fixes: #6516
Reviewed by: