]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
juste use fr_hash() instead of hand-rolled hash from 2002
authorAlan T. DeKok <aland@freeradius.org>
Fri, 17 Mar 2023 13:20:00 +0000 (09:20 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 17 Mar 2023 13:20:00 +0000 (09:20 -0400)
src/modules/rlm_passwd/rlm_passwd.c

index 77c65e08380b93e682666faa39e3281dfe7cef9d..cae5f0b254e0be86aa2bf61534d499a0a1b9fabf 100644 (file)
@@ -123,10 +123,8 @@ static void destroy_password (struct mypasswd * pass)
 
 static unsigned int hash(char const * username, unsigned int tablesize)
 {
-       int h=1;
-       while (*username) {
-               h = h * 7907 + *username++;
-       }
+       uint32_t h = fr_hash_string(username);
+
        return h%tablesize;
 }