summaryrefslogtreecommitdiffstats
path: root/libexec/login_reject
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2014-11-03 16:50:20 +0000
committertedu <tedu@openbsd.org>2014-11-03 16:50:20 +0000
commitf5f8e4ba2915ebf7e6c0fe5fcc560cf9151cfc84 (patch)
tree720ce86a8cffba0601cc1c4bacf2ecf67e11fc4a /libexec/login_reject
parenthoist blowfish up and use bcrypt_newhash directly (diff)
downloadwireguard-openbsd-f5f8e4ba2915ebf7e6c0fe5fcc560cf9151cfc84.tar.xz
wireguard-openbsd-f5f8e4ba2915ebf7e6c0fe5fcc560cf9151cfc84.zip
reduce dependency on passwd. just call bcrypt_newhash to do the dummy work.
Diffstat (limited to 'libexec/login_reject')
-rw-r--r--libexec/login_reject/Makefile5
-rw-r--r--libexec/login_reject/login_reject.c12
2 files changed, 5 insertions, 12 deletions
diff --git a/libexec/login_reject/Makefile b/libexec/login_reject/Makefile
index 211059d6a2b..1779f58692b 100644
--- a/libexec/login_reject/Makefile
+++ b/libexec/login_reject/Makefile
@@ -1,10 +1,9 @@
-# $OpenBSD: Makefile,v 1.2 2006/03/09 19:14:10 millert Exp $
+# $OpenBSD: Makefile,v 1.3 2014/11/03 16:50:20 tedu Exp $
PROG= login_reject
-SRCS= login_reject.c pwd_gensalt.c
+SRCS= login_reject.c
MAN= login_reject.8
CFLAGS+=-Wall
-.PATH: ${.CURDIR}/../../usr.bin/passwd
BINOWN= root
BINGRP= auth
diff --git a/libexec/login_reject/login_reject.c b/libexec/login_reject/login_reject.c
index 0c99873b884..167bd952a10 100644
--- a/libexec/login_reject/login_reject.c
+++ b/libexec/login_reject/login_reject.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login_reject.c,v 1.9 2012/12/04 02:24:47 deraadt Exp $ */
+/* $OpenBSD: login_reject.c,v 1.10 2014/11/03 16:50:20 tedu Exp $ */
/*-
* Copyright (c) 1995 Berkeley Software Design, Inc. All rights reserved.
@@ -51,15 +51,12 @@
#include <syslog.h>
#include <unistd.h>
-extern int pwd_gensalt(char *, int, login_cap_t *, char);
-
int
main(int argc, char *argv[])
{
struct rlimit rl;
- login_cap_t *lc;
FILE *back;
- char passbuf[1], salt[_PASSWORD_LEN + 1];
+ char passbuf[1], hash[_PASSWORD_LEN + 1];
int mode = 0, c;
rl.rlim_cur = 0;
@@ -123,10 +120,7 @@ main(int argc, char *argv[])
} else
getpass("Password:");
- if ((lc = login_getclass(NULL)) == NULL ||
- pwd_gensalt(salt, sizeof(salt), lc, 'l') == 0)
- strlcpy(salt, "xx", sizeof(salt));
- crypt("password", salt);
+ bcrypt_newhash("password", 8, hash, sizeof(hash));
fprintf(back, BI_REJECT "\n");
exit(1);