257 |
if (! strncmp (hash, "$0$", 3)) |
if (! strncmp (hash, "$0$", 3)) |
258 |
{ |
{ |
259 |
/* explicit plain-text password */ |
/* explicit plain-text password */ |
260 |
return ! strcmp (password, hash+3); |
return ! match (password, hash, TRUE); |
261 |
} |
} |
262 |
else if (! strncmp (hash, "$1$", 3)) |
else |
263 |
{ |
{ |
264 |
/* MD5 hash of the password */ |
/* DES crypt or MD5 hash of the password */ |
265 |
#ifdef HAVE_LIBCRYPT |
#ifdef HAVE_LIBCRYPT |
266 |
char *encrypted = crypt (password, hash); |
char *encrypted = crypt (password, hash); |
267 |
return encrypted && ! strcmp (encrypted, hash); |
return encrypted && ! strcmp (encrypted, hash); |
270 |
return FALSE; |
return FALSE; |
271 |
#endif |
#endif |
272 |
} |
} |
|
else |
|
|
{ |
|
|
/* default password type is plain-text */ |
|
|
return match (password, hash, TRUE); |
|
|
} |
|
273 |
} |
} |
274 |
|
|
275 |
/* */ |
/* */ |