-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathnettle.patch
145 lines (130 loc) · 3.01 KB
/
nettle.patch
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# Written and placed in public domain by Jeffrey Walton.
# This patch fixes some issues with Nettle.
--- run-tests
+++ run-tests
@@ -44,6 +44,13 @@
export WINEPATH
fi
+nettle_libdir=`dirname $PWD`/.lib
+LD_LIBRARY_PATH=$nettle_libdir
+DYLD_LIBRARY_PATH=$nettle_libdir
+
+export LD_LIBRARY_PATH
+export DYLD_LIBRARY_PATH
+
# When used in make rules, we sometimes get the filenames VPATH
# expanded, but usually not.
find_program () {
--- testsuite/nettle-pbkdf2-test
+++ testsuite/nettle-pbkdf2-test
@@ -4,6 +4,13 @@
srcdir=`pwd`
fi
+nettle_libdir=`dirname $PWD`/.lib
+LD_LIBRARY_PATH=$nettle_libdir
+DYLD_LIBRARY_PATH=$nettle_libdir
+
+export LD_LIBRARY_PATH
+export DYLD_LIBRARY_PATH
+
test_pbkdf2 () {
password="$1"
salt="$2"
--- testsuite/sexp-conv-test
+++ testsuite/sexp-conv-test
@@ -4,6 +4,13 @@
srcdir=`pwd`
fi
+nettle_libdir=`dirname $PWD`/.lib
+LD_LIBRARY_PATH=$nettle_libdir
+DYLD_LIBRARY_PATH=$nettle_libdir
+
+export LD_LIBRARY_PATH
+export DYLD_LIBRARY_PATH
+
print_raw () {
printf "%s" "$1" > "$2"
}
--- testsuite/pkcs1-conv-test
+++ testsuite/pkcs1-conv-test
@@ -4,6 +4,13 @@
srcdir=`pwd`
fi
+nettle_libdir=`dirname $PWD`/.lib
+LD_LIBRARY_PATH=$nettle_libdir
+DYLD_LIBRARY_PATH=$nettle_libdir
+
+export LD_LIBRARY_PATH
+export DYLD_LIBRARY_PATH
+
[ -x ../tools/pkcs1-conv$EXEEXT ] || exit 77
# Private RSA key, generated by openssl
--- examples/setup-env
+++ examples/setup-env
@@ -2,6 +2,13 @@
set -e
+nettle_libdir=`dirname $PWD`/.lib
+LD_LIBRARY_PATH=$nettle_libdir
+DYLD_LIBRARY_PATH=$nettle_libdir
+
+export LD_LIBRARY_PATH
+export DYLD_LIBRARY_PATH
+
if [ -x rsa-keygen$EXEEXT ] ; then
$EMULATOR ./rsa-keygen -r rsa-decrypt$EXEEXT -o testkey || exit 1
fi
--- examples/rsa-encrypt-test
+++ examples/rsa-encrypt-test
@@ -4,6 +4,13 @@
srcdir=`pwd`
fi
+nettle_libdir=`dirname $PWD`/.lib
+LD_LIBRARY_PATH=$nettle_libdir
+DYLD_LIBRARY_PATH=$nettle_libdir
+
+export LD_LIBRARY_PATH
+export DYLD_LIBRARY_PATH
+
data="$srcdir/nettle-benchmark.c"
if [ -x rsa-encrypt$EXEEXT ] ; then
--- examples/rsa-verify-test
+++ examples/rsa-verify-test
@@ -4,6 +4,13 @@
srcdir=`pwd`
fi
+nettle_libdir=`dirname $PWD`/.lib
+LD_LIBRARY_PATH=$nettle_libdir
+DYLD_LIBRARY_PATH=$nettle_libdir
+
+export LD_LIBRARY_PATH
+export DYLD_LIBRARY_PATH
+
data="$srcdir/nettle-benchmark.c"
if [ -x rsa-verify$EXEEXT ] ; then
--- examples/rsa-sign-test
+++ examples/rsa-sign-test
@@ -4,6 +4,13 @@
srcdir=`pwd`
fi
+nettle_libdir=`dirname $PWD`/.lib
+LD_LIBRARY_PATH=$nettle_libdir
+DYLD_LIBRARY_PATH=$nettle_libdir
+
+export LD_LIBRARY_PATH
+export DYLD_LIBRARY_PATH
+
data="$srcdir/nettle-benchmark.c"
if [ -x rsa-sign$EXEEXT ] ; then
--- examples/nettle-openssl.c
+++ examples/nettle-openssl.c
@@ -374,6 +374,11 @@
EVP_DigestUpdate(ctx->evp, src, length);
}
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+# define EVP_MD_CTX_new EVP_MD_CTX_create
+# define EVP_MD_CTX_free EVP_MD_CTX_destroy
+#endif
+
#define OPENSSL_HASH(NAME, name) \
static void \
openssl_##name##_init(void *p) \