diff options
author | June McEnroe <june@causal.agency> | 2020-08-27 18:23:58 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2020-08-27 18:23:58 -0400 |
commit | 76f1d0775b52e7a8a1c322214836cde530117512 (patch) | |
tree | 5b0850d4cb7eabaa2c927e02c3bb4055d5237c47 /bounce.c | |
parent | Remove rc scripts (diff) | |
download | pounce-76f1d0775b52e7a8a1c322214836cde530117512.tar.gz pounce-76f1d0775b52e7a8a1c322214836cde530117512.zip |
Add support for OpenBSD
Diffstat (limited to '')
-rw-r--r-- | bounce.c | 10 |
1 files changed, 10 insertions, 0 deletions
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, '/'); |