From 76f1d0775b52e7a8a1c322214836cde530117512 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Thu, 27 Aug 2020 18:23:58 -0400 Subject: Add support for OpenBSD --- bounce.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bounce.c') diff --git a/bounce.c b/bounce.c index 95e3711..924a01b 100644 --- a/bounce.c +++ b/bounce.c @@ -64,6 +64,15 @@ bool verbose; +#ifdef __OpenBSD__ +static void hashPass(void) { + char hash[_PASSWORD_LEN]; + char *pass = getpass("Password: "); + int error = crypt_newhash(pass, "bcrypt,a", hash, sizeof(hash)); + if (error) err(EX_OSERR, "crypt_newhash"); + printf("%s\n", hash); +} +#else static void hashPass(void) { byte rand[12]; int error = getentropy(rand, sizeof(rand)); @@ -75,6 +84,7 @@ static void hashPass(void) { char *pass = getpass("Password: "); printf("%s\n", crypt(pass, salt)); } +#endif static void genReq(const char *path) { const char *name = strrchr(path, '/'); -- cgit 1.4.1