diff options
| author | Mark Murray <markm@FreeBSD.org> | 2001-07-09 17:52:34 +0000 |
|---|---|---|
| committer | Mark Murray <markm@FreeBSD.org> | 2001-07-09 17:52:34 +0000 |
| commit | ccdee0d9f476bf08d0ad27677d3ec2b679f2d2ee (patch) | |
| tree | dfb18c225b48df272ea8a82f1e00b304e618defc /lib/libskey/skey_crypt.c | |
| parent | 132463cacbbcd07c722f56715f0cd33eb0732666 (diff) | |
Notes
Diffstat (limited to 'lib/libskey/skey_crypt.c')
| -rw-r--r-- | lib/libskey/skey_crypt.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/lib/libskey/skey_crypt.c b/lib/libskey/skey_crypt.c deleted file mode 100644 index 4e3a141333a5..000000000000 --- a/lib/libskey/skey_crypt.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Author: Wietse Venema, Eindhoven University of Technology. */ - -#include <string.h> -#include <stdio.h> -#include <pwd.h> -#include <unistd.h> - -#include "skey.h" - -/* skey_crypt - return encrypted UNIX passwd if s/key or regular password ok */ - -const char *skey_crypt(pp, salt, pwd, pwok) -char *pp; -char *salt; -struct passwd *pwd; -int pwok; -{ - struct skey skey; - char *p; - - /* Try s/key authentication even when the UNIX password is permitted. */ - - if (pwd != 0 && skeyinfo(&skey, pwd->pw_name, (char *) 0) == 0 - && skeyverify(&skey, pp) == 0) { - /* s/key authentication succeeded */ - return (pwd->pw_passwd); - } - - /* When s/key authentication does not work, always invoke crypt(). */ - - p = crypt(pp, salt); - if (pwok && pwd != 0 && strcmp(p, pwd->pw_passwd) == 0) - return (pwd->pw_passwd); - - /* The user does not exist or entered bad input. */ - - return (":"); -} |
