Permalink
Browse files

Improved dependency check

  • Loading branch information...
1 parent bc45481 commit 60cd5d2691b3c529d429b7ea3410b24d18715287 @thomasfrivold committed Nov 12, 2013
Showing with 31 additions and 74 deletions.
  1. +14 −5 LUKSUS.functions
  2. +15 −67 LUKSUS.testarena
  3. +2 −2 LUKSUS.variables
View
@@ -511,12 +511,12 @@ LOOPBACKTEST ()
fi
}
+
LUKS ()
{
# Runtime Verification Checking
if [[ $ENCRYPTION == LUKS ]]; then
$dialogapp --msgbox "Proceeding with $ENCRYPTION" 0 0;
-echo "Using LUKS"
if [ -z `which cryptsetup` ] ; then echo "Cannot continue using LUKS. Missing cryptsetup. Please install cryptsetup (cryptsetup package)" && exit; fi else echo ""
fi
if [[ $ENCRYPTION == LUKS ]] && [[ $SECURITYMODE == PASSPHRASE ]]; then
@@ -527,20 +527,23 @@ if [[ $ENCRYPTION == LUKS ]] && [[ $SECURITYMODE == PASSPHRASE ]]; then
echo "";
fi
}
+
+
LUKSKEYFILE ()
{
# Runtime Verification Checking
if [[ $ENCRYPTION == LUKS ]]; then
$dialogapp --msgbox "Proceeding with $ENCRYPTION" 0 0;
-if [ -z `which cryptsetup` ] ; then echo "Missing cryptsetup. Cannot continue. Please install cryptsetup (cryptsetup package)" && exit; fi else echo ""
+if [ -z `which cryptsetup` ] ; then echo "Cannot continue using LUKS. Missing cryptsetup. Please install cryptsetup (cryptsetup package)" && exit; fi else echo ""
fi
- if [[ $ENCRYPTION == LUKS ]] && [[ $SECURITYMODE = KEYFILE ]]; then
+if [[ $ENCRYPTION == LUKS ]] && [[ $SECURITYMODE = KEYFILE ]]; then
echo LUKS mode;
cryptsetup --batch-mode --verbose --key-size=512 --cipher=aes-xts-plain64 luksFormat $device $keyfile;
else
echo "";
fi
}
+
LUKSOPEN ()
{
if [[ $ENCRYPTION == LUKS ]] && [[ $SECURITYMODE == KEYFILE ]]; then
@@ -611,19 +614,25 @@ OSTEST ()
TRUECRYPT ()
{
+# Runtime Verification Checking
+if [[ $ENCRYPTION == TRUECRYPT ]]; then
$dialogapp --msgbox "Proceeding with $ENCRYPTION" 0 0;
-# if [[ $ENCRYPTION == TRUECRYPT ]]; then
if [ -z `which tcplay` ] ; then echo "Missing tcplay. Cannot continue. Please install Truecrypt (tcplay package). Note that you need the Libre Open Source GPL tcplay Truecrypt package and not the Truecrypt package downloaded from the Truecrypt.com website"
-&& exit; fi
+fi
if [[ $ENCRYPTION == TRUECRYPT ]] && [[ $SECURITYMODE == PASSPHRASE ]]; then
echo TrueCrypt mode;
tcplay --create --device=$device --cipher=AES-256-XTS;
else
echo "";
fi
}
+
TRUECRYPTKEYFILE ()
{
+if [[ $ENCRYPTION == TRUECRYPT ]]; then
+$dialogapp --msgbox "Proceeding with $ENCRYPTION" 0 0;
+if [ -z `which tcplay` ] ; then echo "Missing tcplay. Cannot continue. Please install Truecrypt (tcplay package). Note that you need the Libre Open Source GPL tcplay Truecrypt package and not the Truecrypt package downloaded from the Truecrypt.com website"
+fi
$dialogapp --msgbox "Proceeding with $ENCRYPTION" 0 0;
if [[ $ENCRYPTION == TRUECRYPT ]]; then
if [ -z `which tcplay` ] ; then echo "Missing tcplay. Cannot continue. Please install Truecrypt (tcplay package)" && exit; fi
View
@@ -1,75 +1,23 @@
# FUNCTIONS FILE FOR WRITING NEW FUNCTIONS TO THE APPLICATION
# THIS FILE EXISTS BECAUSE WRITING NEW CODE EASILY BREAKS THE MAIN
# FUNCTIONS FILE AND THE WHOLE PROGRAM BREAKS
-UNAME=linux
-ENCRYPTIONENGINE()
-{
-DIALOGAPP=${DIALOG=dialog}
-tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/test$$
-trap "rm -f $tempfile" 0 1 2 5 15
+ENCRYPTION=LUKS
+dialogapp=dialog
-if [[ UNAME == Linux ]]
-then
-echo RUNNING LINUX, THESE ARE YOUR OPTIONS
-echo LUKS
-echo TRUECRYPT
-echo OPENPGP
-sleep 30s
-else
-
-$DIALOGAPP --clear --title "Set your preferred encryption engine" \
- --menu "Please choose encryption engine" 20 51 4 \
- "LUKS" "LUKS (Linux and DragonFlyBSD)" \
- "TRUECRYPT" "Truecrypt (TCPLAY) (Linux and DragonFlyBSD)" \
- "GELI" "GELI (FreeBSD)" \
- "CGD" "CGD (NetBSD)" \
- "BIOCTL" "BIOCTL (OpenBSD)" \
- "OPENPGP" "GNU GPG OPENPGP (GENERIC)" 2> $tempfile.enginemode
-
-retval=$?
-
-choice=`cat $tempfile.enginemode`
-
-case $retval in
- 0)
- echo "'$choice' is your chosen encryption engine";;
- 1)
- echo "Cancel pressed.";;
- 255)
- echo "ESC pressed.";;
-esac
+LUKS ()
+{
+# Runtime Verification Checking
+if [[ $ENCRYPTION == LUKS ]]; then
+$dialogapp --msgbox "Proceeding with $ENCRYPTION" 0 0;
+if [ -z `which cryptsetup` ] ; then echo "Cannot continue using LUKS. Missing cryptsetup. Please install cryptsetup (cryptsetup package)" && exit; fi else echo ""
fi
-}
-
-
- if [[ $UNAME = Linux ]]; then
- echo DETECTED OS: $UNAME
- echo These are the available encryption engines
- echo Please pick one.
- echo This choice can be overridden by choosing something else
- echo in the Main Menu.
-
- ENCRYPTION=LUKS;
- echo On $UNAME, defaulting to $ENCRYPTION;
+if [[ $ENCRYPTION == LUKS ]] && [[ $SECURITYMODE == PASSPHRASE ]]; then
+ echo LUKS with passphrase;
+ echo You will only be prompted for a password once. Type carefully.;
+ cryptsetup --batch-mode --verbose --cipher=aes-xts-plain64 luksFormat $device;
else
- if [[ $UNAME = DragonFly ]]; then
- ENCRYPTION=LUKS;
- echo On $UNAME, defaulting to $ENCRYPTION;
- else
- if [[ $UNAME = FreeBSD ]]; then
- ENCRYPTION=GELI;
- echo On $UNAME, Encryption set to $ENCRYPTION;
- else
- if [[ $UNAME = NetBSD ]]; then
- ENCRYPTION=CGD;
- else
- ENCRYPTION=LUKSUS;
- echo No idea what I am running on $UNAME, defaulting to $ENCRYPTION;
- fi;
- fi;
- fi;
+ echo "";
fi
}
-TRUECRYPT ()
-{
- if [[ $ENCRYPTION == TRUECRYPT ]] && [[ $USEKEY == false ]]; then
+
+LUKS
View
@@ -1,7 +1,7 @@
# This file contains variables and command substitutions (no more backticks) in variables
programname=LUKSUS
-version=v1.2.45
-date="27.10.2013"
+version=v1.2.50
+date="12.11.2013"
author="Thomas J. Frivold"
time1="$(date +%s.%N)"
# $1, %2, %3, %4 are command line arguments

0 comments on commit 60cd5d2

Please sign in to comment.