1 /* Author: Wietse Venema, Eindhoven University of Technology. */
10 /* skey_crypt - return encrypted UNIX passwd if s/key or regular password ok */
12 const char *skey_crypt(pp
, salt
, pwd
, pwok
)
21 /* Try s/key authentication even when the UNIX password is permitted. */
23 if (pwd
!= 0 && skeyinfo(&skey
, pwd
->pw_name
, (char *) 0) == 0
24 && skeyverify(&skey
, pp
) == 0) {
25 /* s/key authentication succeeded */
26 return (pwd
->pw_passwd
);
29 /* When s/key authentication does not work, always invoke crypt(). */
32 if (pwok
&& pwd
!= 0 && strcmp(p
, pwd
->pw_passwd
) == 0)
33 return (pwd
->pw_passwd
);
35 /* The user does not exist or entered bad input. */