about summary refs log tree commit diff
path: root/src/liboutils/getentropy_linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/liboutils/getentropy_linux.c')
-rw-r--r--src/liboutils/getentropy_linux.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/liboutils/getentropy_linux.c b/src/liboutils/getentropy_linux.c
index f0e3d40..adfd2fe 100644
--- a/src/liboutils/getentropy_linux.c
+++ b/src/liboutils/getentropy_linux.c
@@ -47,7 +47,7 @@
 #include <errno.h>
 #include <unistd.h>
 #include <time.h>
-#include <openssl/sha.h>
+#include <sha2.h>
 
 #include <linux/types.h>
 #include <linux/random.h>
@@ -67,9 +67,9 @@
 			HD(b); \
 	} while (0)
 
-#define HR(x, l) (SHA512_Update(&ctx, (char *)(x), (l)))
-#define HD(x)	 (SHA512_Update(&ctx, (char *)&(x), sizeof (x)))
-#define HF(x)    (SHA512_Update(&ctx, (char *)&(x), sizeof (void*)))
+#define HR(x, l) (SHA512Update(&ctx, (void *)(x), (l)))
+#define HD(x)	 (SHA512Update(&ctx, (void *)&(x), sizeof (x)))
+#define HF(x)    (SHA512Update(&ctx, (void *)&(x), sizeof (void*)))
 
 int	getentropy(void *buf, size_t len);
 
@@ -327,9 +327,9 @@ static const int cl[] = {
 static int
 getentropy_phdr(struct dl_phdr_info *info, size_t size, void *data)
 {
-	SHA512_CTX *ctx = data;
+	SHA2_CTX *ctx = data;
 
-	SHA512_Update(ctx, &info->dlpi_addr, sizeof (info->dlpi_addr));
+	SHA512Update(ctx, (void *)&info->dlpi_addr, sizeof (info->dlpi_addr));
 	return (0);
 }
 
@@ -344,7 +344,7 @@ getentropy_fallback(void *buf, size_t len)
 	struct rusage ru;
 	sigset_t sigset;
 	struct stat st;
-	SHA512_CTX ctx;
+	SHA2_CTX ctx;
 	static pid_t lastpid;
 	pid_t pid;
 	size_t i, ii, m;
@@ -361,7 +361,7 @@ getentropy_fallback(void *buf, size_t len)
 	}
 	for (i = 0; i < len; ) {
 		int j;
-		SHA512_Init(&ctx);
+		SHA512Init(&ctx);
 		for (j = 0; j < repeat; j++) {
 			HX((e = gettimeofday(&tv, NULL)) == -1, tv);
 			if (e != -1) {
@@ -532,7 +532,7 @@ getentropy_fallback(void *buf, size_t len)
 #endif
 #endif
 
-		SHA512_Final(results, &ctx);
+		SHA512Final(results, &ctx);
 		memcpy((char *)buf + i, results, min(sizeof(results), len - i));
 		i += min(sizeof(results), len - i);
 	}