diff options
author | Mingli Yu <Mingli.Yu@windriver.com> | 2019-04-12 11:27:57 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-04-12 13:40:21 +0100 |
commit | 861e0ad2a3d5e0ea4530d6375e2c0897c8bb2102 (patch) | |
tree | 953b2668e177e8a6aea258d0345dc44e5b0bf2c2 /meta/recipes-support/nettle/nettle-3.4.1/0001-nettle-pbkdf2.c-change-the-initialization-for-salt.patch | |
parent | 047aab4f458951855c38ab6e7f923d14aba62555 (diff) | |
download | poky-861e0ad2a3d5e0ea4530d6375e2c0897c8bb2102.tar.gz |
nettle: fix ptest failure
Remove dlopen-test.patch which originally used
to fix the test dlopen-test, but autually the
patch didn't resolve the issue as dlopen-test.patch
supposes the file /usr/lib/libnettle.so exists.
Instead deploy ${D}${PTEST_PATH}/libnettle.so to
fix the dlopen-test failure.
Update the initialization for the salt to fix
below Segmentation fault and also nettle-pbkdf2-test
failure.
# echo -n passwd| nettle-pbkdf2 -i 1 -l 16 salt
[65534.886509] nettle-pbkdf2[708]: segfault at 1f594260 ip 00007f3332256998 sp 00007fff60d44410 error 4 in libnettle.so.6.5[7f3332244000+1d00]
[65534.887525] Code: e8 6d db fe ff 44 01 6d 68 48 83 c4 08 5b 5d 41 5c 41 5d 41 5e 41 5f c3 66 2e 0f 1f 84 00 00 00 00 00 49 89 dc e9 68 ff f
Segmentation fault
(From OE-Core rev: 83faaf7b2a5f4fc4ae504b300134409e90389770)
Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/nettle/nettle-3.4.1/0001-nettle-pbkdf2.c-change-the-initialization-for-salt.patch')
-rw-r--r-- | meta/recipes-support/nettle/nettle-3.4.1/0001-nettle-pbkdf2.c-change-the-initialization-for-salt.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/meta/recipes-support/nettle/nettle-3.4.1/0001-nettle-pbkdf2.c-change-the-initialization-for-salt.patch b/meta/recipes-support/nettle/nettle-3.4.1/0001-nettle-pbkdf2.c-change-the-initialization-for-salt.patch new file mode 100644 index 0000000000..713823e294 --- /dev/null +++ b/meta/recipes-support/nettle/nettle-3.4.1/0001-nettle-pbkdf2.c-change-the-initialization-for-salt.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From 7510ee2877368464ecce7de515ce056e08c75245 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingli Yu <Mingli.Yu@windriver.com> | ||
3 | Date: Fri, 12 Apr 2019 10:30:14 +0800 | ||
4 | Subject: [PATCH] nettle-pbkdf2.c: change the initialization for salt | ||
5 | |||
6 | use malloc and strncpy altogether to replace | ||
7 | strdup for salt initialization to fix below | ||
8 | Segmentation fault: | ||
9 | # echo -n passwd| nettle-pbkdf2 -i 1 -l 16 salt | ||
10 | [65534.886509] nettle-pbkdf2[708]: segfault at 1f594260 ip 00007f3332256998 sp 00007fff60d44410 error 4 in libnettle.so.6.5[7f3332244000+1d00] | ||
11 | [65534.887525] Code: e8 6d db fe ff 44 01 6d 68 48 83 c4 08 5b 5d 41 5c 41 5d 41 5e 41 5f c3 66 2e 0f 1f 84 00 00 00 00 00 49 89 dc e9 68 ff f | ||
12 | Segmentation fault | ||
13 | |||
14 | Upstream-Status: Submitted[http://lists.lysator.liu.se/pipermail/nettle-bugs/2019/007467.html] | ||
15 | |||
16 | Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> | ||
17 | --- | ||
18 | tools/nettle-pbkdf2.c | 5 ++++- | ||
19 | 1 file changed, 4 insertions(+), 1 deletion(-) | ||
20 | |||
21 | diff --git a/tools/nettle-pbkdf2.c b/tools/nettle-pbkdf2.c | ||
22 | index 1f0a301..000acd3 100644 | ||
23 | --- a/tools/nettle-pbkdf2.c | ||
24 | +++ b/tools/nettle-pbkdf2.c | ||
25 | @@ -141,7 +141,10 @@ main (int argc, char **argv) | ||
26 | return EXIT_FAILURE; | ||
27 | } | ||
28 | |||
29 | - salt = strdup (argv[0]); | ||
30 | + salt = malloc (strlen(argv[0]) + 1); | ||
31 | + if (! salt) | ||
32 | + die ("Failed to allocate memory for salt\n"); | ||
33 | + strncpy(salt, argv[0], sizeof(salt) - 1); | ||
34 | salt_length = strlen(argv[0]); | ||
35 | |||
36 | if (hex_salt) | ||
37 | -- | ||
38 | 2.7.4 | ||
39 | |||