diff options
Diffstat (limited to 'recipes-security')
6 files changed, 296 insertions, 0 deletions
diff --git a/recipes-security/xmlsec1/xmlsec1/change-finding-path-of-nss.patch b/recipes-security/xmlsec1/xmlsec1/change-finding-path-of-nss.patch new file mode 100644 index 0000000..0f4cef9 --- /dev/null +++ b/recipes-security/xmlsec1/xmlsec1/change-finding-path-of-nss.patch | |||
@@ -0,0 +1,68 @@ | |||
1 | From: Yulong Pei <Yulong.pei@windriver.com> | ||
2 | Date: Wed, 21 Jul 2010 22:33:43 +0800 | ||
3 | Subject: [PATCH] change finding path of nss and nspr | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | Signed-off-by: Yulong Pei <Yulong.pei@windriver.com> | ||
8 | Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> | ||
9 | --- | ||
10 | configure.ac | 12 ++++++------ | ||
11 | 1 files changed, 6 insertions(+), 6 deletions(-) | ||
12 | |||
13 | --- a/configure.ac | ||
14 | +++ b/configure.ac | ||
15 | @@ -618,7 +618,7 @@ | ||
16 | |||
17 | if test "z$with_nspr" != "z" ; then | ||
18 | NSPR_PREFIX="$with_nspr" | ||
19 | - NSPR_CFLAGS="-I$with_nspr/include -I$with_nspr/include/nspr" | ||
20 | + NSPR_CFLAGS="-I$with_nspr/usr/include -I$with_nspr/usr/include/nspr4" | ||
21 | if test "z$with_gnu_ld" = "zyes" ; then | ||
22 | NSPR_LIBS="-Wl,-rpath-link -Wl,$with_nspr/lib -L$with_nspr/lib $NSPR_LIBS_LIST" | ||
23 | else | ||
24 | @@ -626,7 +626,7 @@ | ||
25 | fi | ||
26 | NSPR_INCLUDES_FOUND="yes" | ||
27 | NSPR_LIBS_FOUND="yes" | ||
28 | - NSPR_PRINIT_H="$with_nspr/include/prinit.h" | ||
29 | + NSPR_PRINIT_H="$with_nspr/usr/include/nspr4/prinit.h" | ||
30 | else | ||
31 | for dir in $ac_nss_inc_dir ; do | ||
32 | if test -f $dir/nspr/prinit.h ; then | ||
33 | @@ -664,7 +664,7 @@ | ||
34 | OLD_CPPFLAGS=$CPPFLAGS | ||
35 | CPPFLAGS="$NSPR_CFLAGS" | ||
36 | AC_EGREP_CPP(yes,[ | ||
37 | - #include <prinit.h> | ||
38 | + #include <nspr4/prinit.h> | ||
39 | #if PR_VMAJOR >= 4 | ||
40 | yes | ||
41 | #endif | ||
42 | @@ -689,7 +689,7 @@ | ||
43 | NSS_NSS_H="" | ||
44 | |||
45 | if test "z$with_nss" != "z" ; then | ||
46 | - NSS_CFLAGS="$NSS_CFLAGS -I$with_nss/include -I$with_nss/include/nss" | ||
47 | + NSS_CFLAGS="$NSS_CFLAGS -I$with_nss/usr/include -I$with_nss/usr/include/nss3 -I$with_nspr/usr/include/nspr4" | ||
48 | if test "z$with_gnu_ld" = "zyes" ; then | ||
49 | NSS_LIBS="$NSS_LIBS -Wl,-rpath-link -Wl,$with_nss/lib -L$with_nss/lib $NSS_LIBS_LIST" | ||
50 | else | ||
51 | @@ -697,7 +697,7 @@ | ||
52 | fi | ||
53 | NSS_INCLUDES_FOUND="yes" | ||
54 | NSS_LIBS_FOUND="yes" | ||
55 | - NSS_NSS_H="$with_nss/include/nss.h" | ||
56 | + NSS_NSS_H="$with_nss/usr/include/nss3/nss.h" | ||
57 | else | ||
58 | for dir in $ac_nss_inc_dir ; do | ||
59 | if test -f $dir/nss/nss.h ; then | ||
60 | @@ -735,7 +735,7 @@ | ||
61 | OLD_CPPFLAGS=$CPPFLAGS | ||
62 | CPPFLAGS="$NSS_CFLAGS" | ||
63 | AC_EGREP_CPP(yes,[ | ||
64 | - #include <nss.h> | ||
65 | + #include <nss3/nss.h> | ||
66 | #if NSS_VMAJOR >= 3 && NSS_VMINOR >= 2 | ||
67 | yes | ||
68 | #endif | ||
diff --git a/recipes-security/xmlsec1/xmlsec1/fix-ltmain.sh.patch b/recipes-security/xmlsec1/xmlsec1/fix-ltmain.sh.patch new file mode 100644 index 0000000..472f1cc --- /dev/null +++ b/recipes-security/xmlsec1/xmlsec1/fix-ltmain.sh.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | From: Yulong Pei <Yulong.pei@windriver.com> | ||
2 | Date: Thu, 21 Jan 2010 14:11:20 +0800 | ||
3 | Subject: [PATCH] force to use our own libtool | ||
4 | |||
5 | Upstream-Status: Inappropriate [ OE specific ] | ||
6 | |||
7 | Signed-off-by: Yulong Pei <Yulong.pei@windriver.com> | ||
8 | --- | ||
9 | ltmain.sh | 2 +- | ||
10 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
11 | |||
12 | diff --git a/ltmain.sh b/ltmain.sh | ||
13 | --- a/ltmain.sh | ||
14 | +++ b/ltmain.sh | ||
15 | @@ -1309,7 +1309,7 @@ EOF | ||
16 | dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` | ||
17 | # We need an absolute path. | ||
18 | case $dir in | ||
19 | - [\\/]* | [A-Za-z]:[\\/]*) ;; | ||
20 | + =* | [\\/]* | [A-Za-z]:[\\/]*) ;; | ||
21 | *) | ||
22 | absdir=`cd "$dir" && pwd` | ||
23 | if test -z "$absdir"; then | ||
24 | -- | ||
25 | 1.6.4 | ||
26 | |||
diff --git a/recipes-security/xmlsec1/xmlsec1/makefile-ptest.patch b/recipes-security/xmlsec1/xmlsec1/makefile-ptest.patch new file mode 100644 index 0000000..2a199f4 --- /dev/null +++ b/recipes-security/xmlsec1/xmlsec1/makefile-ptest.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | This enables the building of the examples directory | ||
2 | and it's installed as ptest. | ||
3 | |||
4 | Upstream-Status: Inappropriate [ OE ptest specific ] | ||
5 | |||
6 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
7 | --- | ||
8 | examples/Makefile | 7 +++++-- | ||
9 | 1 files changed, 7 insertions(+), 0 deletions(-) | ||
10 | |||
11 | --- a/examples/Makefile | ||
12 | +++ b/examples/Makefile | ||
13 | @@ -9,9 +9,17 @@ | ||
14 | xmldsigverify \ | ||
15 | xkms-server | ||
16 | |||
17 | +ifndef CC | ||
18 | CC = gcc | ||
19 | -CFLAGS += -g $(shell xmlsec1-config --cflags) -DUNIX_SOCKETS | ||
20 | -LDLIBS += -g $(shell xmlsec1-config --libs) | ||
21 | +endif | ||
22 | + | ||
23 | +CFLAGS += -I../include -g $(shell PKG_CONFIG_PATH=.. pkg-config --cflags xmlsec1 ) -DUNIX_SOCKETS | ||
24 | +LDLIBS += -L../src/.libs -g $(shell PKG_CONFIG_PATH=.. pkg-config --libs xmlsec1 ) | ||
25 | + | ||
26 | +DESTDIR = /usr/share/xmlsec1 | ||
27 | +install-ptest: | ||
28 | + if [ ! -d $(DESTDIR) ]; then mkdir -p $(DESTDIR); fi | ||
29 | + cp * $(DESTDIR) | ||
30 | |||
31 | all: $(PROGRAMS) | ||
32 | |||
diff --git a/recipes-security/xmlsec1/xmlsec1/run-ptest b/recipes-security/xmlsec1/xmlsec1/run-ptest new file mode 100755 index 0000000..a203c38 --- /dev/null +++ b/recipes-security/xmlsec1/xmlsec1/run-ptest | |||
@@ -0,0 +1,85 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | check_return() { | ||
4 | if [ $? == 0 ]; then | ||
5 | echo -e "PASS: $1\n" | ||
6 | else | ||
7 | echo -e "FAIL: $1\n" | ||
8 | fi | ||
9 | } | ||
10 | |||
11 | echo "---------------------------------------------------" | ||
12 | echo "Signing a template file..." | ||
13 | ./sign1 sign1-tmpl.xml rsakey.pem > sign1-res.xml | ||
14 | ./verify1 sign1-res.xml rsapub.pem | ||
15 | check_return sign-tmpl | ||
16 | |||
17 | echo "---------------------------------------------------" | ||
18 | echo "Signing a dynamicaly created template..." | ||
19 | ./sign2 sign2-doc.xml rsakey.pem > sign2-res.xml | ||
20 | ./verify1 sign2-res.xml rsapub.pem | ||
21 | check_return sign-dynamic-templ | ||
22 | |||
23 | echo "---------------------------------------------------" | ||
24 | echo "Signing with X509 certificate..." | ||
25 | ./sign3 sign3-doc.xml rsakey.pem rsacert.pem > sign3-res.xml | ||
26 | ./verify3 sign3-res.xml ca2cert.pem cacert.pem | ||
27 | check_return sign-x509 | ||
28 | |||
29 | echo "---------------------------------------------------" | ||
30 | echo "Verifying a signature with a single key..." | ||
31 | ./verify1 sign1-res.xml rsapub.pem | ||
32 | ./verify1 sign2-res.xml rsapub.pem | ||
33 | check_return verify-single-key | ||
34 | |||
35 | echo "---------------------------------------------------" | ||
36 | echo "Verifying a signature with keys manager..." | ||
37 | ./verify2 sign1-res.xml rsapub.pem | ||
38 | ./verify2 sign2-res.xml rsapub.pem | ||
39 | check_return verify-keys-manager | ||
40 | |||
41 | echo "---------------------------------------------------" | ||
42 | echo "Verifying a signature with X509 certificates..." | ||
43 | ./verify3 sign3-res.xml ca2cert.pem cacert.pem | ||
44 | check_return verify-x509 | ||
45 | |||
46 | echo "---------------------------------------------------" | ||
47 | echo "Verifying a signature with additional restrictions..." | ||
48 | ./verify4 verify4-res.xml ca2cert.pem cacert.pem | ||
49 | check_return verify-res | ||
50 | |||
51 | echo "---------------------------------------------------" | ||
52 | echo "Encrypting data with a template file..." | ||
53 | ./encrypt1 encrypt1-tmpl.xml deskey.bin > encrypt1-res.xml | ||
54 | ./decrypt1 encrypt1-res.xml deskey.bin | ||
55 | check_return encrypt-tmpl | ||
56 | |||
57 | echo "---------------------------------------------------" | ||
58 | echo "Encrypting data with a dynamicaly created template..." | ||
59 | ./encrypt2 encrypt2-doc.xml deskey.bin > encrypt2-res.xml | ||
60 | ./decrypt1 encrypt2-res.xml deskey.bin | ||
61 | check_return encrypt-dynamic-tmpl | ||
62 | |||
63 | echo "---------------------------------------------------" | ||
64 | echo "Encrypting data with a session key..." | ||
65 | ./encrypt3 encrypt3-doc.xml rsakey.pem > encrypt3-res.xml | ||
66 | ./decrypt3 encrypt3-res.xml | ||
67 | check_return encrypt-session-key | ||
68 | |||
69 | echo "---------------------------------------------------" | ||
70 | echo "Decrypting data with a single key..." | ||
71 | ./decrypt1 encrypt1-res.xml deskey.bin | ||
72 | ./decrypt1 encrypt2-res.xml deskey.bin | ||
73 | check_return encrypt-single-key | ||
74 | |||
75 | echo "---------------------------------------------------" | ||
76 | echo "Decrypting data with keys manager..." | ||
77 | ./decrypt2 encrypt1-res.xml deskey.bin | ||
78 | ./decrypt2 encrypt2-res.xml deskey.bin | ||
79 | check_return encrypt-keys-manager | ||
80 | |||
81 | echo "---------------------------------------------------" | ||
82 | echo "Writing a custom keys manager..." | ||
83 | ./decrypt3 encrypt1-res.xml | ||
84 | ./decrypt3 encrypt2-res.xml | ||
85 | check_return write-keys-manager | ||
diff --git a/recipes-security/xmlsec1/xmlsec1/xmlsec1-examples-allow-build-in-separate-dir.patch b/recipes-security/xmlsec1/xmlsec1/xmlsec1-examples-allow-build-in-separate-dir.patch new file mode 100644 index 0000000..b0ced03 --- /dev/null +++ b/recipes-security/xmlsec1/xmlsec1/xmlsec1-examples-allow-build-in-separate-dir.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From ef8872185dcd05d20c93cd98317ede1913371c94 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jackie Huang <jackie.huang@windriver.com> | ||
3 | Date: Tue, 30 Dec 2014 11:18:17 +0800 | ||
4 | Subject: [PATCH] examples: allow build in separate dir | ||
5 | |||
6 | Upstream-Status: Inappropriate [ OE specific ] | ||
7 | |||
8 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
9 | --- | ||
10 | examples/Makefile | 6 ++++-- | ||
11 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
12 | |||
13 | diff --git a/examples/Makefile b/examples/Makefile | ||
14 | index 0d72ad7..f9bccc6 100644 | ||
15 | --- a/examples/Makefile | ||
16 | +++ b/examples/Makefile | ||
17 | @@ -13,8 +13,10 @@ ifndef CC | ||
18 | CC = gcc | ||
19 | endif | ||
20 | |||
21 | -CFLAGS += -I../include -g $(shell PKG_CONFIG_PATH=.. pkg-config --cflags xmlsec1 ) -DUNIX_SOCKETS | ||
22 | -LDLIBS += -L../src/.libs -g $(shell PKG_CONFIG_PATH=.. pkg-config --libs xmlsec1 ) | ||
23 | +top_srcdir = .. | ||
24 | +top_builddir = .. | ||
25 | +CFLAGS += -I$(top_srcdir)/include -g $(shell PKG_CONFIG_PATH=$(top_srcdir) pkg-config --cflags xmlsec1 ) -DUNIX_SOCKETS | ||
26 | +LDLIBS += -L$(top_builddir)/src/.libs -g $(shell PKG_CONFIG_PATH=$(top_srcdir) pkg-config --libs xmlsec1 ) | ||
27 | |||
28 | DESTDIR = /usr/share/xmlsec1 | ||
29 | install-ptest: | ||
30 | -- | ||
31 | 1.9.1 | ||
32 | |||
diff --git a/recipes-security/xmlsec1/xmlsec1_1.2.24.bb b/recipes-security/xmlsec1/xmlsec1_1.2.24.bb new file mode 100644 index 0000000..9798ce2 --- /dev/null +++ b/recipes-security/xmlsec1/xmlsec1_1.2.24.bb | |||
@@ -0,0 +1,53 @@ | |||
1 | SUMMARY = "XML Security Library is a C library based on LibXML2" | ||
2 | DESCRIPTION = "\ | ||
3 | XML Security Library is a C library based on \ | ||
4 | LibXML2 and OpenSSL. The library was created with a goal to support major \ | ||
5 | XML security standards "XML Digital Signature" and "XML Encryption". \ | ||
6 | " | ||
7 | HOMEPAGE = "http://www.aleksey.com/xmlsec/" | ||
8 | DEPENDS = "libtool libxml2 libxslt openssl zlib libgcrypt gnutls nss nspr libgpg-error" | ||
9 | |||
10 | LICENSE = "MIT" | ||
11 | LIC_FILES_CHKSUM = "file://COPYING;md5=352791d62092ea8104f085042de7f4d0" | ||
12 | |||
13 | SECTION = "libs" | ||
14 | |||
15 | SRC_URI = "http://www.aleksey.com/xmlsec/download/${BP}.tar.gz \ | ||
16 | file://fix-ltmain.sh.patch \ | ||
17 | file://change-finding-path-of-nss.patch \ | ||
18 | file://makefile-ptest.patch \ | ||
19 | file://xmlsec1-examples-allow-build-in-separate-dir.patch \ | ||
20 | file://run-ptest \ | ||
21 | " | ||
22 | |||
23 | SRC_URI[md5sum] = "2f4944356b69ea14c18814d9248fbbd8" | ||
24 | SRC_URI[sha256sum] = "99a8643f118bb1261a72162f83e2deba0f4f690893b4b90e1be4f708e8d481cc" | ||
25 | |||
26 | inherit autotools-brokensep ptest pkgconfig | ||
27 | |||
28 | CFLAGS += "-I${STAGING_INCDIR}/nspr4 -I${STAGING_INCDIR}/nss3" | ||
29 | CPPFLAGS += "-I${STAGING_INCDIR}/nspr4 -I${STAGING_INCDIR}/nss3" | ||
30 | |||
31 | EXTRA_OECONF = "\ | ||
32 | --with-nss=${STAGING_LIBDIR}/../.. --with-nspr=${STAGING_LIBDIR}/../.. \ | ||
33 | " | ||
34 | |||
35 | FILES_${PN}-dev += "${libdir}/xmlsec1Conf.sh" | ||
36 | FILES_${PN}-dbg += "${PTEST_PATH}/.debug/*" | ||
37 | |||
38 | RDEPENDS_${PN}-ptest += "${PN}-dev" | ||
39 | INSANE_SKIP_${PN}-ptest += "dev-deps" | ||
40 | |||
41 | PTEST_EXTRA_ARGS = "top_srcdir=${S} top_builddir=${B}" | ||
42 | |||
43 | do_compile_ptest () { | ||
44 | oe_runmake -C ${S}/examples ${PTEST_EXTRA_ARGS} all | ||
45 | } | ||
46 | |||
47 | do_install_append() { | ||
48 | sed -i -e "s@${STAGING_DIR_HOST}@@g" ${D}${bindir}/xmlsec1-config | ||
49 | } | ||
50 | |||
51 | do_install_ptest () { | ||
52 | oe_runmake -C ${S}/examples DESTDIR=${D}${PTEST_PATH} ${PTEST_EXTRA_ARGS} install-ptest | ||
53 | } | ||