aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity/crda/crda
diff options
context:
space:
mode:
authorHaiqing Bai <Haiqing.Bai@windriver.com>2016-11-30 10:56:38 +0800
committerJoe MacDonald <joe_macdonald@mentor.com>2016-12-14 09:20:11 -0500
commitf25fd7a2ef99d493afe2e7dbad29cd2a813c93a1 (patch)
tree4294f7c8d53a3d04e4ce07eef06b5b0030c86212 /meta-networking/recipes-connectivity/crda/crda
parent0fc2bd373a7dbcd3523d1f4536b7f16df0f726c3 (diff)
downloadmeta-openembedded-contrib-f25fd7a2ef99d493afe2e7dbad29cd2a813c93a1.tar.gz
crda: check the word size of target instead of host machine.
Issue: LIN8-5177 When 'USE_OPENSSL=1' is configured for crda, key2pub.py doesn't create "keys-ssl.c" with target's word size. Pass 'SITEINFO_BITS' from building system to key2pub.py. (LOCAL REV: NOT UPSTREAM) -- sent to oe-devel on 20161130 Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking/recipes-connectivity/crda/crda')
-rw-r--r--meta-networking/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch58
-rw-r--r--meta-networking/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch34
2 files changed, 92 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch b/meta-networking/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
new file mode 100644
index 0000000000..93c836cf34
--- /dev/null
+++ b/meta-networking/recipes-connectivity/crda/crda/fix-issues-when-USE_OPENSSL-1.patch
@@ -0,0 +1,58 @@
+From 8d2164a090f17286ea8291f30a123595cf447dc3 Mon Sep 17 00:00:00 2001
+From: Haiqing Bai <Haiqing.Bai@windriver.com>
+Date: Wed, 30 Nov 2016 10:27:36 +0800
+Subject: [PATCH] crda: fix issues when 'USE_OPENSSL=1'.
+
+Fxed the below issues if configured with 'USE_OPENSSL=1':
+a. keys-ssl.c uses BN_ULONG but doesn't include the openssl headers leading
+ to build failures:
+ keys-ssl.c:2:8: error: unknown type name 'BN_ULONG'
+ static BN_ULONG e_0[1] = {
+
+b. The large unqualified constants also break building:
+ keys-ssl.c:8:2: warning: overflow in implicit constant conversion [-Woverflow]
+ 0x63a2705416a0d8e1, 0xdc9fca11c8ba757b,
+
+c. keys-ssl.c: error: 'keys' defined but not used [-Werror=unused-variable]
+ static struct pubkey keys[] = {
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+Upsteam-Status: Pending
+Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
+---
+ utils/key2pub.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/utils/key2pub.py b/utils/key2pub.py
+index 401d58a..3ae00b8 100755
+--- a/utils/key2pub.py
++++ b/utils/key2pub.py
+@@ -24,7 +24,7 @@ def print_ssl_64(output, name, val):
+ for v1, v2, v3, v4, v5, v6, v7, v8 in vnew:
+ if not idx:
+ output.write('\t')
+- output.write('0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2x, ' % (ord(v1), ord(v2), ord(v3), ord(v4), ord(v5), ord(v6), ord(v7), ord(v8)))
++ output.write('0x%.2x%.2x%.2x%.2x%.2x%.2x%.2x%.2xULL, ' % (ord(v1), ord(v2), ord(v3), ord(v4), ord(v5), ord(v6), ord(v7), ord(v8)))
+ idx += 1
+ if idx == 2:
+ idx = 0
+@@ -60,6 +60,7 @@ def print_ssl_32(output, name, val):
+ def print_ssl(output, name, val):
+ import os
+ output.write('#include <stdint.h>\n')
++ output.write('#include <openssl/bn.h>\n')
+ if os.getenv('TARGET_BITS') == '64':
+ return print_ssl_64(output, name, val)
+ else:
+@@ -78,7 +79,7 @@ struct pubkey {
+
+ #define KEYS(e,n) { KEY(e), KEY(n), }
+
+-static struct pubkey keys[] = {
++static struct pubkey keys[] __attribute__((unused))= {
+ ''')
+ for n in xrange(n + 1):
+ output.write(' KEYS(e_%d, n_%d),\n' % (n, n))
+--
+1.9.1
+
diff --git a/meta-networking/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch b/meta-networking/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
new file mode 100644
index 0000000000..100b765f2d
--- /dev/null
+++ b/meta-networking/recipes-connectivity/crda/crda/use-target-word-size-instead-of-host-s.patch
@@ -0,0 +1,34 @@
+From c1c42513edd27c97341f2033af77c13a4724eb8f Mon Sep 17 00:00:00 2001
+From: Haiqing Bai <Haiqing.Bai@windriver.com>
+Date: Fri, 25 Nov 2016 16:48:01 +0800
+Subject: [PATCH] crda: Use target word size instead of host's.
+
+In key2pub.py, the codes check the wordsize
+of the host machine but not the target's, this fix
+fetches the wordsize of target from the build system.
+
+Upstream-Status: Pending
+Signed-off-by: Haiqing Bai <Haiqing.Bai@windriver.com>
+---
+ utils/key2pub.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/utils/key2pub.py b/utils/key2pub.py
+index 3e84cd2..401d58a 100755
+--- a/utils/key2pub.py
++++ b/utils/key2pub.py
+@@ -58,9 +58,9 @@ def print_ssl_32(output, name, val):
+ output.write('};\n\n')
+
+ def print_ssl(output, name, val):
+- import struct
++ import os
+ output.write('#include <stdint.h>\n')
+- if len(struct.pack('@L', 0)) == 8:
++ if os.getenv('TARGET_BITS') == '64':
+ return print_ssl_64(output, name, val)
+ else:
+ return print_ssl_32(output, name, val)
+--
+1.9.1
+