2010-09-28 14:30:42 +00:00
|
|
|
SUMMARY = "Secure Socket Layer"
|
2007-04-25 08:00:33 +00:00
|
|
|
DESCRIPTION = "Secure Socket Layer (SSL) binary and related cryptographic tools."
|
|
|
|
HOMEPAGE = "http://www.openssl.org/"
|
2010-06-25 09:09:40 +00:00
|
|
|
BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html"
|
2007-04-25 08:00:33 +00:00
|
|
|
SECTION = "libs/network"
|
|
|
|
|
2010-06-25 09:09:40 +00:00
|
|
|
# "openssl | SSLeay" dual license
|
|
|
|
LICENSE = "openssl"
|
2011-04-15 08:11:08 +00:00
|
|
|
LIC_FILES_CHKSUM = "file://LICENSE;md5=f9a8f968107345e0b75aa8c2ecaa7ec8"
|
2010-06-25 09:09:40 +00:00
|
|
|
|
2016-08-05 11:16:33 +00:00
|
|
|
DEPENDS = "makedepend-native hostperl-runtime-native"
|
2014-08-19 01:44:38 +00:00
|
|
|
DEPENDS_append_class-target = " openssl-native"
|
2010-06-25 09:09:40 +00:00
|
|
|
|
2011-02-17 07:16:02 +00:00
|
|
|
SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
|
|
|
|
"
|
2007-04-25 08:00:33 +00:00
|
|
|
S = "${WORKDIR}/openssl-${PV}"
|
|
|
|
|
2013-12-20 18:47:26 +00:00
|
|
|
PACKAGECONFIG[perl] = ",,,"
|
|
|
|
|
2007-04-25 08:00:33 +00:00
|
|
|
AR_append = " r"
|
2015-11-19 01:03:14 +00:00
|
|
|
TERMIO_libc-musl = "-DTERMIOS"
|
|
|
|
TERMIO ?= "-DTERMIO"
|
2012-01-12 16:30:21 +00:00
|
|
|
# Avoid binaries being marked as requiring an executable stack since it
|
|
|
|
# doesn't(which causes and this causes issues with SELinux
|
2011-07-26 05:09:13 +00:00
|
|
|
CFLAG = "${@base_conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \
|
2015-11-19 01:03:14 +00:00
|
|
|
${TERMIO} ${CFLAGS} -Wall -Wa,--noexecstack"
|
2007-04-25 08:00:33 +00:00
|
|
|
|
|
|
|
export DIRS = "crypto ssl apps"
|
2008-03-19 22:44:52 +00:00
|
|
|
export EX_LIBS = "-lgcc -ldl"
|
2007-04-25 08:00:33 +00:00
|
|
|
export AS = "${CC} -c"
|
2016-02-02 14:49:45 +00:00
|
|
|
EXTRA_OEMAKE = "-e MAKEFLAGS="
|
2007-04-25 08:00:33 +00:00
|
|
|
|
2017-02-08 16:10:50 +00:00
|
|
|
inherit pkgconfig siteinfo multilib_header ptest relative_symlinks
|
2009-11-17 12:17:43 +00:00
|
|
|
|
2013-10-28 05:15:54 +00:00
|
|
|
PACKAGES =+ "libcrypto libssl ${PN}-misc openssl-conf"
|
2016-03-15 07:13:46 +00:00
|
|
|
FILES_libcrypto = "${libdir}/libcrypto${SOLIBS}"
|
2016-04-07 00:42:05 +00:00
|
|
|
FILES_libssl = "${libdir}/libssl${SOLIBS}"
|
2010-06-25 09:09:40 +00:00
|
|
|
FILES_${PN} =+ " ${libdir}/ssl/*"
|
2016-05-23 20:45:25 +00:00
|
|
|
FILES_${PN}-misc = "${libdir}/ssl/misc"
|
2014-04-24 18:59:20 +00:00
|
|
|
RDEPENDS_${PN}-misc = "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perl', '', d)}"
|
2011-11-28 22:18:37 +00:00
|
|
|
|
2013-10-28 05:15:54 +00:00
|
|
|
# Add the openssl.cnf file to the openssl-conf package. Make the libcrypto
|
|
|
|
# package RRECOMMENDS on this package. This will enable the configuration
|
|
|
|
# file to be installed for both the base openssl package and the libcrypto
|
|
|
|
# package since the base openssl package depends on the libcrypto package.
|
2016-05-23 20:45:27 +00:00
|
|
|
FILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
|
|
|
|
CONFFILES_openssl-conf = "${sysconfdir}/ssl/openssl.cnf"
|
2013-10-28 05:15:54 +00:00
|
|
|
RRECOMMENDS_libcrypto += "openssl-conf"
|
2014-06-09 15:37:19 +00:00
|
|
|
RDEPENDS_${PN}-ptest += "${PN}-misc make perl perl-module-filehandle bc"
|
2013-10-28 05:15:54 +00:00
|
|
|
|
2015-02-16 11:18:29 +00:00
|
|
|
# Remove this to enable SSLv3. SSLv3 is defaulted to disabled due to the POODLE
|
|
|
|
# vulnerability
|
|
|
|
EXTRA_OECONF = " -no-ssl3"
|
|
|
|
|
2011-11-28 22:18:37 +00:00
|
|
|
do_configure_prepend_darwin () {
|
|
|
|
sed -i -e '/version-script=openssl\.ld/d' Configure
|
|
|
|
}
|
2007-04-25 08:00:33 +00:00
|
|
|
|
2008-05-13 09:20:50 +00:00
|
|
|
do_configure () {
|
2007-04-25 08:00:33 +00:00
|
|
|
cd util
|
2010-11-03 10:06:02 +00:00
|
|
|
perl perlpath.pl ${STAGING_BINDIR_NATIVE}
|
2007-04-25 08:00:33 +00:00
|
|
|
cd ..
|
|
|
|
ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/
|
|
|
|
|
|
|
|
os=${HOST_OS}
|
2014-08-16 01:44:16 +00:00
|
|
|
case $os in
|
2014-08-25 23:45:01 +00:00
|
|
|
linux-uclibc |\
|
2014-08-16 01:44:16 +00:00
|
|
|
linux-uclibceabi |\
|
|
|
|
linux-gnueabi |\
|
|
|
|
linux-uclibcspe |\
|
|
|
|
linux-gnuspe |\
|
|
|
|
linux-musl*)
|
2007-04-25 08:00:33 +00:00
|
|
|
os=linux
|
2014-08-16 01:44:16 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
;;
|
|
|
|
esac
|
2007-04-25 08:00:33 +00:00
|
|
|
target="$os-${HOST_ARCH}"
|
|
|
|
case $target in
|
|
|
|
linux-arm)
|
openssl: switch ARM builds from linux-elf-arm to linux-armv4 config
This enables aes and sha1 assembly at buildtime. Openssl does a
runtime check to see which portion gets enabled.
'./Configure TABLE' gives the following:
*** linux-elf-arm
$cc =
$cflags = -DL_ENDIAN -DTERMIO -O2 -pipe -g -feliminate-unused-debug-types -Wall -Wa,--noexecstack -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS
$unistd =
$thread_cflag = -D_REENTRANT
$sys_id =
$lflags = -ldl
$bn_ops = BN_LLONG DES_RISC1
$cpuid_obj =
$bn_obj =
$des_obj =
$aes_obj =
$bf_obj =
$md5_obj =
$sha1_obj =
$cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$wp_obj =
$cmll_obj =
$modes_obj =
$engines_obj =
$perlasm_scheme = void
$dso_scheme = dlfcn
$shared_target= linux-shared
$shared_cflag = -fPIC
$shared_ldflag =
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
$arflags =
$multilib =
*** linux-armv4
$cc = gcc
$cflags = -DTERMIO -O3 -Wall
$unistd =
$thread_cflag = -D_REENTRANT
$sys_id =
$lflags = -ldl
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR
$cpuid_obj = armcap.o armv4cpuid.o
$bn_obj = bn_asm.o armv4-mont.o armv4-gf2m.o
$des_obj =
$aes_obj = aes_cbc.o aes-armv4.o bsaes-armv7.o
$bf_obj =
$md5_obj =
$sha1_obj = sha1-armv4-large.o sha256-armv4.o sha512-armv4.o
$cast_obj =
$rc4_obj =
$rmd160_obj =
$rc5_obj =
$wp_obj =
$cmll_obj =
$modes_obj = ghash-armv4.o
$engines_obj =
$perlasm_scheme = void
$dso_scheme = dlfcn
$shared_target= linux-shared
$shared_cflag = -fPIC
$shared_ldflag =
$shared_extension = .so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
$ranlib =
$arflags =
$multilib =
Build tested on armv7a/angstrom and armv8/distroless, runtime tested on armv7a/angstrom.
'openssl speed' results:
Algo blocksize ops/s after
ops/s before difference
-------------------------------------------
MD5 16 308,766 264,664 -14.28%
64 277,090 263,340 -4.96%
256 212,652 197,043 -7.34%
1024 103,604 100,157 -3.33%
8192 17,936 17,796 -0.78%
sha1 16 290,011 385,098 32.79%
64 234,939 302,788 28.88%
256 144,831 177,028 22.23%
1024 57,043 67,374 18.11%
8192 8,586 9,932 15.68%
sha256 16 290,443 605,747 108.56%
64 178,010 370,598 108.19%
256 82,107 168,770 105.55%
1024 26,064 53,068 103.61%
8192 3,550 7,211 103.10%
sha512 16 59,618 259,354 335.03%
64 59,616 258,265 333.22%
256 21,727 98,057 351.31%
1024 7,449 34,304 360.49%
8192 1,047 4,842 362.63%
des cbc 16 964,682 1,124,459 16.56%
64 260,188 298,910 14.88%
256 65,945 76,273 15.66%
1024 16,570 19,110 15.33%
8192 2,082 2,398 15.17%
des ede3 16 370,442 429,906 16.05%
64 95,429 110,147 15.42%
256 23,928 27,808 16.21%
1024 5,993 6,960 16.13%
8192 752 868 15.36%
aes128 16 1,712,050 2,301,100 34.41%
64 466,491 651,155 39.59%
256 120,181 168,953 40.58%
1024 30,177 42,792 41.80%
8192 3,791 5,361 41.41%
aes192 16 1,472,560 1,964,900 33.43%
64 400,087 544,971 36.21%
256 103,245 141,062 36.63%
1024 25,902 35,389 36.63%
8192 3,256 4,451 36.67%
eas256 16 1,330,524 1,772,143 33.19%
64 355,025 486,221 36.95%
256 90,663 125,281 38.18%
1024 22,725 31,484 38.54%
8192 2,837 3,952 39.31%
rsa 2048bit 15 25 69.94%
public 547 832 52.00%
dsa 2048bit 55 86 54.26%
verify 47 73 53.33%
(From OE-Core rev: 8f29346a755d0a7690be9374cce6c88076541a3f)
Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-16 07:25:55 +00:00
|
|
|
target=linux-armv4
|
2007-04-25 08:00:33 +00:00
|
|
|
;;
|
|
|
|
linux-armeb)
|
|
|
|
target=linux-elf-armeb
|
|
|
|
;;
|
2013-10-17 16:57:10 +00:00
|
|
|
linux-aarch64*)
|
2017-01-13 19:56:49 +00:00
|
|
|
target=linux-aarch64
|
2013-10-17 16:57:10 +00:00
|
|
|
;;
|
2007-04-25 08:00:33 +00:00
|
|
|
linux-sh3)
|
|
|
|
target=debian-sh3
|
|
|
|
;;
|
|
|
|
linux-sh4)
|
|
|
|
target=debian-sh4
|
|
|
|
;;
|
|
|
|
linux-i486)
|
2008-05-13 09:20:50 +00:00
|
|
|
target=debian-i386-i486
|
2007-04-25 08:00:33 +00:00
|
|
|
;;
|
2011-11-28 22:18:37 +00:00
|
|
|
linux-i586 | linux-viac3)
|
2008-05-13 09:20:50 +00:00
|
|
|
target=debian-i386-i586
|
2007-04-25 08:00:33 +00:00
|
|
|
;;
|
|
|
|
linux-i686)
|
2008-05-13 09:20:50 +00:00
|
|
|
target=debian-i386-i686/cmov
|
2007-04-25 08:00:33 +00:00
|
|
|
;;
|
2011-12-02 20:20:01 +00:00
|
|
|
linux-gnux32-x86_64)
|
|
|
|
target=linux-x32
|
|
|
|
;;
|
|
|
|
linux-gnu64-x86_64)
|
|
|
|
target=linux-x86_64
|
|
|
|
;;
|
2016-12-16 15:14:19 +00:00
|
|
|
linux-gnun32-mips*el)
|
|
|
|
target=debian-mipsn32el
|
|
|
|
;;
|
|
|
|
linux-gnun32-mips*)
|
|
|
|
target=debian-mipsn32
|
|
|
|
;;
|
|
|
|
linux-mips*64*el)
|
|
|
|
target=debian-mips64el
|
2008-05-22 10:43:51 +00:00
|
|
|
;;
|
2016-12-16 15:14:19 +00:00
|
|
|
linux-mips*64*)
|
|
|
|
target=debian-mips64
|
|
|
|
;;
|
|
|
|
linux-mips*el)
|
2008-05-22 10:43:51 +00:00
|
|
|
target=debian-mipsel
|
|
|
|
;;
|
2016-12-16 15:14:19 +00:00
|
|
|
linux-mips*)
|
|
|
|
target=debian-mips
|
|
|
|
;;
|
2015-09-22 00:05:49 +00:00
|
|
|
linux-microblaze*|linux-nios2*)
|
2015-02-12 01:37:01 +00:00
|
|
|
target=linux-generic32
|
|
|
|
;;
|
2007-04-25 08:00:33 +00:00
|
|
|
linux-powerpc)
|
|
|
|
target=linux-ppc
|
|
|
|
;;
|
2011-07-22 09:24:56 +00:00
|
|
|
linux-powerpc64)
|
|
|
|
target=linux-ppc64
|
|
|
|
;;
|
2008-05-13 09:20:50 +00:00
|
|
|
linux-supersparc)
|
|
|
|
target=linux-sparcv8
|
|
|
|
;;
|
|
|
|
linux-sparc)
|
|
|
|
target=linux-sparcv8
|
|
|
|
;;
|
2011-11-28 22:18:37 +00:00
|
|
|
darwin-i386)
|
|
|
|
target=darwin-i386-cc
|
|
|
|
;;
|
2007-04-25 08:00:33 +00:00
|
|
|
esac
|
2008-05-13 09:20:50 +00:00
|
|
|
# inject machine-specific flags
|
|
|
|
sed -i -e "s|^\(\"$target\",\s*\"[^:]\+\):\([^:]\+\)|\1:${CFLAG}|g" Configure
|
2011-05-17 12:35:37 +00:00
|
|
|
useprefix=${prefix}
|
|
|
|
if [ "x$useprefix" = "x" ]; then
|
|
|
|
useprefix=/
|
|
|
|
fi
|
2011-07-11 07:23:15 +00:00
|
|
|
perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=`basename ${libdir}` $target
|
2008-05-13 09:20:50 +00:00
|
|
|
}
|
|
|
|
|
2014-08-19 01:44:38 +00:00
|
|
|
do_compile_prepend_class-target () {
|
|
|
|
sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile
|
|
|
|
}
|
|
|
|
|
2008-05-13 09:20:50 +00:00
|
|
|
do_compile () {
|
2016-08-05 11:16:33 +00:00
|
|
|
oe_runmake depend
|
2007-04-25 08:00:33 +00:00
|
|
|
oe_runmake
|
|
|
|
}
|
|
|
|
|
2014-04-24 17:28:25 +00:00
|
|
|
do_compile_ptest () {
|
2016-08-19 10:51:06 +00:00
|
|
|
# build dependencies for test directory too
|
|
|
|
export DIRS="$DIRS test"
|
|
|
|
oe_runmake depend
|
2014-04-24 17:28:25 +00:00
|
|
|
oe_runmake buildtest
|
|
|
|
}
|
|
|
|
|
2007-04-25 08:00:33 +00:00
|
|
|
do_install () {
|
2015-01-30 01:33:35 +00:00
|
|
|
# Create ${D}/${prefix} to fix parallel issues
|
|
|
|
mkdir -p ${D}/${prefix}/
|
|
|
|
|
2011-07-14 12:13:08 +00:00
|
|
|
oe_runmake INSTALL_PREFIX="${D}" MANDIR="${mandir}" install
|
2011-11-28 22:18:37 +00:00
|
|
|
|
2007-04-25 08:00:33 +00:00
|
|
|
oe_libinstall -so libcrypto ${D}${libdir}
|
|
|
|
oe_libinstall -so libssl ${D}${libdir}
|
2011-11-28 22:18:37 +00:00
|
|
|
|
|
|
|
install -d ${D}${includedir}
|
|
|
|
cp --dereference -R include/openssl ${D}${includedir}
|
|
|
|
|
2016-05-23 20:45:25 +00:00
|
|
|
install -Dm 0755 ${WORKDIR}/openssl-c_rehash.sh ${D}${bindir}/c_rehash
|
|
|
|
sed -i -e 's,/etc/openssl,${sysconfdir}/ssl,g' ${D}${bindir}/c_rehash
|
|
|
|
|
2013-07-29 01:53:16 +00:00
|
|
|
oe_multilib_header openssl/opensslconf.h
|
2014-04-24 18:59:20 +00:00
|
|
|
if [ "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perl', '', d)}" = "perl" ]; then
|
2013-12-20 18:47:26 +00:00
|
|
|
sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/CA.pl
|
|
|
|
sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/tsget
|
|
|
|
else
|
|
|
|
rm -f ${D}${libdir}/ssl/misc/CA.pl ${D}${libdir}/ssl/misc/tsget
|
|
|
|
fi
|
2016-05-23 20:45:27 +00:00
|
|
|
|
|
|
|
# Create SSL structure
|
|
|
|
install -d ${D}${sysconfdir}/ssl/
|
|
|
|
mv ${D}${libdir}/ssl/openssl.cnf \
|
|
|
|
${D}${libdir}/ssl/certs \
|
|
|
|
${D}${libdir}/ssl/private \
|
|
|
|
\
|
|
|
|
${D}${sysconfdir}/ssl/
|
|
|
|
ln -sf ${sysconfdir}/ssl/certs ${D}${libdir}/ssl/certs
|
|
|
|
ln -sf ${sysconfdir}/ssl/private ${D}${libdir}/ssl/private
|
|
|
|
ln -sf ${sysconfdir}/ssl/openssl.cnf ${D}${libdir}/ssl/openssl.cnf
|
2007-04-25 08:00:33 +00:00
|
|
|
}
|
2011-11-28 22:18:37 +00:00
|
|
|
|
2014-04-24 17:28:25 +00:00
|
|
|
do_install_ptest () {
|
2015-08-03 08:52:45 +00:00
|
|
|
cp -r -L Makefile.org Makefile test ${D}${PTEST_PATH}
|
|
|
|
cp Configure config e_os.h ${D}${PTEST_PATH}
|
|
|
|
cp -r -L include ${D}${PTEST_PATH}
|
2016-05-31 15:26:03 +00:00
|
|
|
ln -sf ${libdir}/libcrypto.a ${D}${PTEST_PATH}
|
2015-08-03 08:52:45 +00:00
|
|
|
ln -sf ${libdir}/libssl.a ${D}${PTEST_PATH}
|
|
|
|
mkdir -p ${D}${PTEST_PATH}/crypto
|
|
|
|
cp crypto/constant_time_locl.h ${D}${PTEST_PATH}/crypto
|
2014-06-09 15:37:19 +00:00
|
|
|
cp -r certs ${D}${PTEST_PATH}
|
2014-04-24 17:28:25 +00:00
|
|
|
mkdir -p ${D}${PTEST_PATH}/apps
|
2015-08-03 08:52:45 +00:00
|
|
|
ln -sf ${libdir}/ssl/misc/CA.sh ${D}${PTEST_PATH}/apps
|
2016-05-23 20:45:27 +00:00
|
|
|
ln -sf ${sysconfdir}/ssl/openssl.cnf ${D}${PTEST_PATH}/apps
|
2015-08-03 08:52:45 +00:00
|
|
|
ln -sf ${bindir}/openssl ${D}${PTEST_PATH}/apps
|
2016-09-23 13:26:05 +00:00
|
|
|
cp apps/server.pem ${D}${PTEST_PATH}/apps
|
2014-04-24 17:28:25 +00:00
|
|
|
cp apps/server2.pem ${D}${PTEST_PATH}/apps
|
|
|
|
mkdir -p ${D}${PTEST_PATH}/util
|
|
|
|
install util/opensslwrap.sh ${D}${PTEST_PATH}/util
|
|
|
|
install util/shlib_wrap.sh ${D}${PTEST_PATH}/util
|
2016-09-23 13:23:20 +00:00
|
|
|
# Time stamps are relevant for "make alltests", otherwise
|
|
|
|
# make may try to recompile binaries. Not only must the
|
|
|
|
# binary files be newer than the sources, they also must
|
|
|
|
# be more recent than the header files in /usr/include.
|
|
|
|
#
|
|
|
|
# Using "cp -a" is not sufficient, because do_install
|
|
|
|
# does not preserve the original time stamps.
|
|
|
|
#
|
|
|
|
# So instead of using the original file stamps, we set
|
|
|
|
# the current time for all files. Binaries will get
|
|
|
|
# modified again later when stripping them, but that's okay.
|
|
|
|
touch ${D}${PTEST_PATH}
|
|
|
|
find ${D}${PTEST_PATH} -type f -print0 | xargs --verbose -0 touch -r ${D}${PTEST_PATH}
|
2014-04-24 17:28:25 +00:00
|
|
|
}
|
|
|
|
|
2015-05-12 08:58:51 +00:00
|
|
|
do_install_append_class-native() {
|
2014-10-13 11:09:09 +00:00
|
|
|
create_wrapper ${D}${bindir}/openssl \
|
|
|
|
OPENSSL_CONF=${libdir}/ssl/openssl.cnf \
|
|
|
|
SSL_CERT_DIR=${libdir}/ssl/certs \
|
|
|
|
SSL_CERT_FILE=${libdir}/ssl/cert.pem \
|
|
|
|
OPENSSL_ENGINES=${libdir}/ssl/engines
|
|
|
|
}
|
2011-11-28 22:18:37 +00:00
|
|
|
|
2014-10-13 11:09:09 +00:00
|
|
|
BBCLASSEXTEND = "native nativesdk"
|