line 221 fix, portability improvements

This commit is contained in:
Kaleb Himes
2014-07-23 15:58:09 -06:00
parent 2f18af2f5f
commit f51bba0a43

View File

@ -149,7 +149,7 @@ function move_ntru(){
#start in root. #start in root.
cd ../ cd ../
#if HAVE_NTRU already defined #if HAVE_NTRU already defined && there is no argument
if grep HAVE_NTRU "cyassl/options.h" && [ -z "$1" ] if grep HAVE_NTRU "cyassl/options.h" && [ -z "$1" ]
then then
@ -171,17 +171,21 @@ then
#copy/paste ntru-certs and key to certs/ #copy/paste ntru-certs and key to certs/
move_ntru move_ntru
#else if HAVE_NTRU not already defined #else if there was an argument given, check it for validity or print out error
elif [ ! -z "$1" ]; then elif [ ! -z "$1" ]; then
#valid argument then renew certs without ntru
if [ "$1" == "--override-ntru" ]; then if [ "$1" == "--override-ntru" ]; then
echo "overriding ntru, update all certs except ntru." echo "overriding ntru, update all certs except ntru."
run_renewcerts run_renewcerts
#valid argument print out other valid arguments
elif [ "$1" == "-h" ] || [ "$1" == "-help" ]; then elif [ "$1" == "-h" ] || [ "$1" == "-help" ]; then
echo "" echo ""
echo "\"no argument\" will attempt to update all certificates" echo "\"no argument\" will attempt to update all certificates"
echo "--override-ntru updates all certificates except ntru" echo "--override-ntru updates all certificates except ntru"
echo "-h or -help display this menu"
echo "" echo ""
echo "" echo ""
#else the argument was invalid, tell user to use -h or -help
else else
echo "" echo ""
echo "That is not a valid option." echo "That is not a valid option."
@ -189,6 +193,7 @@ elif [ ! -z "$1" ]; then
echo "use -h or -help for a list of available options." echo "use -h or -help for a list of available options."
echo "" echo ""
fi fi
#else HAVE_NTRU not already defined
else else
echo "Saving the configure state" echo "Saving the configure state"
echo "" echo ""
@ -199,6 +204,7 @@ else
echo "" echo ""
make clean make clean
#attempt to define ntru by configuring with ntru
echo "Configuring with ntru, enabling certgen and keygen" echo "Configuring with ntru, enabling certgen and keygen"
echo "" echo ""
./configure --with-ntru --enable-certgen --enable-keygen ./configure --with-ntru --enable-certgen --enable-keygen
@ -212,7 +218,7 @@ else
# ntru in the default location # ntru in the default location
# if now defined # if now defined
if [ grep HAVE_NTRU "cyassl/options.h" ]; then if grep HAVE_NTRU "cyassl/options.h"; then
run_renewcerts run_renewcerts
#run_renewcerts leaves us in cyassl/certs/crl, backup to root #run_renewcerts leaves us in cyassl/certs/crl, backup to root
cd ../../ cd ../../
@ -244,3 +250,4 @@ else
fi #END now defined fi #END now defined
fi #END already defined fi #END already defined