diff options
author | 2013-06-04 15:55:50 +0000 | |
---|---|---|
committer | 2013-06-04 15:55:50 +0000 | |
commit | 6eea545018cf8f4d4e7efa76bb79d520a5cf44f2 (patch) | |
tree | 4e67268a3fe5b45e41c3d18d3e11aee5678dc899 | |
parent | oops, rounds is unsigned now (diff) | |
download | wireguard-openbsd-6eea545018cf8f4d4e7efa76bb79d520a5cf44f2.tar.xz wireguard-openbsd-6eea545018cf8f4d4e7efa76bb79d520a5cf44f2.zip |
revert. check is < 1, not < 0.
-rw-r--r-- | lib/libutil/bcrypt_pbkdf.c | 4 |
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; |