2015-06-10 08:15:28 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-07-17 11:01:33 +02:00
|
|
|
# License GPLv2, see ../LICENSE
|
|
|
|
|
2015-07-20 12:48:24 +02:00
|
|
|
echo
|
|
|
|
echo "###################################################################"
|
|
|
|
echo "####### Build script for Peter Mosmans openssl #######"
|
|
|
|
echo "####### which contains all broken and all advanced features #######"
|
|
|
|
echo "###################################################################"
|
|
|
|
echo
|
|
|
|
sleep 3
|
2015-06-10 08:15:28 +02:00
|
|
|
|
2015-07-20 12:48:24 +02:00
|
|
|
STDOPTIONS="--prefix=/usr/ --openssldir=/etc/ssl -DOPENSSL_USE_BUILD_DATE enable-zlib \
|
|
|
|
enable-ssl2 enable-ssl3 enable-ssl-trace enable-rc5 enable-rc2 \
|
2015-07-20 21:46:04 +02:00
|
|
|
enable-gost enable-cms enable-md2 enable-mdc2 enable-ec enable-ec2m enable-ecdh enable-ecdsa \
|
2016-06-23 11:04:58 +02:00
|
|
|
enable-seed enable-camellia enable-idea enable-rfc3779 experimental-jpake"
|
2015-06-10 08:15:28 +02:00
|
|
|
|
|
|
|
clean() {
|
2015-07-06 20:22:45 +02:00
|
|
|
case $NOCLEAN in
|
|
|
|
yes|Y|YES) ;;
|
|
|
|
*) make clean ;;
|
|
|
|
esac
|
2015-06-10 08:15:28 +02:00
|
|
|
#[ $? -ne 0 ] && error "no openssl directory"
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
error() {
|
|
|
|
tput bold
|
2015-07-20 21:46:04 +02:00
|
|
|
echo "### ERROR $1 ###"
|
2015-06-10 08:15:28 +02:00
|
|
|
tput sgr0
|
|
|
|
exit 2
|
|
|
|
}
|
|
|
|
|
|
|
|
makeall() {
|
2015-07-20 21:46:04 +02:00
|
|
|
make depend || error "depend"
|
|
|
|
make || error "making"
|
|
|
|
make report || error "testing/make report"
|
|
|
|
#FIXME: we need another error handler, as of now a failure doesn't mean a return status of 1
|
|
|
|
# see https://github.com/openssl/openssl/pull/336
|
2015-06-10 08:15:28 +02:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
copyfiles() {
|
|
|
|
echo; apps/openssl version -a; echo
|
2016-06-23 11:04:58 +02:00
|
|
|
if grep static <<< "$1"; then
|
|
|
|
cp -p apps/openssl ../openssl.$(uname).$(uname -m)
|
|
|
|
else
|
|
|
|
cp -p apps/openssl ../openssl.$(uname).$(uname -m).krb5
|
|
|
|
fi
|
2015-06-10 08:15:28 +02:00
|
|
|
return $?
|
|
|
|
}
|
|
|
|
|
2016-06-23 11:04:58 +02:00
|
|
|
testv6_patch() {
|
|
|
|
if grep -q 'ending bracket for IPv6' apps/s_socket.c; then
|
2016-06-23 11:13:11 +02:00
|
|
|
STDOPTIONS="$STDOPTIONS -DOPENSSL_USE_IPV6"
|
2016-06-23 11:04:58 +02:00
|
|
|
else
|
2015-06-10 08:15:28 +02:00
|
|
|
echo
|
2016-06-23 11:04:58 +02:00
|
|
|
echo "no IPv6 patch (Fedora) detected!! -- Press ^C and dl & apply from"
|
|
|
|
echo "https://github.com/drwetter/testssl.sh/blob/master/bin/fedora-dirk-ipv6.diff"
|
|
|
|
echo "or press any key to ignore"
|
2015-06-10 08:15:28 +02:00
|
|
|
echo
|
2016-06-23 11:04:58 +02:00
|
|
|
read a
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
testv6_patch
|
|
|
|
|
|
|
|
|
|
|
|
case $(uname) in
|
|
|
|
Linux|FreeBSD)
|
|
|
|
case $(uname -m) in
|
|
|
|
"i686") clean
|
|
|
|
if [[ "$1" = krb ]]; then
|
|
|
|
name2add=krb
|
|
|
|
./config $STDOPTIONS no-ec_nistp_64_gcc_128 --with-krb5-flavor=MIT
|
|
|
|
else
|
|
|
|
name2add=static
|
|
|
|
./config $STDOPTIONS no-ec_nistp_64_gcc_128 -static
|
|
|
|
fi
|
|
|
|
[ $? -ne 0 ] && error "configuring"
|
|
|
|
makeall && copyfiles "$name2add"
|
|
|
|
[ $? -ne 0 ] && error "copying files"
|
|
|
|
apps/openssl ciphers -V 'ALL:COMPLEMENTOFALL' | wc -l
|
|
|
|
echo
|
|
|
|
echo "------------ all ok ------------"
|
|
|
|
echo
|
|
|
|
;;
|
|
|
|
"x86_64") clean
|
|
|
|
if [[ "$1" = krb ]]; then
|
|
|
|
name2add=krb
|
|
|
|
./config $STDOPTIONS enable-ec_nistp_64_gcc_128 --with-krb5-flavor=MIT
|
|
|
|
else
|
|
|
|
name2add=static
|
|
|
|
./config $STDOPTIONS enable-ec_nistp_64_gcc_128 -static
|
|
|
|
fi
|
|
|
|
[ $? -ne 0 ] && error "configuring"
|
|
|
|
makeall && copyfiles "$name2add"
|
|
|
|
[ $? -ne 0 ] && error "copying files"
|
|
|
|
apps/openssl ciphers -V 'ALL:COMPLEMENTOFALL' | wc -l
|
|
|
|
echo
|
|
|
|
echo "------------ all ok ------------"
|
|
|
|
echo
|
|
|
|
;;
|
|
|
|
*) echo " Sorry, don't know this architecture $(uname -m)"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2015-06-10 08:15:28 +02:00
|
|
|
;;
|
2016-06-23 11:04:58 +02:00
|
|
|
Darwin)
|
|
|
|
|
2015-06-10 08:15:28 +02:00
|
|
|
;;
|
|
|
|
esac
|
2016-06-23 11:04:58 +02:00
|
|
|
|
2015-06-10 08:15:28 +02:00
|
|
|
|
|
|
|
# vim:tw=90:ts=5:sw=5
|
2015-07-20 21:46:04 +02:00
|
|
|
# $Id: make-openssl.sh,v 1.14 2015/07/20 19:40:54 dirkw Exp $
|
2015-06-10 08:15:28 +02:00
|
|
|
|