diff options
author | tedu <tedu@openbsd.org> | 2016-06-24 17:22:56 +0000 |
---|---|---|
committer | tedu <tedu@openbsd.org> | 2016-06-24 17:22:56 +0000 |
commit | 4f66d395af37e9419d1a3ae821690c8569c0f87b (patch) | |
tree | 881ec5dd4c06792c9669f262c3a6ac326983a849 /usr.sbin/pppd | |
parent | make use of former changes. If list is higher than display go thru more. (diff) | |
download | wireguard-openbsd-4f66d395af37e9419d1a3ae821690c8569c0f87b.tar.xz wireguard-openbsd-4f66d395af37e9419d1a3ae821690c8569c0f87b.zip |
use crypt_checkpass to simplify password checking logic.
Diffstat (limited to 'usr.sbin/pppd')
-rw-r--r-- | usr.sbin/pppd/auth.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/usr.sbin/pppd/auth.c b/usr.sbin/pppd/auth.c index 6bbe5d7eff5..43773e299be 100644 --- a/usr.sbin/pppd/auth.c +++ b/usr.sbin/pppd/auth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auth.c,v 1.37 2016/05/17 20:51:56 tedu Exp $ */ +/* $OpenBSD: auth.c,v 1.38 2016/06/24 17:22:56 tedu Exp $ */ /* * auth.c - PPP authentication and phase control. @@ -741,25 +741,12 @@ plogin(user, passwd, msg, msglen) char **msg; int *msglen; { - - struct passwd *pw; char *tty; - pw = getpwnam_shadow(user); - endpwent(); - if (pw == NULL) { - return (UPAP_AUTHNAK); - } - - - /* - * If no passwd, don't let them login. - */ - if (pw->pw_passwd == NULL || *pw->pw_passwd == '\0' - || strcmp(crypt(passwd, pw->pw_passwd), pw->pw_passwd) != 0) - return (UPAP_AUTHNAK); + if (crypt_checkpass(passwd, pw ? pw->pw_passwd : NULL)) + return UPAP_AUTHNAK; /* * Write a wtmp entry for this user. |