From: Ondřej Kuzník Date: Tue, 15 Apr 2025 16:43:49 +0000 (+0100) Subject: ITS#7981 Move default hash selection to slap_passwd_hash_type X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dad90d66c5c53b81fd35b6597b6dcd26224d012e;p=thirdparty%2Fopenldap.git ITS#7981 Move default hash selection to slap_passwd_hash_type --- diff --git a/servers/slapd/passwd.c b/servers/slapd/passwd.c index 942c2a2bc6..b3c357aaad 100644 --- a/servers/slapd/passwd.c +++ b/servers/slapd/passwd.c @@ -572,25 +572,26 @@ slap_passwd_hash_type( new->bv_len = 0; new->bv_val = NULL; + if ( hash == NULL ) { + if ( default_passwd_hash ) { + hash = default_passwd_hash[0]; + } + if ( !hash ) { + hash = (char *)defhash[0]; + } + } assert( hash != NULL ); lutil_passwd_hash( cred , hash, new, text ); } + void slap_passwd_hash( struct berval * cred, struct berval * new, const char **text ) { - char *hash = NULL; - if ( default_passwd_hash ) { - hash = default_passwd_hash[0]; - } - if ( !hash ) { - hash = (char *)defhash[0]; - } - - slap_passwd_hash_type( cred, new, hash, text ); + slap_passwd_hash_type( cred, new, NULL, text ); } #ifdef SLAPD_CRYPT