summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/libbsd/libbsd/0001-Use-local-SHA512-header.patch
blob: af47b2baba8dff0c78e0574ece9230e8db5e9ea8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
From 8493c7f27da2dcd2de71e9c7782c3d020d89c2a2 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@hadrons.org>
Date: Tue, 1 Dec 2015 03:39:10 +0100
Subject: [PATCH] Use local SHA512 header

Actually use the local private SHA512 header instead of relying on the
OpenSSL one for no good reason. Add definition for expected macro
SHA512_DIGEST_LENGTH.

Signed-off-by: Marek Vasut <marex@denx.de>
Upstream-Status: Backport
---
 src/getentropy_aix.c   | 2 +-
 src/getentropy_hpux.c  | 3 ++-
 src/getentropy_linux.c | 3 ++-
 src/hash/sha512.h      | 2 ++
 4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/getentropy_aix.c b/src/getentropy_aix.c
index cbd4037..d4ccab7 100644
--- a/src/getentropy_aix.c
+++ b/src/getentropy_aix.c
@@ -39,7 +39,7 @@
 #include <string.h>
 #include <termios.h>
 
-#include <openssl/sha.h>
+#include "hash/sha512.h"
 
 #include <libperfstat.h>
 
diff --git a/src/getentropy_hpux.c b/src/getentropy_hpux.c
index 45ac84b..294d83a 100644
--- a/src/getentropy_hpux.c
+++ b/src/getentropy_hpux.c
@@ -41,7 +41,8 @@
 #include <errno.h>
 #include <unistd.h>
 #include <time.h>
-#include <openssl/sha.h>
+
+#include "hash/sha512.h"
 
 #include <sys/vfs.h>
 
diff --git a/src/getentropy_linux.c b/src/getentropy_linux.c
index 0a5d6b8..d7a8ae5 100644
--- a/src/getentropy_linux.c
+++ b/src/getentropy_linux.c
@@ -47,7 +47,8 @@
 #include <errno.h>
 #include <unistd.h>
 #include <time.h>
-#include <openssl/sha.h>
+
+#include "hash/sha512.h"
 
 #include <linux/types.h>
 #include <linux/random.h>
diff --git a/src/hash/sha512.h b/src/hash/sha512.h
index 43c5aaf..4f368a1 100644
--- a/src/hash/sha512.h
+++ b/src/hash/sha512.h
@@ -31,6 +31,8 @@
 
 #include <sys/types.h>
 
+#define SHA512_DIGEST_LENGTH		64
+
 typedef struct SHA512Context {
 	uint64_t state[8];
 	uint64_t count[2];
-- 
2.6.2