From 404807039d3636a97a0337880c1339db6c8b6d1b Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Thu, 2 Sep 2021 18:11:51 -0400 Subject: OpenBSD: pledge(2) the hashPass code path --- bounce.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bounce.c b/bounce.c index 2fe6589..d8e9b87 100644 --- a/bounce.c +++ b/bounce.c @@ -577,9 +577,11 @@ int main(int argc, char *argv[]) { #ifdef __OpenBSD__ static void hashPass(void) { + int error = pledge("stdio tty", NULL); + if (error) err(EX_OSERR, "pledge"); char hash[_PASSWORD_LEN]; char *pass = getpass("Password: "); - int error = crypt_newhash(pass, "bcrypt,a", hash, sizeof(hash)); + error = crypt_newhash(pass, "bcrypt,a", hash, sizeof(hash)); if (error) err(EX_OSERR, "crypt_newhash"); printf("%s\n", hash); } -- cgit 1.4.1