summaryrefslogtreecommitdiffstats
path: root/recipes-security
diff options
context:
space:
mode:
authorJackie Huang <jackie.huang@windriver.com>2017-06-15 14:44:01 +0800
committerArmin Kuster <akuster808@gmail.com>2017-07-31 08:14:47 -0700
commita80d07e3e9c9fb1a0159725b038af53bd96a1c0f (patch)
treee89fb5a79fa71f219b4a75b576f8dce925448dd3 /recipes-security
parentac8db19e5027320a1ba1b99e41424bcbe566e40b (diff)
downloadmeta-security-a80d07e3e9c9fb1a0159725b038af53bd96a1c0f.tar.gz
xmlsec1: add new recipe
XML Security Library is a C library based on LibXML2 and OpenSSL. Signed-off-by: Jackie Huang <jackie.huang@windriver.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'recipes-security')
-rw-r--r--recipes-security/xmlsec1/xmlsec1/change-finding-path-of-nss.patch68
-rw-r--r--recipes-security/xmlsec1/xmlsec1/fix-ltmain.sh.patch26
-rw-r--r--recipes-security/xmlsec1/xmlsec1/makefile-ptest.patch32
-rwxr-xr-xrecipes-security/xmlsec1/xmlsec1/run-ptest85
-rw-r--r--recipes-security/xmlsec1/xmlsec1/xmlsec1-examples-allow-build-in-separate-dir.patch32
-rw-r--r--recipes-security/xmlsec1/xmlsec1_1.2.24.bb53
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 @@
1From: Yulong Pei <Yulong.pei@windriver.com>
2Date: Wed, 21 Jul 2010 22:33:43 +0800
3Subject: [PATCH] change finding path of nss and nspr
4
5Upstream-Status: Pending
6
7Signed-off-by: Yulong Pei <Yulong.pei@windriver.com>
8Signed-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 @@
1From: Yulong Pei <Yulong.pei@windriver.com>
2Date: Thu, 21 Jan 2010 14:11:20 +0800
3Subject: [PATCH] force to use our own libtool
4
5Upstream-Status: Inappropriate [ OE specific ]
6
7Signed-off-by: Yulong Pei <Yulong.pei@windriver.com>
8---
9 ltmain.sh | 2 +-
10 1 files changed, 1 insertions(+), 1 deletions(-)
11
12diff --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--
251.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 @@
1This enables the building of the examples directory
2and it's installed as ptest.
3
4Upstream-Status: Inappropriate [ OE ptest specific ]
5
6Signed-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
3check_return() {
4 if [ $? == 0 ]; then
5 echo -e "PASS: $1\n"
6 else
7 echo -e "FAIL: $1\n"
8 fi
9}
10
11echo "---------------------------------------------------"
12echo "Signing a template file..."
13./sign1 sign1-tmpl.xml rsakey.pem > sign1-res.xml
14./verify1 sign1-res.xml rsapub.pem
15check_return sign-tmpl
16
17echo "---------------------------------------------------"
18echo "Signing a dynamicaly created template..."
19./sign2 sign2-doc.xml rsakey.pem > sign2-res.xml
20./verify1 sign2-res.xml rsapub.pem
21check_return sign-dynamic-templ
22
23echo "---------------------------------------------------"
24echo "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
27check_return sign-x509
28
29echo "---------------------------------------------------"
30echo "Verifying a signature with a single key..."
31./verify1 sign1-res.xml rsapub.pem
32./verify1 sign2-res.xml rsapub.pem
33check_return verify-single-key
34
35echo "---------------------------------------------------"
36echo "Verifying a signature with keys manager..."
37./verify2 sign1-res.xml rsapub.pem
38./verify2 sign2-res.xml rsapub.pem
39check_return verify-keys-manager
40
41echo "---------------------------------------------------"
42echo "Verifying a signature with X509 certificates..."
43./verify3 sign3-res.xml ca2cert.pem cacert.pem
44check_return verify-x509
45
46echo "---------------------------------------------------"
47echo "Verifying a signature with additional restrictions..."
48./verify4 verify4-res.xml ca2cert.pem cacert.pem
49check_return verify-res
50
51echo "---------------------------------------------------"
52echo "Encrypting data with a template file..."
53./encrypt1 encrypt1-tmpl.xml deskey.bin > encrypt1-res.xml
54./decrypt1 encrypt1-res.xml deskey.bin
55check_return encrypt-tmpl
56
57echo "---------------------------------------------------"
58echo "Encrypting data with a dynamicaly created template..."
59./encrypt2 encrypt2-doc.xml deskey.bin > encrypt2-res.xml
60./decrypt1 encrypt2-res.xml deskey.bin
61check_return encrypt-dynamic-tmpl
62
63echo "---------------------------------------------------"
64echo "Encrypting data with a session key..."
65./encrypt3 encrypt3-doc.xml rsakey.pem > encrypt3-res.xml
66./decrypt3 encrypt3-res.xml
67check_return encrypt-session-key
68
69echo "---------------------------------------------------"
70echo "Decrypting data with a single key..."
71./decrypt1 encrypt1-res.xml deskey.bin
72./decrypt1 encrypt2-res.xml deskey.bin
73check_return encrypt-single-key
74
75echo "---------------------------------------------------"
76echo "Decrypting data with keys manager..."
77./decrypt2 encrypt1-res.xml deskey.bin
78./decrypt2 encrypt2-res.xml deskey.bin
79check_return encrypt-keys-manager
80
81echo "---------------------------------------------------"
82echo "Writing a custom keys manager..."
83./decrypt3 encrypt1-res.xml
84./decrypt3 encrypt2-res.xml
85check_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 @@
1From ef8872185dcd05d20c93cd98317ede1913371c94 Mon Sep 17 00:00:00 2001
2From: Jackie Huang <jackie.huang@windriver.com>
3Date: Tue, 30 Dec 2014 11:18:17 +0800
4Subject: [PATCH] examples: allow build in separate dir
5
6Upstream-Status: Inappropriate [ OE specific ]
7
8Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
9---
10 examples/Makefile | 6 ++++--
11 1 file changed, 4 insertions(+), 2 deletions(-)
12
13diff --git a/examples/Makefile b/examples/Makefile
14index 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--
311.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 @@
1SUMMARY = "XML Security Library is a C library based on LibXML2"
2DESCRIPTION = "\
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 "
7HOMEPAGE = "http://www.aleksey.com/xmlsec/"
8DEPENDS = "libtool libxml2 libxslt openssl zlib libgcrypt gnutls nss nspr libgpg-error"
9
10LICENSE = "MIT"
11LIC_FILES_CHKSUM = "file://COPYING;md5=352791d62092ea8104f085042de7f4d0"
12
13SECTION = "libs"
14
15SRC_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
23SRC_URI[md5sum] = "2f4944356b69ea14c18814d9248fbbd8"
24SRC_URI[sha256sum] = "99a8643f118bb1261a72162f83e2deba0f4f690893b4b90e1be4f708e8d481cc"
25
26inherit autotools-brokensep ptest pkgconfig
27
28CFLAGS += "-I${STAGING_INCDIR}/nspr4 -I${STAGING_INCDIR}/nss3"
29CPPFLAGS += "-I${STAGING_INCDIR}/nspr4 -I${STAGING_INCDIR}/nss3"
30
31EXTRA_OECONF = "\
32 --with-nss=${STAGING_LIBDIR}/../.. --with-nspr=${STAGING_LIBDIR}/../.. \
33 "
34
35FILES_${PN}-dev += "${libdir}/xmlsec1Conf.sh"
36FILES_${PN}-dbg += "${PTEST_PATH}/.debug/*"
37
38RDEPENDS_${PN}-ptest += "${PN}-dev"
39INSANE_SKIP_${PN}-ptest += "dev-deps"
40
41PTEST_EXTRA_ARGS = "top_srcdir=${S} top_builddir=${B}"
42
43do_compile_ptest () {
44 oe_runmake -C ${S}/examples ${PTEST_EXTRA_ARGS} all
45}
46
47do_install_append() {
48 sed -i -e "s@${STAGING_DIR_HOST}@@g" ${D}${bindir}/xmlsec1-config
49}
50
51do_install_ptest () {
52 oe_runmake -C ${S}/examples DESTDIR=${D}${PTEST_PATH} ${PTEST_EXTRA_ARGS} install-ptest
53}