summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2015-01-08 01:28:56 +0000
committerderaadt <deraadt@openbsd.org>2015-01-08 01:28:56 +0000
commit612acb8ca5c33e9cf9eac8d7d206680dcc2a4690 (patch)
tree551d2788bd22f547a80cd01590bb85c9613343dc
parentUse the correct config registers for the RTL8139 family. Unlike the RTL8169 (diff)
downloadwireguard-openbsd-612acb8ca5c33e9cf9eac8d7d206680dcc2a4690.tar.xz
wireguard-openbsd-612acb8ca5c33e9cf9eac8d7d206680dcc2a4690.zip
declare a local version of MIN(), call it MINIMUM()
(sorry, my other changes were accidentally premature)
-rw-r--r--lib/libutil/pkcs5_pbkdf2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libutil/pkcs5_pbkdf2.c b/lib/libutil/pkcs5_pbkdf2.c
index bd66339b004..f5a2cd710d5 100644
--- a/lib/libutil/pkcs5_pbkdf2.c
+++ b/lib/libutil/pkcs5_pbkdf2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pkcs5_pbkdf2.c,v 1.7 2015/01/07 21:34:23 deraadt Exp $ */
+/* $OpenBSD: pkcs5_pbkdf2.c,v 1.8 2015/01/08 01:28:56 deraadt Exp $ */
/*-
* Copyright (c) 2008 Damien Bergamini <damien.bergamini@free.fr>
@@ -25,6 +25,8 @@
#include <sha1.h>
+#define MINIMUM(a,b) (((a) < (b)) ? (a) : (b))
+
/*
* HMAC-SHA-1 (from RFC 2202).
*/
@@ -105,7 +107,7 @@ pkcs5_pbkdf2(const char *pass, size_t pass_len, const uint8_t *salt,
obuf[j] ^= d1[j];
}
- r = MIN(key_len, SHA1_DIGEST_LENGTH);
+ r = MINIMUM(key_len, SHA1_DIGEST_LENGTH);
memcpy(key, obuf, r);
key += r;
key_len -= r;