diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-01-14 21:34:31 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-01-14 21:34:31 +0000 |
commit | 23b2746ea3f90ca857d4fd5387efa24da174355c (patch) | |
tree | 8f1b7abccb348e2017324c137bffa4707905bdd1 /usr.bin/signify/signify.c | |
parent | bc9b06950f7646205f50f81f78be78d11bd9be64 (diff) |
most common pbkdf failure is no password, so check that first.
prompted by fritjof
Diffstat (limited to 'usr.bin/signify/signify.c')
-rw-r--r-- | usr.bin/signify/signify.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/signify/signify.c b/usr.bin/signify/signify.c index a4e5bc2c9e9..9bc6bacedc9 100644 --- a/usr.bin/signify/signify.c +++ b/usr.bin/signify/signify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: signify.c,v 1.36 2014/01/14 21:33:10 tedu Exp $ */ +/* $OpenBSD: signify.c,v 1.37 2014/01/14 21:34:30 tedu Exp $ */ /* * Copyright (c) 2013 Ted Unangst <tedu@openbsd.org> * @@ -251,6 +251,8 @@ kdf(uint8_t *salt, size_t saltlen, int rounds, uint8_t *key, size_t keylen) if (!readpassphrase("passphrase: ", pass, sizeof(pass), 0)) errx(1, "readpassphrase"); + if (strlen(pass) == 0) + errx(1, "please provide a password"); if (bcrypt_pbkdf(pass, strlen(pass), salt, saltlen, key, keylen, rounds) == -1) errx(1, "bcrypt pbkdf"); |