2 * $DragonFly: src/secure/usr.sbin/sshd/auth-passwd-freebsd.c,v 1.1 2004/07/31 20:05:00 geekgod Exp $
10 sys_auth_passwd(Authctxt *authctxt, const char *password)
12 struct passwd *pw = authctxt->pw;
13 char *encrypted_password;
14 char *pw_password = pw->pw_passwd;
16 /* Check for users with no password. */
17 if (strcmp(pw_password, "") == 0 && strcmp(password, "") == 0)
20 /* Encrypt the candidate password using the proper salt. */
21 encrypted_password = crypt(password,
22 (pw_password[0] && pw_password[1]) ? pw_password : "xx");
25 * Authentication is accepted if the encrypted passwords
28 return (strcmp(encrypted_password, pw_password) == 0);