summaryrefslogtreecommitdiff
path: root/lib/libutil
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2013-06-04 15:55:51 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2013-06-04 15:55:51 +0000
commit9e05e89364efd3aa7956c7e95924a3159bc4dec1 (patch)
tree05921d1d0802ab46fef9aaad79b09459c6f07279 /lib/libutil
parentdac12a7a17482a4b9a2bcaa2b925528d420a9f5f (diff)
revert. check is < 1, not < 0.
Diffstat (limited to 'lib/libutil')
-rw-r--r--lib/libutil/bcrypt_pbkdf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libutil/bcrypt_pbkdf.c b/lib/libutil/bcrypt_pbkdf.c
index 24b628cc3f4..28339039371 100644
--- a/lib/libutil/bcrypt_pbkdf.c
+++ b/lib/libutil/bcrypt_pbkdf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcrypt_pbkdf.c,v 1.2 2013/06/04 15:54:32 tedu Exp $ */
+/* $OpenBSD: bcrypt_pbkdf.c,v 1.3 2013/06/04 15:55:50 tedu Exp $ */
/*
* Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>
*
@@ -107,6 +107,8 @@ bcrypt_pbkdf(const char *pass, size_t passlen, const uint8_t *salt, size_t saltl
uint32_t count;
/* nothing crazy */
+ if (rounds < 1)
+ return -1;
if (passlen == 0 || saltlen == 0 || keylen == 0 ||
keylen > sizeof(out) * sizeof(out))
return -1;