From 1647478f3979529e2e72e5aabf65719e0826c71d Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Fri, 17 Mar 2023 09:20:00 -0400 Subject: [PATCH] juste use fr_hash() instead of hand-rolled hash from 2002 --- src/modules/rlm_passwd/rlm_passwd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modules/rlm_passwd/rlm_passwd.c b/src/modules/rlm_passwd/rlm_passwd.c index 77c65e0838..cae5f0b254 100644 --- a/src/modules/rlm_passwd/rlm_passwd.c +++ b/src/modules/rlm_passwd/rlm_passwd.c @@ -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; } -- 2.47.2