summaryrefslogtreecommitdiffstats
path: root/compat
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2017-10-05 14:53:11 +0100
committerRoy Marples <roy@marples.name>2017-10-05 14:53:11 +0100
commite61528afd6ce1f60681a7f9f2c9eefde1ee0c318 (patch)
tree9eab351b8f5c1e70701a27e95e021bd89cfb0e63 /compat
parent208b6838cbaea0d565df79b4796f887255a72818 (diff)
downloaddhcpcd-e61528afd6ce1f60681a7f9f2c9eefde1ee0c318.tar.xz
Fix compile on Illumos.
Diffstat (limited to 'compat')
-rw-r--r--compat/crypt/hmac.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/compat/crypt/hmac.c b/compat/crypt/hmac.c
index 52f38544..55e331ff 100644
--- a/compat/crypt/hmac.c
+++ b/compat/crypt/hmac.c
@@ -34,10 +34,8 @@
#include "config.h"
-#ifdef HAVE_MD5_H
-# ifndef DEPGEN
-# include <md5.h>
-# endif
+#if defined(HAVE_MD5_H) && !defined(DEPGEN)
+#include <md5.h>
#endif
#ifdef SHA2_H
@@ -45,7 +43,7 @@
#endif
#ifndef __arraycount
-# define __arraycount(__x) (sizeof(__x) / sizeof(__x[0]))
+#define __arraycount(__x) (sizeof(__x) / sizeof(__x[0]))
#endif
#if 0
@@ -57,6 +55,13 @@
#include <sha2.h>
#endif
+#ifndef MD5_BLOCK_LENGTH
+#define MD5_BLOCK_LENGTH 64
+#endif
+#ifndef SHA256_BLOCK_LENGTH
+#define SHA256_BLOCK_LENGTH 64
+#endif
+
#define HMAC_SIZE 128
#define HMAC_IPAD 0x36
#define HMAC_OPAD 0x5C